Skip to content

Commit 01e2fff

Browse files
committed
Auto merge of #131547 - matthiaskrgr:rollup-ui4p744, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #129079 (Create `_imp__` symbols also when doing ThinLTO) - #131208 (ABI: Pass aggregates by value on AIX) - #131394 (fix(rustdoc): add space between struct fields and their descriptions) - #131519 (Use Default visibility for rustc-generated C symbol declarations) - #131541 (compiletest: Extract auxiliary-crate properties to their own module/struct) - #131542 (next-solver: remove outdated FIXMEs) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f496659 + b18e1aa commit 01e2fff

File tree

20 files changed

+225
-95
lines changed

20 files changed

+225
-95
lines changed

compiler/rustc_codegen_llvm/src/declare.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
8484
unnamed: llvm::UnnamedAddr,
8585
fn_type: &'ll Type,
8686
) -> &'ll Value {
87-
// Declare C ABI functions with the visibility used by C by default.
88-
let visibility = Visibility::from_generic(self.tcx.sess.default_visibility());
89-
90-
declare_raw_fn(self, name, llvm::CCallConv, unnamed, visibility, fn_type)
87+
// Visibility should always be default for declarations, otherwise the linker may report an
88+
// error.
89+
declare_raw_fn(self, name, llvm::CCallConv, unnamed, Visibility::Default, fn_type)
9190
}
9291

9392
/// Declare an entry Function

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,8 +2164,14 @@ fn msvc_imps_needed(tcx: TyCtxt<'_>) -> bool {
21642164
&& tcx.sess.opts.cg.prefer_dynamic)
21652165
);
21662166

2167+
// We need to generate _imp__ symbol if we are generating an rlib or we include one
2168+
// indirectly from ThinLTO. In theory these are not needed as ThinLTO could resolve
2169+
// these, but it currently does not do so.
2170+
let can_have_static_objects =
2171+
tcx.sess.lto() == Lto::Thin || tcx.crate_types().iter().any(|ct| *ct == CrateType::Rlib);
2172+
21672173
tcx.sess.target.is_like_windows &&
2168-
tcx.crate_types().iter().any(|ct| *ct == CrateType::Rlib) &&
2174+
can_have_static_objects &&
21692175
// ThinLTO can't handle this workaround in all cases, so we don't
21702176
// emit the `__imp_` symbols. Instead we make them unnecessary by disallowing
21712177
// dynamic linking when linker plugin LTO is enabled.

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ where
444444
for &arg in &state.value.var_values.var_values.as_slice()
445445
[orig_values.len()..state.value.var_values.len()]
446446
{
447-
// FIXME: This is so ugly.
448447
let unconstrained = delegate.fresh_var_for_kind_with_span(arg, span);
449448
orig_values.push(unconstrained);
450449
}

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ where
9292
#[derive_where(Clone, Debug, Default; I: Interner)]
9393
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
9494
#[cfg_attr(feature = "nightly", derive(TyDecodable, TyEncodable, HashStable_NoContext))]
95-
// FIXME: This can be made crate-private once `EvalCtxt` also lives in this crate.
9695
struct NestedGoals<I: Interner> {
9796
/// These normalizes-to goals are treated specially during the evaluation
9897
/// loop. In each iteration we take the RHS of the projection, replace it with
@@ -421,6 +420,7 @@ where
421420
let (normalization_nested_goals, certainty) =
422421
self.instantiate_and_apply_query_response(goal.param_env, orig_values, response);
423422
self.inspect.goal_evaluation(goal_evaluation);
423+
424424
// FIXME: We previously had an assert here that checked that recomputing
425425
// a goal after applying its constraints did not change its response.
426426
//

compiler/rustc_next_trait_solver/src/solve/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
//!
1111
//! For a high-level overview of how this solver works, check out the relevant
1212
//! section of the rustc-dev-guide.
13-
//!
14-
//! FIXME(@lcnr): Write that section. If you read this before then ask me
15-
//! about it on zulip.
1613
1714
mod alias_relate;
1815
mod assembly;

compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ where
899899
for ty in types.iter() {
900900
// We can't find the intersection if the types used are generic.
901901
//
902-
// FIXME(effects) do we want to look at where clauses to get some
902+
// FIXME(effects): do we want to look at where clauses to get some
903903
// clue for the case where generic types are being used?
904904
let Some(kind) = ty::EffectKind::try_from_ty(cx, ty) else {
905905
return Err(NoSolution);

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ where
108108
ecx: &mut EvalCtxt<'_, D>,
109109
_guar: I::ErrorGuaranteed,
110110
) -> Result<Candidate<I>, NoSolution> {
111-
// FIXME: don't need to enter a probe here.
112111
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
113112
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
114113
}
@@ -463,7 +462,6 @@ where
463462
// Async coroutine unconditionally implement `Future`
464463
// Technically, we need to check that the future output type is Sized,
465464
// but that's already proven by the coroutine being WF.
466-
// FIXME: use `consider_implied`
467465
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
468466
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
469467
}
@@ -489,7 +487,6 @@ where
489487
// Gen coroutines unconditionally implement `Iterator`
490488
// Technically, we need to check that the iterator output type is Sized,
491489
// but that's already proven by the coroutines being WF.
492-
// FIXME: use `consider_implied`
493490
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
494491
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
495492
}
@@ -512,8 +509,7 @@ where
512509
return Err(NoSolution);
513510
}
514511

515-
// Gen coroutines unconditionally implement `FusedIterator`
516-
// FIXME: use `consider_implied`
512+
// Gen coroutines unconditionally implement `FusedIterator`.
517513
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
518514
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
519515
}
@@ -539,7 +535,6 @@ where
539535
// Gen coroutines unconditionally implement `Iterator`
540536
// Technically, we need to check that the iterator output type is Sized,
541537
// but that's already proven by the coroutines being WF.
542-
// FIXME: use `consider_implied`
543538
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc)
544539
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
545540
}
@@ -610,7 +605,7 @@ where
610605
return Err(NoSolution);
611606
}
612607

613-
// FIXME(-Znext-solver): Implement this when we get const working in the new solver
608+
// FIXME(effects): Implement this when we get const working in the new solver
614609

615610
// `Destruct` is automatically implemented for every type in
616611
// non-const environments.
@@ -631,8 +626,6 @@ where
631626
return Err(NoSolution);
632627
}
633628

634-
// FIXME: This actually should destructure the `Result` we get from transmutability and
635-
// register candidates. We probably need to register >1 since we may have an OR of ANDs.
636629
ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc).enter(|ecx| {
637630
let certainty = ecx.is_transmutable(
638631
goal.param_env,

compiler/rustc_target/src/abi/call/powerpc64.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::spec::HasTargetSpec;
1010
enum ABI {
1111
ELFv1, // original ABI used for powerpc64 (big-endian)
1212
ELFv2, // newer ABI used for powerpc64le and musl (both endians)
13+
AIX, // used by AIX OS, big-endian only
1314
}
1415
use ABI::*;
1516

@@ -23,9 +24,9 @@ where
2324
C: HasDataLayout,
2425
{
2526
arg.layout.homogeneous_aggregate(cx).ok().and_then(|ha| ha.unit()).and_then(|unit| {
26-
// ELFv1 only passes one-member aggregates transparently.
27+
// ELFv1 and AIX only passes one-member aggregates transparently.
2728
// ELFv2 passes up to eight uniquely addressable members.
28-
if (abi == ELFv1 && arg.layout.size > unit.size)
29+
if ((abi == ELFv1 || abi == AIX) && arg.layout.size > unit.size)
2930
|| arg.layout.size > unit.size.checked_mul(8, cx).unwrap()
3031
{
3132
return None;
@@ -55,8 +56,15 @@ where
5556
return;
5657
}
5758

59+
// The AIX ABI expect byval for aggregates
60+
// See https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/Targets/PPC.cpp.
61+
if !is_ret && abi == AIX {
62+
arg.pass_by_stack_offset(None);
63+
return;
64+
}
65+
5866
// The ELFv1 ABI doesn't return aggregates in registers
59-
if is_ret && abi == ELFv1 {
67+
if is_ret && (abi == ELFv1 || abi == AIX) {
6068
arg.make_indirect();
6169
return;
6270
}
@@ -93,6 +101,8 @@ where
93101
{
94102
let abi = if cx.target_spec().env == "musl" {
95103
ELFv2
104+
} else if cx.target_spec().os == "aix" {
105+
AIX
96106
} else {
97107
match cx.data_layout().endian {
98108
Endian::Big => ELFv1,

compiler/rustc_trait_selection/src/solve/delegate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
223223
if eligible { Ok(Some(node_item.item.def_id)) } else { Ok(None) }
224224
}
225225

226+
// FIXME: This actually should destructure the `Result` we get from transmutability and
227+
// register candidates. We probably need to register >1 since we may have an OR of ANDs.
226228
fn is_transmutable(
227229
&self,
228230
param_env: ty::ParamEnv<'tcx>,

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ h4.code-header {
230230
padding: 0;
231231
white-space: pre-wrap;
232232
}
233+
.structfield {
234+
margin: 0.6em 0;
235+
}
233236

234237
#crate-search,
235238
h1, h2, h3, h4, h5, h6,

0 commit comments

Comments
 (0)