Skip to content

Commit 8c8225a

Browse files
committed
Remove mono item collection strategy override from -Zprint-mono-items
Previously `-Zprint-mono-items` would override the mono item collection strategy. When debugging one doesn't want to change the behaviour, so this was counter productive. Additionally, the produced behaviour was artificial and might never arise without using the option in the first place (`-Zprint-mono-items=eager` without `-Clink-dead-code`). Finally, the option was incorrectly marked as `UNTRACKED`. Resolve those issues, by turning `-Zprint-mono-items` into a boolean flag that prints results of mono item collection without changing the behaviour of mono item collection. For codegen-units test incorporate `-Zprint-mono-items` flag directly into compiletest tool. Test changes are mechanical. `-Zprint-mono-items=lazy` was removed without additional changes, and `-Zprint-mono-items=eager` was turned into `-Clink-dead-code`. Linking dead code disables internalization, so tests have been updated accordingly.
1 parent c8b7f32 commit 8c8225a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+74
-111
lines changed

compiler/rustc_interface/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ fn test_unstable_options_tracking_hash() {
720720
untracked!(pre_link_args, vec![String::from("abc"), String::from("def")]);
721721
untracked!(print_codegen_stats, true);
722722
untracked!(print_llvm_passes, true);
723-
untracked!(print_mono_items, Some(String::from("abc")));
723+
untracked!(print_mono_items, true);
724724
untracked!(print_type_sizes, true);
725725
untracked!(proc_macro_backtrace, true);
726726
untracked!(proc_macro_execution_strategy, ProcMacroExecutionStrategy::CrossThread);

compiler/rustc_monomorphize/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ monomorphize_start_not_found = using `fn main` requires the standard library
6060
6161
monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined
6262
63-
monomorphize_unknown_cgu_collection_mode =
64-
unknown codegen-item collection mode '{$mode}', falling back to 'lazy' mode
65-
6663
monomorphize_wasm_c_abi_transition =
6764
this function {$is_call ->
6865
[true] call

compiler/rustc_monomorphize/src/errors.rs

-6
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ pub(crate) struct EncounteredErrorWhileInstantiating {
6464
#[help]
6565
pub(crate) struct StartNotFound;
6666

67-
#[derive(Diagnostic)]
68-
#[diag(monomorphize_unknown_cgu_collection_mode)]
69-
pub(crate) struct UnknownCguCollectionMode<'a> {
70-
pub mode: &'a str,
71-
}
72-
7367
#[derive(Diagnostic)]
7468
#[diag(monomorphize_abi_error_disabled_vector_type)]
7569
#[help]

compiler/rustc_monomorphize/src/partitioning.rs

+6-23
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ use rustc_target::spec::SymbolVisibility;
124124
use tracing::debug;
125125

126126
use crate::collector::{self, MonoItemCollectionStrategy, UsageMap};
127-
use crate::errors::{CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownCguCollectionMode};
127+
use crate::errors::{CouldntDumpMonoStats, SymbolAlreadyDefined};
128128

129129
struct PartitioningCx<'a, 'tcx> {
130130
tcx: TyCtxt<'tcx>,
@@ -1127,27 +1127,10 @@ where
11271127
}
11281128

11291129
fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> MonoItemPartitions<'_> {
1130-
let collection_strategy = match tcx.sess.opts.unstable_opts.print_mono_items {
1131-
Some(ref s) => {
1132-
let mode = s.to_lowercase();
1133-
let mode = mode.trim();
1134-
if mode == "eager" {
1135-
MonoItemCollectionStrategy::Eager
1136-
} else {
1137-
if mode != "lazy" {
1138-
tcx.dcx().emit_warn(UnknownCguCollectionMode { mode });
1139-
}
1140-
1141-
MonoItemCollectionStrategy::Lazy
1142-
}
1143-
}
1144-
None => {
1145-
if tcx.sess.link_dead_code() {
1146-
MonoItemCollectionStrategy::Eager
1147-
} else {
1148-
MonoItemCollectionStrategy::Lazy
1149-
}
1150-
}
1130+
let collection_strategy = if tcx.sess.link_dead_code() {
1131+
MonoItemCollectionStrategy::Eager
1132+
} else {
1133+
MonoItemCollectionStrategy::Lazy
11511134
};
11521135

11531136
let (items, usage_map) = collector::collect_crate_mono_items(tcx, collection_strategy);
@@ -1209,7 +1192,7 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> MonoItemPartitio
12091192
}
12101193
}
12111194

1212-
if tcx.sess.opts.unstable_opts.print_mono_items.is_some() {
1195+
if tcx.sess.opts.unstable_opts.print_mono_items {
12131196
let mut item_to_cgus: UnordMap<_, Vec<_>> = Default::default();
12141197

12151198
for cgu in codegen_units {

compiler/rustc_session/src/options.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2408,10 +2408,8 @@ options! {
24082408
"print codegen statistics (default: no)"),
24092409
print_llvm_passes: bool = (false, parse_bool, [UNTRACKED],
24102410
"print the LLVM optimization passes being run (default: no)"),
2411-
print_mono_items: Option<String> = (None, parse_opt_string, [UNTRACKED],
2412-
"print the result of the monomorphization collection pass. \
2413-
Value `lazy` means to use normal collection; `eager` means to collect all items.
2414-
Note that this overwrites the effect `-Clink-dead-code` has on collection!"),
2411+
print_mono_items: bool = (false, parse_bool, [UNTRACKED],
2412+
"print the result of the monomorphization collection pass (default: no)"),
24152413
print_type_sizes: bool = (false, parse_bool, [UNTRACKED],
24162414
"print layout information for each type encountered (default: no)"),
24172415
proc_macro_backtrace: bool = (false, parse_bool, [UNTRACKED],

src/doc/rustc-dev-guide/src/tests/compiletest.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,8 @@ The tests in [`tests/codegen-units`] test the
325325
[monomorphization](../backend/monomorph.md) collector and CGU partitioning.
326326

327327
These tests work by running `rustc` with a flag to print the result of the
328-
monomorphization collection pass, and then special annotations in the file are
329-
used to compare against that.
330-
331-
Each test should be annotated with the `//@
332-
compile-flags:-Zprint-mono-items=VAL` directive with the appropriate `VAL` to
333-
instruct `rustc` to print the monomorphization information.
328+
monomorphization collection pass, i.e., `-Zprint-mono-items`, and then special
329+
annotations in the file are used to compare against that.
334330

335331
Then, the test should be annotated with comments of the form `//~ MONO_ITEM
336332
name` where `name` is the monomorphized string printed by rustc like `fn <u32 as

src/tools/compiletest/src/runtest.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,10 @@ impl<'test> TestCx<'test> {
15831583
Crashes => {
15841584
set_mir_dump_dir(&mut rustc);
15851585
}
1586-
Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake | CodegenUnits | RustdocJs => {
1586+
CodegenUnits => {
1587+
rustc.arg("-Zprint-mono-items");
1588+
}
1589+
Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake | RustdocJs => {
15871590
// do not use JSON output
15881591
}
15891592
}

tests/codegen-units/item-collection/asm-sym.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ needs-asm-support
2-
//@ compile-flags: -Ccodegen-units=1 -Zprint-mono-items=lazy --crate-type=lib
2+
//@ compile-flags: -Ccodegen-units=1 --crate-type=lib
33

44
#[inline(always)]
55
pub unsafe fn f() {

tests/codegen-units/item-collection/closures.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ edition: 2021
2-
//@ compile-flags: -Zprint-mono-items=eager --crate-type=lib
2+
//@ compile-flags: -Clink-dead-code --crate-type=lib
33

44
//~ MONO_ITEM fn async_fn @@
55
//~ MONO_ITEM fn async_fn::{closure#0} @@

tests/codegen-units/item-collection/cross-crate-closures.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// We need to disable MIR inlining in both this and its aux-build crate. The MIR inliner
22
// will just inline everything into our start function if we let it. As it should.
3-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
3+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
44

55
#![deny(dead_code)]
66
#![no_main]
@@ -11,12 +11,12 @@ extern crate cgu_extern_closures;
1111
//~ MONO_ITEM fn main @@ cross_crate_closures-cgu.0[External]
1212
#[no_mangle]
1313
extern "C" fn main(_: core::ffi::c_int, _: *const *const u8) -> core::ffi::c_int {
14-
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn @@ cross_crate_closures-cgu.0[Internal]
15-
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn::{closure#0} @@ cross_crate_closures-cgu.0[Internal]
14+
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn @@ cross_crate_closures-cgu.0[External]
15+
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn::{closure#0} @@ cross_crate_closures-cgu.0[External]
1616
let _ = cgu_extern_closures::inlined_fn(1, 2);
1717

18-
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32> @@ cross_crate_closures-cgu.0[Internal]
19-
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32>::{closure#0} @@ cross_crate_closures-cgu.0[Internal]
18+
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32> @@ cross_crate_closures-cgu.0[External]
19+
//~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32>::{closure#0} @@ cross_crate_closures-cgu.0[External]
2020
let _ = cgu_extern_closures::inlined_fn_generic(3, 4, 5i32);
2121

2222
// Nothing should be generated for this call, we just link to the instance

tests/codegen-units/item-collection/cross-crate-generic-functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/cross-crate-trait-method.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no -Copt-level=0
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no -Copt-level=0
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/drop-glue-eager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Ensure that we *eagerly* monomorphize drop instances for structs with lifetimes.
22

3-
//@ compile-flags:-Zprint-mono-items=eager
3+
//@ compile-flags:-Clink-dead-code
44
//@ compile-flags:--crate-type=lib
55

66
//~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop> - shim(Some(StructWithDrop))

tests/codegen-units/item-collection/drop_in_place_intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22
//@ compile-flags:-Zinline-mir=no
33
//@ compile-flags: -O
44

tests/codegen-units/item-collection/function-as-argument.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/generic-drop-glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22
//@ compile-flags: -O
33

44
#![deny(dead_code)]

tests/codegen-units/item-collection/generic-functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/generic-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/impl-in-non-instantiated-generic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/implicit-panic-call.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ compile-flags:-Zprint-mono-items=lazy
2-
31
// rust-lang/rust#90405
42
// Ensure implicit panic calls are collected
53

tests/codegen-units/item-collection/instantiation-through-vtable.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zmir-opt-level=0
1+
//@ compile-flags:-Clink-dead-code -Zmir-opt-level=0
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]
@@ -24,15 +24,15 @@ impl<T> Trait for Struct<T> {
2424
pub fn start(_: isize, _: *const *const u8) -> isize {
2525
let s1 = Struct { _a: 0u32 };
2626

27-
//~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u32>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal]
27+
//~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u32>> - shim(None) @@ instantiation_through_vtable-cgu.0[External]
2828
//~ MONO_ITEM fn <Struct<u32> as Trait>::foo
2929
//~ MONO_ITEM fn <Struct<u32> as Trait>::bar
3030
let r1 = &s1 as &Trait;
3131
r1.foo();
3232
r1.bar();
3333

3434
let s1 = Struct { _a: 0u64 };
35-
//~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal]
35+
//~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[External]
3636
//~ MONO_ITEM fn <Struct<u64> as Trait>::foo
3737
//~ MONO_ITEM fn <Struct<u64> as Trait>::bar
3838
let _ = &s1 as &Trait;

tests/codegen-units/item-collection/items-within-generic-items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Copt-level=0
1+
//@ compile-flags:-Clink-dead-code -Copt-level=0
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]
55

6-
//~ MONO_ITEM fn temporary @@ non_generic_closures-cgu.0[Internal]
6+
//~ MONO_ITEM fn temporary @@ non_generic_closures-cgu.0[External]
77
fn temporary() {
8-
//~ MONO_ITEM fn temporary::{closure#0} @@ non_generic_closures-cgu.0[Internal]
8+
//~ MONO_ITEM fn temporary::{closure#0} @@ non_generic_closures-cgu.0[External]
99
(|a: u32| {
1010
let _ = a;
1111
})(4);
1212
}
1313

14-
//~ MONO_ITEM fn assigned_to_variable_but_not_executed @@ non_generic_closures-cgu.0[Internal]
14+
//~ MONO_ITEM fn assigned_to_variable_but_not_executed @@ non_generic_closures-cgu.0[External]
1515
fn assigned_to_variable_but_not_executed() {
1616
//~ MONO_ITEM fn assigned_to_variable_but_not_executed::{closure#0}
1717
let _x = |a: i16| {
1818
let _ = a + 1;
1919
};
2020
}
2121

22-
//~ MONO_ITEM fn assigned_to_variable_executed_indirectly @@ non_generic_closures-cgu.0[Internal]
22+
//~ MONO_ITEM fn assigned_to_variable_executed_indirectly @@ non_generic_closures-cgu.0[External]
2323
fn assigned_to_variable_executed_indirectly() {
24-
//~ MONO_ITEM fn assigned_to_variable_executed_indirectly::{closure#0} @@ non_generic_closures-cgu.0[Internal]
25-
//~ MONO_ITEM fn <{closure@TEST_PATH:28:13: 28:21} as std::ops::FnOnce<(i32,)>>::call_once - shim @@ non_generic_closures-cgu.0[Internal]
26-
//~ MONO_ITEM fn <{closure@TEST_PATH:28:13: 28:21} as std::ops::FnOnce<(i32,)>>::call_once - shim(vtable) @@ non_generic_closures-cgu.0[Internal]
27-
//~ MONO_ITEM fn std::ptr::drop_in_place::<{closure@TEST_PATH:28:13: 28:21}> - shim(None) @@ non_generic_closures-cgu.0[Internal]
24+
//~ MONO_ITEM fn assigned_to_variable_executed_indirectly::{closure#0} @@ non_generic_closures-cgu.0[External]
25+
//~ MONO_ITEM fn <{closure@TEST_PATH:28:13: 28:21} as std::ops::FnOnce<(i32,)>>::call_once - shim @@ non_generic_closures-cgu.0[External]
26+
//~ MONO_ITEM fn <{closure@TEST_PATH:28:13: 28:21} as std::ops::FnOnce<(i32,)>>::call_once - shim(vtable) @@ non_generic_closures-cgu.0[External]
27+
//~ MONO_ITEM fn std::ptr::drop_in_place::<{closure@TEST_PATH:28:13: 28:21}> - shim(None) @@ non_generic_closures-cgu.0[External]
2828
let f = |a: i32| {
2929
let _ = a + 2;
3030
};
3131
run_closure(&f);
3232
}
3333

34-
//~ MONO_ITEM fn assigned_to_variable_executed_directly @@ non_generic_closures-cgu.0[Internal]
34+
//~ MONO_ITEM fn assigned_to_variable_executed_directly @@ non_generic_closures-cgu.0[External]
3535
fn assigned_to_variable_executed_directly() {
36-
//~ MONO_ITEM fn assigned_to_variable_executed_directly::{closure#0} @@ non_generic_closures-cgu.0[Internal]
36+
//~ MONO_ITEM fn assigned_to_variable_executed_directly::{closure#0} @@ non_generic_closures-cgu.0[External]
3737
let f = |a: i64| {
3838
let _ = a + 3;
3939
};
@@ -51,7 +51,7 @@ pub fn start(_: isize, _: *const *const u8) -> isize {
5151
0
5252
}
5353

54-
//~ MONO_ITEM fn run_closure @@ non_generic_closures-cgu.0[Internal]
54+
//~ MONO_ITEM fn run_closure @@ non_generic_closures-cgu.0[External]
5555
fn run_closure(f: &Fn(i32)) {
5656
f(3);
5757
}

tests/codegen-units/item-collection/non-generic-drop-glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22
//@ compile-flags: -O
33

44
#![deny(dead_code)]

tests/codegen-units/item-collection/non-generic-functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/overloaded-operators.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/static-init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![crate_type = "lib"]
44

tests/codegen-units/item-collection/statics-and-consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/trait-implementations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/trait-method-as-argument.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/trait-method-default-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
1+
//@ compile-flags:-Clink-dead-code -Zinline-mir=no
22

33
#![deny(dead_code)]
44
#![crate_type = "lib"]

tests/codegen-units/item-collection/transitive-drop-glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22
//@ compile-flags: -O
33

44
#![deny(dead_code)]

tests/codegen-units/item-collection/tuple-drop-glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22
//@ compile-flags: -O
33

44
#![deny(dead_code)]

tests/codegen-units/item-collection/unreferenced-const-fn.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ compile-flags:-Zprint-mono-items=lazy
2-
31
#![deny(dead_code)]
42
#![crate_type = "rlib"]
53

tests/codegen-units/item-collection/unreferenced-inline-function.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ compile-flags:-Zprint-mono-items=lazy
2-
31
// N.B., we do not expect *any* monomorphization to be generated here.
42

53
#![deny(dead_code)]

tests/codegen-units/item-collection/unsizing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
21
//@ compile-flags:-Zmir-opt-level=0
32

43
#![deny(dead_code)]

tests/codegen-units/item-collection/unused-traits-and-generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags:-Zprint-mono-items=eager
1+
//@ compile-flags:-Clink-dead-code
22

33
#![crate_type = "lib"]
44
#![deny(dead_code)]

0 commit comments

Comments
 (0)