Skip to content

Commit c9271a9

Browse files
committed
Dogfood -Zno-embed-metadata in the compiler
1 parent 03d7ad7 commit c9271a9

File tree

13 files changed

+21
-41
lines changed

13 files changed

+21
-41
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,7 @@ impl Step for Std {
105105

106106
let check_stamp =
107107
build_stamp::libstd_stamp(builder, build_compiler, target).with_prefix("check");
108-
run_cargo(
109-
builder,
110-
cargo,
111-
builder.config.free_args.clone(),
112-
&check_stamp,
113-
vec![],
114-
true,
115-
false,
116-
);
108+
run_cargo(builder, cargo, builder.config.free_args.clone(), &check_stamp, vec![], false);
117109

118110
drop(_guard);
119111

@@ -148,7 +140,7 @@ impl Step for Std {
148140
build_compiler,
149141
target,
150142
);
151-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
143+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
152144
check_stamp
153145
}
154146

@@ -368,7 +360,7 @@ impl Step for Rustc {
368360
let stamp =
369361
build_stamp::librustc_stamp(builder, build_compiler, target).with_prefix("check");
370362

371-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
363+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
372364

373365
stamp
374366
}
@@ -568,7 +560,7 @@ impl Step for CraneliftCodegenBackend {
568560
)
569561
.with_prefix("check");
570562

571-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
563+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
572564
}
573565

574566
fn metadata(&self) -> Option<StepMetadata> {
@@ -639,7 +631,7 @@ impl Step for GccCodegenBackend {
639631
)
640632
.with_prefix("check");
641633

642-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
634+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
643635
}
644636

645637
fn metadata(&self) -> Option<StepMetadata> {
@@ -777,7 +769,7 @@ fn run_tool_check_step(
777769
.with_prefix(&format!("{display_name}-check"));
778770

779771
let _guard = builder.msg(builder.kind, display_name, mode, build_compiler, target);
780-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
772+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
781773
}
782774

783775
tool_check_step!(Rustdoc {

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ impl Step for Std {
214214
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
215215
&build_stamp::libstd_stamp(builder, build_compiler, target),
216216
vec![],
217-
true,
218217
false,
219218
);
220219
}
@@ -309,7 +308,6 @@ impl Step for Rustc {
309308
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
310309
&build_stamp::librustc_stamp(builder, build_compiler, target),
311310
vec![],
312-
true,
313311
false,
314312
);
315313
}
@@ -379,15 +377,7 @@ impl Step for CodegenGcc {
379377
let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, Mode::Codegen, target))
380378
.with_prefix("rustc_codegen_gcc-check");
381379

382-
run_cargo(
383-
builder,
384-
cargo,
385-
lint_args(builder, &self.config, &[]),
386-
&stamp,
387-
vec![],
388-
true,
389-
false,
390-
);
380+
run_cargo(builder, cargo, lint_args(builder, &self.config, &[]), &stamp, vec![], false);
391381
}
392382

393383
fn metadata(&self) -> Option<StepMetadata> {
@@ -469,7 +459,6 @@ macro_rules! lint_any {
469459
lint_args(builder, &self.config, &[]),
470460
&stamp,
471461
vec![],
472-
true,
473462
false,
474463
);
475464
}

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ impl Step for Std {
296296
vec![],
297297
&stamp,
298298
target_deps,
299-
self.is_for_mir_opt_tests, // is_check
300299
false,
301300
);
302301

@@ -1170,7 +1169,6 @@ impl Step for Rustc {
11701169
vec![],
11711170
&stamp,
11721171
vec![],
1173-
false,
11741172
true, // Only ship rustc_driver.so and .rmeta files, not all intermediate .rlib files.
11751173
);
11761174

@@ -1643,7 +1641,7 @@ impl Step for GccCodegenBackend {
16431641

16441642
let _guard =
16451643
builder.msg(Kind::Build, "codegen backend gcc", Mode::Codegen, build_compiler, target);
1646-
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
1644+
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
16471645

16481646
GccCodegenBackendOutput {
16491647
stamp: write_codegen_backend_stamp(stamp, files, builder.config.dry_run()),
@@ -1720,7 +1718,7 @@ impl Step for CraneliftCodegenBackend {
17201718
build_compiler,
17211719
target,
17221720
);
1723-
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
1721+
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
17241722
write_codegen_backend_stamp(stamp, files, builder.config.dry_run())
17251723
}
17261724

@@ -2438,7 +2436,6 @@ pub fn run_cargo(
24382436
tail_args: Vec<String>,
24392437
stamp: &BuildStamp,
24402438
additional_target_deps: Vec<(PathBuf, DependencyType)>,
2441-
is_check: bool,
24422439
rlib_only_metadata: bool,
24432440
) -> Vec<PathBuf> {
24442441
// `target_root_dir` looks like $dir/$target/release
@@ -2482,7 +2479,7 @@ pub fn run_cargo(
24822479
// Always keep native libraries, rust dylibs and debuginfo
24832480
keep = true;
24842481
}
2485-
if is_check && filename.ends_with(".rmeta") {
2482+
if filename.ends_with(".rmeta") {
24862483
// During check builds we need to keep crate metadata
24872484
keep = true;
24882485
} else if rlib_only_metadata {

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ impl BookTest {
25152515
let stamp = BuildStamp::new(&builder.cargo_out(test_compiler, mode, target))
25162516
.with_prefix(PathBuf::from(dep).file_name().and_then(|v| v.to_str()).unwrap());
25172517

2518-
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
2518+
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
25192519
let directories = output_paths
25202520
.into_iter()
25212521
.filter_map(|p| p.parent().map(ToOwned::to_owned))

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ impl Builder<'_> {
10741074
// Enable usage of unstable features
10751075
cargo.env("RUSTC_BOOTSTRAP", "1");
10761076

1077+
cargo.arg("-Zno-embed-metadata");
1078+
10771079
if self.config.dump_bootstrap_shims {
10781080
prepare_behaviour_dump_dir(self.build);
10791081

tests/ui/error-codes/E0152-duplicate-lang-items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! Issue: <https://github.com/rust-lang/rust/issues/31788>
55
6-
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
6+
//@ normalize-stderr: "loaded from .*libstd-.*.rmeta" -> "loaded from SYSROOT/libstd-*.rmeta"
77
//@ dont-require-annotations: NOTE
88

99
#![feature(lang_items)]

tests/ui/error-codes/E0152-duplicate-lang-items.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | | }
99
| |_^
1010
|
1111
= note: the lang item is first defined in crate `std` (which `E0152_duplicate_lang_items` depends on)
12-
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
12+
= note: first definition in `std` loaded from SYSROOT/libstd-*.rmeta
1313
= note: second definition in the local crate (`E0152_duplicate_lang_items`)
1414

1515
error: aborting due to 1 previous error

tests/ui/error-codes/E0152.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ normalize-stderr: "loaded from .*liballoc-.*.rlib" -> "loaded from SYSROOT/liballoc-*.rlib"
1+
//@ normalize-stderr: "loaded from .*liballoc-.*.rmeta" -> "loaded from SYSROOT/liballoc-*.rmeta"
22
#![feature(lang_items)]
33

44
#[lang = "owned_box"]

tests/ui/error-codes/E0152.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<T>(T);
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: the lang item is first defined in crate `alloc` (which `std` depends on)
8-
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib
8+
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rmeta
99
= note: second definition in the local crate (`E0152`)
1010

1111
error: aborting due to 1 previous error

tests/ui/lang-items/duplicate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ normalize-stderr: "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib"
1+
//@ normalize-stderr: "loaded from .*libcore-.*.rmeta" -> "loaded from SYSROOT/libcore-*.rmeta"
22
#![feature(lang_items)]
33

44
#[lang = "sized"]

0 commit comments

Comments
 (0)