Skip to content

Commit 2a5cbb0

Browse files
committed
Auto merge of rust-lang#72975 - Dylan-DPC:rollup-6zvco5x, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - rust-lang#72718 (Add regression test for rust-lang#72554) - rust-lang#72782 (rustc_target: Remove `pre_link_args_crt`) - rust-lang#72923 (Improve E0433, so that it suggests missing imports) - rust-lang#72950 (fix `AdtDef` docs) - rust-lang#72951 (Add Camelid per request) - rust-lang#72964 (Bump libc dependency to latest version (0.2.71)) Failed merges: r? @ghost
2 parents 6279571 + 26f0d7f commit 2a5cbb0

File tree

19 files changed

+253
-71
lines changed

19 files changed

+253
-71
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Brian Anderson <[email protected]> <[email protected]>
4444
4545
Brian Dawn <[email protected]>
4646
Brian Leibig <[email protected]> Brian Leibig <[email protected]>
47+
4748
Carl-Anton Ingmarsson <[email protected]> <[email protected]>
4849
Carol (Nichols || Goulding) <[email protected]> <[email protected]>
4950
Carol (Nichols || Goulding) <[email protected]> <[email protected]>

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1853,9 +1853,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
18531853

18541854
[[package]]
18551855
name = "libc"
1856-
version = "0.2.69"
1856+
version = "0.2.71"
18571857
source = "registry+https://github.com/rust-lang/crates.io-index"
1858-
checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
1858+
checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
18591859
dependencies = [
18601860
"rustc-std-workspace-core",
18611861
]

src/librustc_codegen_ssa/back/link.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -1253,20 +1253,10 @@ fn add_post_link_objects(
12531253

12541254
/// Add arbitrary "pre-link" args defined by the target spec or from command line.
12551255
/// FIXME: Determine where exactly these args need to be inserted.
1256-
fn add_pre_link_args(
1257-
cmd: &mut dyn Linker,
1258-
sess: &Session,
1259-
flavor: LinkerFlavor,
1260-
crate_type: CrateType,
1261-
) {
1256+
fn add_pre_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
12621257
if let Some(args) = sess.target.target.options.pre_link_args.get(&flavor) {
12631258
cmd.args(args);
12641259
}
1265-
if let Some(args) = sess.target.target.options.pre_link_args_crt.get(&flavor) {
1266-
if sess.crt_static(Some(crate_type)) {
1267-
cmd.args(args);
1268-
}
1269-
}
12701260
cmd.args(&sess.opts.debugging_opts.pre_link_args);
12711261
}
12721262

@@ -1502,7 +1492,7 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
15021492
let crt_objects_fallback = crt_objects_fallback(sess, crate_type);
15031493

15041494
// NO-OPT-OUT, OBJECT-FILES-MAYBE, CUSTOMIZATION-POINT
1505-
add_pre_link_args(cmd, sess, flavor, crate_type);
1495+
add_pre_link_args(cmd, sess, flavor);
15061496

15071497
// NO-OPT-OUT
15081498
add_link_script(cmd, sess, tmpdir, crate_type);

src/librustc_codegen_ssa/back/linker.rs

+15
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,21 @@ impl<'a> Linker for GccLinker<'a> {
315315
self.build_dylib(out_filename);
316316
}
317317
}
318+
// VxWorks compiler driver introduced `--static-crt` flag specifically for rustc,
319+
// it switches linking for libc and similar system libraries to static without using
320+
// any `#[link]` attributes in the `libc` crate, see #72782 for details.
321+
// FIXME: Switch to using `#[link]` attributes in the `libc` crate
322+
// similarly to other targets.
323+
if self.sess.target.target.target_os == "vxworks"
324+
&& matches!(
325+
output_kind,
326+
LinkOutputKind::StaticNoPicExe
327+
| LinkOutputKind::StaticPicExe
328+
| LinkOutputKind::StaticDylib
329+
)
330+
{
331+
self.cmd.arg("--static-crt");
332+
}
318333
}
319334

320335
fn link_dylib(&mut self, lib: Symbol) {

src/librustc_middle/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ pub struct FieldDef {
18461846

18471847
/// The definition of a user-defined type, e.g., a `struct`, `enum`, or `union`.
18481848
///
1849-
/// These are all interned (by `intern_adt_def`) into the `adt_defs` table.
1849+
/// These are all interned (by `alloc_adt_def`) into the global arena.
18501850
///
18511851
/// The initialism *ADT* stands for an [*algebraic data type (ADT)*][adt].
18521852
/// This is slightly wrong because `union`s are not ADTs.

src/librustc_resolve/diagnostics.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ crate fn show_candidates(
14751475
// This is `None` if all placement locations are inside expansions
14761476
use_placement_span: Option<Span>,
14771477
candidates: &[ImportSuggestion],
1478-
better: bool,
1478+
instead: bool,
14791479
found_use: bool,
14801480
) {
14811481
if candidates.is_empty() {
@@ -1486,6 +1486,7 @@ crate fn show_candidates(
14861486
// by iterating through a hash map, so make sure they are ordered:
14871487
let mut path_strings: Vec<_> =
14881488
candidates.iter().map(|c| path_names_to_string(&c.path)).collect();
1489+
14891490
path_strings.sort();
14901491
path_strings.dedup();
14911492

@@ -1494,8 +1495,9 @@ crate fn show_candidates(
14941495
} else {
14951496
("one of these", "items")
14961497
};
1497-
let instead = if better { " instead" } else { "" };
1498-
let msg = format!("consider importing {} {}{}", determiner, kind, instead);
1498+
1499+
let instead = if instead { " instead" } else { "" };
1500+
let mut msg = format!("consider importing {} {}{}", determiner, kind, instead);
14991501

15001502
if let Some(span) = use_placement_span {
15011503
for candidate in &mut path_strings {
@@ -1507,12 +1509,13 @@ crate fn show_candidates(
15071509

15081510
err.span_suggestions(span, &msg, path_strings.into_iter(), Applicability::Unspecified);
15091511
} else {
1510-
let mut msg = msg;
15111512
msg.push(':');
1513+
15121514
for candidate in path_strings {
15131515
msg.push('\n');
15141516
msg.push_str(&candidate);
15151517
}
1518+
15161519
err.note(&msg);
15171520
}
15181521
}

0 commit comments

Comments
 (0)