diff options
| author | bors <bors@rust-lang.org> | 2020-08-31 05:32:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-31 05:32:54 +0000 |
| commit | 8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0 (patch) | |
| tree | 2e09cb1b383f3c8fef2cc70f55b9939d7be29310 /src | |
| parent | e98f0632bbec24b196dbd6fc820537f6f3724807 (diff) | |
| parent | 6ff471b1cf85dea0e8f83b5212042905aac35143 (diff) | |
| download | rust-8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0.tar.gz rust-8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0.zip | |
Auto merge of #76027 - davidtwco:issue-61139-remove-obsolete-pretty-printer, r=eddyb
ty: remove obsolete pretty printer Fixes #61139. This PR removes the obsolete printer and replaces all uses of it with `FmtPrinter`. Of the replaced uses, all but one use was in `debug!` logging, two cases were notable: - `MonoItem::to_string` is used in `-Z print-mono-items` and therefore affects the output of all codegen-units tests (which have been updated). - `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs` with `LLVMStructCreateNamed` and that'll now get different values, but nothing will break as a result of this. cc @eddyb (whom I've discussed this with)
Diffstat (limited to 'src')
37 files changed, 358 insertions, 360 deletions
diff --git a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs b/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs index e1991046d43..7289ceee95b 100644 --- a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs +++ b/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs @@ -6,15 +6,15 @@ // aux-build:cgu_generic_function.rs extern crate cgu_generic_function; -//~ MONO_ITEM fn cross_crate_generic_functions::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn cgu_generic_function::bar[0]<u32> - //~ MONO_ITEM fn cgu_generic_function::foo[0]<u32> + //~ MONO_ITEM fn cgu_generic_function::bar::<u32> + //~ MONO_ITEM fn cgu_generic_function::foo::<u32> let _ = cgu_generic_function::foo(1u32); - //~ MONO_ITEM fn cgu_generic_function::bar[0]<u64> - //~ MONO_ITEM fn cgu_generic_function::foo[0]<u64> + //~ MONO_ITEM fn cgu_generic_function::bar::<u64> + //~ MONO_ITEM fn cgu_generic_function::foo::<u64> let _ = cgu_generic_function::foo(2u64); // This should not introduce a codegen item diff --git a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs b/src/test/codegen-units/item-collection/cross-crate-trait-method.rs index 442438b64b6..dc0984c8a98 100644 --- a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs +++ b/src/test/codegen-units/item-collection/cross-crate-trait-method.rs @@ -8,7 +8,7 @@ extern crate cgu_export_trait_method; use cgu_export_trait_method::Trait; -//~ MONO_ITEM fn cross_crate_trait_method::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { // The object code of these methods is contained in the external crate, so @@ -19,31 +19,31 @@ fn start(_: isize, _: *const *const u8) -> isize { // Currently, no object code is generated for trait methods with default // implementations, unless they are actually called from somewhere. Therefore // we cannot import the implementations and have to create our own inline. - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl[0]<u32> + //~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl let _ = Trait::with_default_impl(0u32); - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl[0]<char> + //~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl let _ = Trait::with_default_impl('c'); - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<u32, &str> + //~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl_generic::<&str> let _ = Trait::with_default_impl_generic(0u32, "abc"); - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<u32, bool> + //~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl_generic::<bool> let _ = Trait::with_default_impl_generic(0u32, false); - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<char, i16> + //~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl_generic::<i16> let _ = Trait::with_default_impl_generic('x', 1i16); - //~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<char, i32> + //~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl_generic::<i32> let _ = Trait::with_default_impl_generic('y', 0i32); - //~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[1]::without_default_impl_generic[0]<char> + //~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::without_default_impl_generic::<char> let _: (u32, char) = Trait::without_default_impl_generic('c'); - //~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[1]::without_default_impl_generic[0]<bool> + //~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::without_default_impl_generic::<bool> let _: (u32, bool) = Trait::without_default_impl_generic(false); - //~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[0]::without_default_impl_generic[0]<char> + //~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::without_default_impl_generic::<char> let _: (char, char) = Trait::without_default_impl_generic('c'); - //~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[0]::without_default_impl_generic[0]<bool> + //~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::without_default_impl_generic::<bool> let _: (char, bool) = Trait::without_default_impl_generic(false); 0 diff --git a/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs b/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs index 27fb3cb1380..adde5745feb 100644 --- a/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs +++ b/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs @@ -4,19 +4,19 @@ #![feature(start)] -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<drop_in_place_intrinsic::StructWithDtor[0]> @@ drop_in_place_intrinsic-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDtor> - shim(Some(StructWithDtor)) @@ drop_in_place_intrinsic-cgu.0[Internal] struct StructWithDtor(u32); impl Drop for StructWithDtor { - //~ MONO_ITEM fn drop_in_place_intrinsic::{{impl}}[0]::drop[0] + //~ MONO_ITEM fn <StructWithDtor as std::ops::Drop>::drop fn drop(&mut self) {} } -//~ MONO_ITEM fn drop_in_place_intrinsic::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]; 2]> @@ drop_in_place_intrinsic-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<[StructWithDtor; 2]> - shim(Some([StructWithDtor; 2])) @@ drop_in_place_intrinsic-cgu.0[Internal] let x = [StructWithDtor(0), StructWithDtor(1)]; drop_slice_in_place(&x); @@ -24,13 +24,13 @@ fn start(_: isize, _: *const *const u8) -> isize { 0 } -//~ MONO_ITEM fn drop_in_place_intrinsic::drop_slice_in_place[0] +//~ MONO_ITEM fn drop_slice_in_place fn drop_slice_in_place(x: &[StructWithDtor]) { unsafe { // This is the interesting thing in this test case: Normally we would // not have drop-glue for the unsized [StructWithDtor]. This has to be // generated though when the drop_in_place() intrinsic is used. - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]]> @@ drop_in_place_intrinsic-cgu.0[Internal] - ::std::ptr::drop_in_place(x as *const _ as *mut [StructWithDtor]); + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<[StructWithDtor]> - shim(Some([StructWithDtor])) @@ drop_in_place_intrinsic-cgu.0[Internal] + ::std::intrinsics::drop_in_place(x as *const _ as *mut [StructWithDtor]); } } diff --git a/src/test/codegen-units/item-collection/function-as-argument.rs b/src/test/codegen-units/item-collection/function-as-argument.rs index 3f61f124d24..2329dec385f 100644 --- a/src/test/codegen-units/item-collection/function-as-argument.rs +++ b/src/test/codegen-units/item-collection/function-as-argument.rs @@ -1,3 +1,4 @@ +// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] @@ -13,26 +14,26 @@ fn take_fn_pointer<T1, T2>(f: fn(T1, T2), x: T1, y: T2) { (f)(x, y) } -//~ MONO_ITEM fn function_as_argument::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn function_as_argument::take_fn_once[0]<u32, &str, fn(u32, &str)> - //~ MONO_ITEM fn function_as_argument::function[0]<u32, &str> - //~ MONO_ITEM fn core::ops[0]::function[0]::FnOnce[0]::call_once[0]<fn(u32, &str), (u32, &str)> + //~ MONO_ITEM fn take_fn_once::<u32, &str, fn(u32, &str) {function::<u32, &str>}> + //~ MONO_ITEM fn function::<u32, &str> + //~ MONO_ITEM fn <fn(u32, &str) {function::<u32, &str>} as std::ops::FnOnce<(u32, &str)>>::call_once - shim(fn(u32, &str) {function::<u32, &str>}) take_fn_once(function, 0u32, "abc"); - //~ MONO_ITEM fn function_as_argument::take_fn_once[0]<char, f64, fn(char, f64)> - //~ MONO_ITEM fn function_as_argument::function[0]<char, f64> - //~ MONO_ITEM fn core::ops[0]::function[0]::FnOnce[0]::call_once[0]<fn(char, f64), (char, f64)> + //~ MONO_ITEM fn take_fn_once::<char, f64, fn(char, f64) {function::<char, f64>}> + //~ MONO_ITEM fn function::<char, f64> + //~ MONO_ITEM fn <fn(char, f64) {function::<char, f64>} as std::ops::FnOnce<(char, f64)>>::call_once - shim(fn(char, f64) {function::<char, f64>}) take_fn_once(function, 'c', 0f64); - //~ MONO_ITEM fn function_as_argument::take_fn_pointer[0]<i32, ()> - //~ MONO_ITEM fn function_as_argument::function[0]<i32, ()> + //~ MONO_ITEM fn take_fn_pointer::<i32, ()> + //~ MONO_ITEM fn function::<i32, ()> take_fn_pointer(function, 0i32, ()); - //~ MONO_ITEM fn function_as_argument::take_fn_pointer[0]<f32, i64> - //~ MONO_ITEM fn function_as_argument::function[0]<f32, i64> + //~ MONO_ITEM fn take_fn_pointer::<f32, i64> + //~ MONO_ITEM fn function::<f32, i64> take_fn_pointer(function, 0f32, 0i64); 0 diff --git a/src/test/codegen-units/item-collection/generic-drop-glue.rs b/src/test/codegen-units/item-collection/generic-drop-glue.rs index 675bdfdb4d2..45e4a0d6d76 100644 --- a/src/test/codegen-units/item-collection/generic-drop-glue.rs +++ b/src/test/codegen-units/item-collection/generic-drop-glue.rs @@ -37,22 +37,22 @@ enum EnumNoDrop<T1, T2> { struct NonGenericNoDrop(i32); struct NonGenericWithDrop(i32); -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::NonGenericWithDrop[0]> @@ generic_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal] impl Drop for NonGenericWithDrop { - //~ MONO_ITEM fn generic_drop_glue::{{impl}}[2]::drop[0] + //~ MONO_ITEM fn <NonGenericWithDrop as std::ops::Drop>::drop fn drop(&mut self) {} } -//~ MONO_ITEM fn generic_drop_glue::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<i8, char>> @@ generic_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn generic_drop_glue::{{impl}}[0]::drop[0]<i8, char> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop<i8, char>> - shim(Some(StructWithDrop<i8, char>)) @@ generic_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <StructWithDrop<i8, char> as std::ops::Drop>::drop let _ = StructWithDrop { x: 0i8, y: 'a' }.x; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructWithDrop[0]<&str, generic_drop_glue::NonGenericNoDrop[0]>> @@ generic_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn generic_drop_glue::{{impl}}[0]::drop[0]<&str, generic_drop_glue::NonGenericNoDrop[0]> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop<&str, NonGenericNoDrop>> - shim(Some(StructWithDrop<&str, NonGenericNoDrop>)) @@ generic_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <StructWithDrop<&str, NonGenericNoDrop> as std::ops::Drop>::drop let _ = StructWithDrop { x: "&str", y: NonGenericNoDrop(0) }.y; // Should produce no drop glue @@ -60,18 +60,18 @@ fn start(_: isize, _: *const *const u8) -> isize { // This is supposed to generate drop-glue because it contains a field that // needs to be dropped. - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::StructNoDrop[0]<generic_drop_glue::NonGenericWithDrop[0], f64>> @@ generic_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructNoDrop<NonGenericWithDrop, f64>> - shim(Some(StructNoDrop<NonGenericWithDrop, f64>)) @@ generic_drop_glue-cgu.0[Internal] let _ = StructNoDrop { x: NonGenericWithDrop(0), y: 0f64 }.y; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<i32, i64>> @@ generic_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn generic_drop_glue::{{impl}}[1]::drop[0]<i32, i64> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop<i32, i64>> - shim(Some(EnumWithDrop<i32, i64>)) @@ generic_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <EnumWithDrop<i32, i64> as std::ops::Drop>::drop let _ = match EnumWithDrop::A::<i32, i64>(0) { EnumWithDrop::A(x) => x, EnumWithDrop::B(x) => x as i32 }; - //~MONO_ITEM fn core::ptr[0]::drop_in_place[0]<generic_drop_glue::EnumWithDrop[0]<f64, f32>> @@ generic_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn generic_drop_glue::{{impl}}[1]::drop[0]<f64, f32> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop<f64, f32>> - shim(Some(EnumWithDrop<f64, f32>)) @@ generic_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <EnumWithDrop<f64, f32> as std::ops::Drop>::drop let _ = match EnumWithDrop::B::<f64, f32>(1.0) { EnumWithDrop::A(x) => x, EnumWithDrop::B(x) => x as f64 diff --git a/src/test/codegen-units/item-collection/generic-functions.rs b/src/test/codegen-units/item-collection/generic-functions.rs index 83909704204..04383bb8edb 100644 --- a/src/test/codegen-units/item-collection/generic-functions.rs +++ b/src/test/codegen-units/item-collection/generic-functions.rs @@ -16,39 +16,39 @@ fn foo3<T1, T2, T3>(a: T1, b: T2, c: T3) -> (T1, T2, T3) { } // This function should be instantiated even if no used -//~ MONO_ITEM fn generic_functions::lifetime_only[0] +//~ MONO_ITEM fn lifetime_only pub fn lifetime_only<'a>(a: &'a u32) -> &'a u32 { a } -//~ MONO_ITEM fn generic_functions::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn generic_functions::foo1[0]<i32> + //~ MONO_ITEM fn foo1::<i32> let _ = foo1(2i32); - //~ MONO_ITEM fn generic_functions::foo1[0]<i64> + //~ MONO_ITEM fn foo1::<i64> let _ = foo1(2i64); - //~ MONO_ITEM fn generic_functions::foo1[0]<&str> + //~ MONO_ITEM fn foo1::<&str> let _ = foo1("abc"); - //~ MONO_ITEM fn generic_functions::foo1[0]<char> + //~ MONO_ITEM fn foo1::<char> let _ = foo1('v'); - //~ MONO_ITEM fn generic_functions::foo2[0]<i32, i32> + //~ MONO_ITEM fn foo2::<i32, i32> let _ = foo2(2i32, 2i32); - //~ MONO_ITEM fn generic_functions::foo2[0]<i64, &str> + //~ MONO_ITEM fn foo2::<i64, &str> let _ = foo2(2i64, "abc"); - //~ MONO_ITEM fn generic_functions::foo2[0]<&str, usize> + //~ MONO_ITEM fn foo2::<&str, usize> let _ = foo2("a", 2usize); - //~ MONO_ITEM fn generic_functions::foo2[0]<char, ()> + //~ MONO_ITEM fn foo2::<char, ()> let _ = foo2('v', ()); - //~ MONO_ITEM fn generic_functions::foo3[0]<i32, i32, i32> + //~ MONO_ITEM fn foo3::<i32, i32, i32> let _ = foo3(2i32, 2i32, 2i32); - //~ MONO_ITEM fn generic_functions::foo3[0]<i64, &str, char> + //~ MONO_ITEM fn foo3::<i64, &str, char> let _ = foo3(2i64, "abc", 'c'); - //~ MONO_ITEM fn generic_functions::foo3[0]<i16, &str, usize> + //~ MONO_ITEM fn foo3::<i16, &str, usize> let _ = foo3(0i16, "a", 2usize); - //~ MONO_ITEM fn generic_functions::foo3[0]<char, (), ()> + //~ MONO_ITEM fn foo3::<char, (), ()> let _ = foo3('v', (), ()); 0 diff --git a/src/test/codegen-units/item-collection/generic-impl.rs b/src/test/codegen-units/item-collection/generic-impl.rs index 571bb4fa867..dd5367ef038 100644 --- a/src/test/codegen-units/item-collection/generic-impl.rs +++ b/src/test/codegen-units/item-collection/generic-impl.rs @@ -30,41 +30,41 @@ pub struct LifeTimeOnly<'a> { impl<'a> LifeTimeOnly<'a> { - //~ MONO_ITEM fn generic_impl::{{impl}}[1]::foo[0] + //~ MONO_ITEM fn LifeTimeOnly::foo pub fn foo(&self) {} - //~ MONO_ITEM fn generic_impl::{{impl}}[1]::bar[0] + //~ MONO_ITEM fn LifeTimeOnly::bar pub fn bar(&'a self) {} - //~ MONO_ITEM fn generic_impl::{{impl}}[1]::baz[0] + //~ MONO_ITEM fn LifeTimeOnly::baz pub fn baz<'b>(&'b self) {} pub fn non_instantiated<T>(&self) {} } -//~ MONO_ITEM fn generic_impl::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::new[0]<i32> - //~ MONO_ITEM fn generic_impl::id[0]<i32> - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::get[0]<i32, i16> + //~ MONO_ITEM fn Struct::<i32>::new + //~ MONO_ITEM fn id::<i32> + //~ MONO_ITEM fn Struct::<i32>::get::<i16> let _ = Struct::new(0i32).get(0i16); - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::new[0]<i64> - //~ MONO_ITEM fn generic_impl::id[0]<i64> - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::get[0]<i64, i16> + //~ MONO_ITEM fn Struct::<i64>::new + //~ MONO_ITEM fn id::<i64> + //~ MONO_ITEM fn Struct::<i64>::get::<i16> let _ = Struct::new(0i64).get(0i16); - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::new[0]<char> - //~ MONO_ITEM fn generic_impl::id[0]<char> - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::get[0]<char, i16> + //~ MONO_ITEM fn Struct::<char>::new + //~ MONO_ITEM fn id::<char> + //~ MONO_ITEM fn Struct::<char>::get::<i16> let _ = Struct::new('c').get(0i16); - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::new[0]<&str> - //~ MONO_ITEM fn generic_impl::id[0]<&str> - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::get[0]<generic_impl::Struct[0]<&str>, i16> + //~ MONO_ITEM fn Struct::<&str>::new + //~ MONO_ITEM fn id::<&str> + //~ MONO_ITEM fn Struct::<Struct<&str>>::get::<i16> let _ = Struct::new(Struct::new("str")).get(0i16); - //~ MONO_ITEM fn generic_impl::{{impl}}[0]::new[0]<generic_impl::Struct[0]<&str>> - //~ MONO_ITEM fn generic_impl::id[0]<generic_impl::Struct[0]<&str>> + //~ MONO_ITEM fn Struct::<Struct<&str>>::new + //~ MONO_ITEM fn id::<Struct<&str>> let _ = (Struct::new(Struct::new("str")).f)(Struct::new("str")); 0 diff --git a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs b/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs index e45644cd375..c01398eb234 100644 --- a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs +++ b/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs @@ -11,14 +11,14 @@ trait SomeTrait { // discovered. pub fn generic_function<T>(x: T) -> (T, i32) { impl SomeTrait for i64 { - //~ MONO_ITEM fn impl_in_non_instantiated_generic::generic_function[0]::{{impl}}[0]::foo[0] + //~ MONO_ITEM fn generic_function::<impl SomeTrait for i64>::foo fn foo(&self) {} } (x, 0) } -//~ MONO_ITEM fn impl_in_non_instantiated_generic::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { 0i64.foo(); diff --git a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs b/src/test/codegen-units/item-collection/instantiation-through-vtable.rs index db0390b58c8..63966a7ec97 100644 --- a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs +++ b/src/test/codegen-units/item-collection/instantiation-through-vtable.rs @@ -19,20 +19,20 @@ impl<T> Trait for Struct<T> { fn bar(&self) {} } -//~ MONO_ITEM fn instantiation_through_vtable::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { let s1 = Struct { _a: 0u32 }; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u32>> @@ instantiation_through_vtable-cgu.0[Internal] - //~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0]<u32> - //~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u32> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct<u32>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal] + //~ MONO_ITEM fn <Struct<u32> as Trait>::foo + //~ MONO_ITEM fn <Struct<u32> as Trait>::bar let _ = &s1 as &Trait; let s1 = Struct { _a: 0u64 }; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<instantiation_through_vtable::Struct[0]<u64>> @@ instantiation_through_vtable-cgu.0[Internal] - //~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0]<u64> - //~ MONO_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0]<u64> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal] + //~ MONO_ITEM fn <Struct<u64> as Trait>::foo + //~ MONO_ITEM fn <Struct<u64> as Trait>::bar let _ = &s1 as &Trait; 0 diff --git a/src/test/codegen-units/item-collection/items-within-generic-items.rs b/src/test/codegen-units/item-collection/items-within-generic-items.rs index 10bc52f6a8d..d37d7f7d9b2 100644 --- a/src/test/codegen-units/item-collection/items-within-generic-items.rs +++ b/src/test/codegen-units/item-collection/items-within-generic-items.rs @@ -4,13 +4,13 @@ #![feature(start)] fn generic_fn<T>(a: T) -> (T, i32) { - //~ MONO_ITEM fn items_within_generic_items::generic_fn[0]::nested_fn[0] + //~ MONO_ITEM fn generic_fn::nested_fn fn nested_fn(a: i32) -> i32 { a + 1 } let x = { - //~ MONO_ITEM fn items_within_generic_items::generic_fn[0]::nested_fn[1] + //~ MONO_ITEM fn generic_fn::nested_fn fn nested_fn(a: i32) -> i32 { a + 2 } @@ -21,14 +21,14 @@ fn generic_fn<T>(a: T) -> (T, i32) { return (a, x + nested_fn(0)); } -//~ MONO_ITEM fn items_within_generic_items::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn items_within_generic_items::generic_fn[0]<i64> + //~ MONO_ITEM fn generic_fn::<i64> let _ = generic_fn(0i64); - //~ MONO_ITEM fn items_within_generic_items::generic_fn[0]<u16> + //~ MONO_ITEM fn generic_fn::<u16> let _ = generic_fn(0u16); - //~ MONO_ITEM fn items_within_generic_items::generic_fn[0]<i8> + //~ MONO_ITEM fn generic_fn::<i8> let _ = generic_fn(0i8); 0 diff --git a/src/test/codegen-units/item-collection/non-generic-drop-glue.rs b/src/test/codegen-units/item-collection/non-generic-drop-glue.rs index a899b8b2c8b..b5837716814 100644 --- a/src/test/codegen-units/item-collection/non-generic-drop-glue.rs +++ b/src/test/codegen-units/item-collection/non-generic-drop-glue.rs @@ -5,13 +5,13 @@ #![deny(dead_code)] #![feature(start)] -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::StructWithDrop[0]> @@ non_generic_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop> - shim(Some(StructWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal] struct StructWithDrop { x: i32 } impl Drop for StructWithDrop { - //~ MONO_ITEM fn non_generic_drop_glue::{{impl}}[0]::drop[0] + //~ MONO_ITEM fn <StructWithDrop as std::ops::Drop>::drop fn drop(&mut self) {} } @@ -19,13 +19,13 @@ struct StructNoDrop { x: i32 } -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<non_generic_drop_glue::EnumWithDrop[0]> @@ non_generic_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop> - shim(Some(EnumWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal] enum EnumWithDrop { A(i32) } impl Drop for EnumWithDrop { - //~ MONO_ITEM fn non_generic_drop_glue::{{impl}}[1]::drop[0] + //~ MONO_ITEM fn <EnumWithDrop as std::ops::Drop>::drop fn drop(&mut self) {} } @@ -33,7 +33,7 @@ enum EnumNoDrop { A(i32) } -//~ MONO_ITEM fn non_generic_drop_glue::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { let _ = StructWithDrop { x: 0 }.x; diff --git a/src/test/codegen-units/item-collection/non-generic-functions.rs b/src/test/codegen-units/item-collection/non-generic-functions.rs index 26d2fb1b421..092e64562c5 100644 --- a/src/test/codegen-units/item-collection/non-generic-functions.rs +++ b/src/test/codegen-units/item-collection/non-generic-functions.rs @@ -3,24 +3,24 @@ #![deny(dead_code)] #![feature(start)] -//~ MONO_ITEM fn non_generic_functions::foo[0] +//~ MONO_ITEM fn foo fn foo() { { - //~ MONO_ITEM fn non_generic_functions::foo[0]::foo[0] + //~ MONO_ITEM fn foo::foo fn foo() {} foo(); } { - //~ MONO_ITEM fn non_generic_functions::foo[0]::foo[1] + //~ MONO_ITEM fn foo::foo fn foo() {} foo(); } } -//~ MONO_ITEM fn non_generic_functions::bar[0] +//~ MONO_ITEM fn bar fn bar() { - //~ MONO_ITEM fn non_generic_functions::bar[0]::baz[0] + //~ MONO_ITEM fn bar::baz fn baz() {} baz(); } @@ -28,38 +28,38 @@ fn bar() { struct Struct { _x: i32 } impl Struct { - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::foo[0] + //~ MONO_ITEM fn Struct::foo fn foo() { { - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::foo[0]::foo[0] + //~ MONO_ITEM fn Struct::foo::foo fn foo() {} foo(); } { - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::foo[0]::foo[1] + //~ MONO_ITEM fn Struct::foo::foo fn foo() {} foo(); } } - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::bar[0] + //~ MONO_ITEM fn Struct::bar fn bar(&self) { { - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::bar[0]::foo[0] + //~ MONO_ITEM fn Struct::bar::foo fn foo() {} foo(); } { - //~ MONO_ITEM fn non_generic_functions::{{impl}}[0]::bar[0]::foo[1] + //~ MONO_ITEM fn Struct::bar::foo fn foo() {} foo(); } } } -//~ MONO_ITEM fn non_generic_functions::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { foo(); diff --git a/src/test/codegen-units/item-collection/overloaded-operators.rs b/src/test/codegen-units/item-collection/overloaded-operators.rs index 0b4c97723d6..2be7eba1d84 100644 --- a/src/test/codegen-units/item-collection/overloaded-operators.rs +++ b/src/test/codegen-units/item-collection/overloaded-operators.rs @@ -12,7 +12,7 @@ pub struct Indexable { impl Index<usize> for Indexable { type Output = u8; - //~ MONO_ITEM fn overloaded_operators::{{impl}}[0]::index[0] + //~ MONO_ITEM fn <Indexable as std::ops::Index<usize>>::index fn index(&self, index: usize) -> &Self::Output { if index >= 3 { &self.data[0] @@ -23,7 +23,7 @@ impl Index<usize> for Indexable { } impl IndexMut<usize> for Indexable { - //~ MONO_ITEM fn overloaded_operators::{{impl}}[1]::index_mut[0] + //~ MONO_ITEM fn <Indexable as std::ops::IndexMut<usize>>::index_mut fn index_mut(&mut self, index: usize) -> &mut Self::Output { if index >= 3 { &mut self.data[0] @@ -34,8 +34,8 @@ impl IndexMut<usize> for Indexable { } -//~ MONO_ITEM fn overloaded_operators::{{impl}}[5]::eq[0] -//~ MONO_ITEM fn overloaded_operators::{{impl}}[5]::ne[0] +//~ MONO_ITEM fn <Equatable as std::cmp::PartialEq>::eq +//~ MONO_ITEM fn <Equatable as std::cmp::PartialEq>::ne #[derive(PartialEq)] pub struct Equatable(u32); @@ -43,7 +43,7 @@ pub struct Equatable(u32); impl Add<u32> for Equatable { type Output = u32; - //~ MONO_ITEM fn overloaded_operators::{{impl}}[2]::add[0] + //~ MONO_ITEM fn <Equatable as std::ops::Add<u32>>::add fn add(self, rhs: u32) -> u32 { self.0 + rhs } @@ -52,7 +52,7 @@ impl Add<u32> for Equatable { impl Deref for Equatable { type Target = u32; - //~ MONO_ITEM fn overloaded_operators::{{impl}}[3]::deref[0] + //~ MONO_ITEM fn <Equatable as std::ops::Deref>::deref fn deref(&self) -> &Self::Target { &self.0 } diff --git a/src/test/codegen-units/item-collection/static-init.rs b/src/test/codegen-units/item-collection/static-init.rs index 9d79171c4cb..287ec8f24eb 100644 --- a/src/test/codegen-units/item-collection/static-init.rs +++ b/src/test/codegen-units/item-collection/static-init.rs @@ -6,10 +6,10 @@ pub static FN : fn() = foo::<i32>; pub fn foo<T>() { } -//~ MONO_ITEM fn static_init::foo[0]<T> -//~ MONO_ITEM static static_init::FN[0] +//~ MONO_ITEM fn foo::<T> +//~ MONO_ITEM static FN -//~ MONO_ITEM fn static_init::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { 0 diff --git a/src/test/codegen-units/item-collection/statics-and-consts.rs b/src/test/codegen-units/item-collection/statics-and-consts.rs index 7e28ba58b63..49a8d3dff63 100644 --- a/src/test/codegen-units/item-collection/statics-and-consts.rs +++ b/src/test/codegen-units/item-collection/statics-and-consts.rs @@ -37,7 +37,7 @@ fn foo() { }; } -//~ MONO_ITEM fn statics_and_consts::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { foo(); @@ -46,9 +46,9 @@ fn start(_: isize, _: *const *const u8) -> isize { 0 } -//~ MONO_ITEM static statics_and_consts::STATIC1[0] +//~ MONO_ITEM static STATIC1 -//~ MONO_ITEM fn statics_and_consts::foo[0] -//~ MONO_ITEM static statics_and_consts::foo[0]::STATIC2[0] -//~ MONO_ITEM static statics_and_consts::foo[0]::STATIC2[1] -//~ MONO_ITEM static statics_and_consts::foo[0]::STATIC2[2] +//~ MONO_ITEM fn foo +//~ MONO_ITEM static foo::STATIC2 +//~ MONO_ITEM static foo::STATIC2 +//~ MONO_ITEM static foo::STATIC2 diff --git a/src/test/codegen-units/item-collection/trait-implementations.rs b/src/test/codegen-units/item-collection/trait-implementations.rs index f090c0c8d13..a816cb03241 100644 --- a/src/test/codegen-units/item-collection/trait-implementations.rs +++ b/src/test/codegen-units/item-collection/trait-implementations.rs @@ -10,7 +10,7 @@ pub trait SomeTrait { impl SomeTrait for i64 { - //~ MONO_ITEM fn trait_implementations::{{impl}}[0]::foo[0] + //~ MONO_ITEM fn <i64 as SomeTrait>::foo fn foo(&self) {} fn bar<T>(&self, _: T) {} @@ -18,7 +18,7 @@ impl SomeTrait for i64 { impl SomeTrait for i32 { - //~ MONO_ITEM fn trait_implementations::{{impl}}[1]::foo[0] + //~ MONO_ITEM fn <i32 as SomeTrait>::foo fn foo(&self) {} fn bar<T>(&self, _: T) {} @@ -32,7 +32,7 @@ pub trait SomeGenericTrait<T> { // Concrete impl of generic trait impl SomeGenericTrait<u32> for f64 { - //~ MONO_ITEM fn trait_implementations::{{impl}}[2]::foo[0] + //~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::foo fn foo(&self, _: u32) {} fn bar<T2>(&self, _: u32, _: T2) {} @@ -45,28 +45,28 @@ impl<T> SomeGenericTrait<T> for f32 { fn bar<T2>(&self, _: T, _: T2) {} } -//~ MONO_ITEM fn trait_implementations::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn trait_implementations::{{impl}}[1]::bar[0]<char> + //~ MONO_ITEM fn <i32 as SomeTrait>::bar::<char> 0i32.bar('x'); - //~ MONO_ITEM fn trait_implementations::{{impl}}[2]::bar[0]<&str> + //~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::bar::<&str> 0f64.bar(0u32, "&str"); - //~ MONO_ITEM fn trait_implementations::{{impl}}[2]::bar[0]<()> + //~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::bar::<()> 0f64.bar(0u32, ()); - //~ MONO_ITEM fn trait_implementations::{{impl}}[3]::foo[0]<char> + //~ MONO_ITEM fn <f32 as SomeGenericTrait<char>>::foo 0f32.foo('x'); - //~ MONO_ITEM fn trait_implementations::{{impl}}[3]::foo[0]<i64> + //~ MONO_ITEM fn <f32 as SomeGenericTrait<i64>>::foo 0f32.foo(-1i64); - //~ MONO_ITEM fn trait_implementations::{{impl}}[3]::bar[0]<u32, ()> + //~ MONO_ITEM fn <f32 as SomeGenericTrait<u32>>::bar::<()> 0f32.bar(0u32, ()); - //~ MONO_ITEM fn trait_implementations::{{impl}}[3]::bar[0]<&str, &str> + //~ MONO_ITEM fn <f32 as SomeGenericTrait<&str>>::bar::<&str> 0f32.bar("&str", "&str"); 0 diff --git a/src/test/codegen-units/item-collection/trait-method-as-argument.rs b/src/test/codegen-units/item-collection/trait-method-as-argument.rs index 27ace8e31ad..6817b33c611 100644 --- a/src/test/codegen-units/item-collection/trait-method-as-argument.rs +++ b/src/test/codegen-units/item-collection/trait-method-as-argument.rs @@ -1,3 +1,4 @@ +// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] @@ -26,33 +27,33 @@ fn take_foo_mut<T, F: FnMut(T) -> T>(mut f: F, arg: T) -> T { (f)(arg) } -//~ MONO_ITEM fn trait_method_as_argument::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn trait_method_as_argument::take_foo_once[0]<u32, fn(u32) -> u32> - //~ MONO_ITEM fn trait_method_as_argument::{{impl}}[0]::foo[0] - //~ MONO_ITEM fn core::ops[0]::function[0]::FnOnce[0]::call_once[0]<fn(u32) -> u32, (u32)> + //~ MONO_ITEM fn take_foo_once::<u32, fn(u32) -> u32 {<u32 as Trait>::foo}> + //~ MONO_ITEM fn <u32 as Trait>::foo + //~ MONO_ITEM fn <fn(u32) -> u32 {<u32 as Trait>::foo} as std::ops::FnOnce<(u32,)>>::call_once - shim(fn(u32) -> u32 {<u32 as Trait>::foo}) take_foo_once(Trait::foo, 0u32); - //~ MONO_ITEM fn trait_method_as_argument::take_foo_once[0]<char, fn(char) -> char> - //~ MONO_ITEM fn trait_method_as_argument::Trait[0]::foo[0]<char> - //~ MONO_ITEM fn core::ops[0]::function[0]::FnOnce[0]::call_once[0]<fn(char) -> char, (char)> + //~ MONO_ITEM fn take_foo_once::<char, fn(char) -> char {<char as Trait>::foo}> + //~ MONO_ITEM fn <char as Trait>::foo + //~ MONO_ITEM fn <fn(char) -> char {<char as Trait>::foo} as std::ops::FnOnce<(char,)>>::call_once - shim(fn(char) -> char {<char as Trait>::foo}) take_foo_once(Trait::foo, 'c'); - //~ MONO_ITEM fn trait_method_as_argument::take_foo[0]<u32, fn(u32) -> u32> - //~ MONO_ITEM fn core::ops[0]::function[0]::Fn[0]::call[0]<fn(u32) -> u32, (u32)> + //~ MONO_ITEM fn take_foo::<u32, fn(u32) -> u32 {<u32 as Trait>::foo}> + //~ MONO_ITEM fn <fn(u32) -> u32 {<u32 as Trait>::foo} as std::ops::Fn<(u32,)>>::call - shim(fn(u32) -> u32 {<u32 as Trait>::foo}) take_foo(Trait::foo, 0u32); - //~ MONO_ITEM fn trait_method_as_argument::take_foo[0]<char, fn(char) -> char> - //~ MONO_ITEM fn core::ops[0]::function[0]::Fn[0]::call[0]<fn(char) -> char, (char)> + //~ MONO_ITEM fn take_foo::<char, fn(char) -> char {<char as Trait>::foo}> + //~ MONO_ITEM fn <fn(char) -> char {<char as Trait>::foo} as std::ops::Fn<(char,)>>::call - shim(fn(char) -> char {<char as Trait>::foo}) take_foo(Trait::foo, 'c'); - //~ MONO_ITEM fn trait_method_as_argument::take_foo_mut[0]<u32, fn(u32) -> u32> - //~ MONO_ITEM fn core::ops[0]::function[0]::FnMut[0]::call_mut[0]<fn(char) -> char, (char)> + //~ MONO_ITEM fn take_foo_mut::<u32, fn(u32) -> u32 {<u32 as Trait>::foo}> + //~ MONO_ITEM fn <fn(u32) -> u32 {<u32 as Trait>::foo} as std::ops::FnMut<(u32,)>>::call_mut - shim(fn(u32) -> u32 {<u32 as Trait>::foo}) take_foo_mut(Trait::foo, 0u32); - //~ MONO_ITEM fn trait_method_as_argument::take_foo_mut[0]<char, fn(char) -> char> - //~ MONO_ITEM fn core::ops[0]::function[0]::FnMut[0]::call_mut[0]<fn(u32) -> u32, (u32)> + //~ MONO_ITEM fn take_foo_mut::<char, fn(char) -> char {<char as Trait>::foo}> + //~ MONO_ITEM fn <fn(char) -> char {<char as Trait>::foo} as std::ops::FnMut<(char,)>>::call_mut - shim(fn(char) -> char {<char as Trait>::foo}) take_foo_mut(Trait::foo, 'c'); 0 diff --git a/src/test/codegen-units/item-collection/trait-method-default-impl.rs b/src/test/codegen-units/item-collection/trait-method-default-impl.rs index 6cf59fdc396..bfcdb6fa142 100644 --- a/src/test/codegen-units/item-collection/trait-method-default-impl.rs +++ b/src/test/codegen-units/item-collection/trait-method-default-impl.rs @@ -13,7 +13,7 @@ impl SomeTrait for i8 { // For the non-generic foo(), we should generate a codegen-item even if it // is not called anywhere - //~ MONO_ITEM fn trait_method_default_impl::SomeTrait[0]::foo[0]<i8> + //~ MONO_ITEM fn <i8 as SomeTrait>::foo } trait SomeGenericTrait<T1> { @@ -27,7 +27,7 @@ impl SomeGenericTrait<u64> for i32 { // For the non-generic foo(), we should generate a codegen-item even if it // is not called anywhere - //~ MONO_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::foo[0]<i32, T1> + //~ MONO_ITEM fn <i32 as SomeGenericTrait<T1>>::foo } // Non-generic impl of generic trait @@ -36,25 +36,25 @@ impl<T1> SomeGenericTrait<T1> for u32 { // since nothing is monomorphic here, nothing should be generated unless used somewhere. } -//~ MONO_ITEM fn trait_method_default_impl::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn trait_method_default_impl::SomeTrait[0]::bar[0]<i8, char> + //~ MONO_ITEM fn <i8 as SomeTrait>::bar::<char> let _ = 1i8.bar('c'); - //~ MONO_ITEM fn trait_method_default_impl::SomeTrait[0]::bar[0]<i8, &str> + //~ MONO_ITEM fn <i8 as SomeTrait>::bar::<&str> let _ = 2i8.bar("&str"); - //~ MONO_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::bar[0]<i32, u64, char> + //~ MONO_ITEM fn <i32 as SomeGenericTrait<u64>>::bar::<char> 0i32.bar(0u64, 'c'); - //~ MONO_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::bar[0]<i32, u64, &str> + //~ MONO_ITEM fn <i32 as SomeGenericTrait<u64>>::bar::<&str> 0i32.bar(0u64, "&str"); - //~ MONO_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::bar[0]<u32, i8, &[char; 1]> + //~ MONO_ITEM fn <u32 as SomeGenericTrait<i8>>::bar::<&[char; 1]> 0u32.bar(0i8, &['c']); - //~ MONO_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::bar[0]<u32, i16, ()> + //~ MONO_ITEM fn <u32 as SomeGenericTrait<i16>>::bar::<()> 0u32.bar(0i16, ()); 0 diff --git a/src/test/codegen-units/item-collection/transitive-drop-glue.rs b/src/test/codegen-units/item-collection/transitive-drop-glue.rs index 7e29af43538..c0489a6a259 100644 --- a/src/test/codegen-units/item-collection/transitive-drop-glue.rs +++ b/src/test/codegen-units/item-collection/transitive-drop-glue.rs @@ -5,15 +5,15 @@ #![deny(dead_code)] #![feature(start)] -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Root[0]> @@ transitive_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal] struct Root(Intermediate); -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Intermediate[0]> @@ transitive_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal] struct Intermediate(Leaf); -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Leaf[0]> @@ transitive_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal] struct Leaf; impl Drop for Leaf { - //~ MONO_ITEM fn transitive_drop_glue::{{impl}}[0]::drop[0] + //~ MONO_ITEM fn <Leaf as std::ops::Drop>::drop fn drop(&mut self) {} } @@ -25,21 +25,21 @@ impl<T> Drop for LeafGen<T> { fn drop(&mut self) {} } -//~ MONO_ITEM fn transitive_drop_glue::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { let _ = Root(Intermediate(Leaf)); - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<u32>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<u32>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<u32>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<u32> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<RootGen<u32>> - shim(Some(RootGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<IntermediateGen<u32>> - shim(Some(IntermediateGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<LeafGen<u32>> - shim(Some(LeafGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <LeafGen<u32> as std::ops::Drop>::drop let _ = RootGen(IntermediateGen(LeafGen(0u32))); - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<i16>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<i16>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<i16>> @@ transitive_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<i16> + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<RootGen<i16>> - shim(Some(RootGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<IntermediateGen<i16>> - shim(Some(IntermediateGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<LeafGen<i16>> - shim(Some(LeafGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn <LeafGen<i16> as std::ops::Drop>::drop let _ = RootGen(IntermediateGen(LeafGen(0i16))); 0 diff --git a/src/test/codegen-units/item-collection/tuple-drop-glue.rs b/src/test/codegen-units/item-collection/tuple-drop-glue.rs index d77de53ce01..d34835ae691 100644 --- a/src/test/codegen-units/item-collection/tuple-drop-glue.rs +++ b/src/test/codegen-units/item-collection/tuple-drop-glue.rs @@ -5,22 +5,22 @@ #![deny(dead_code)] #![feature(start)] -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<tuple_drop_glue::Dropped[0]> @@ tuple_drop_glue-cgu.0[Internal] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Dropped> - shim(Some(Dropped)) @@ tuple_drop_glue-cgu.0[Internal] struct Dropped; impl Drop for Dropped { - //~ MONO_ITEM fn tuple_drop_glue::{{impl}}[0]::drop[0] + //~ MONO_ITEM fn <Dropped as std::ops::Drop>::drop fn drop(&mut self) {} } -//~ MONO_ITEM fn tuple_drop_glue::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, tuple_drop_glue::Dropped[0])> @@ tuple_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<(u32, Dropped)> - shim(Some((u32, Dropped))) @@ tuple_drop_glue-cgu.0[Internal] let x = (0u32, Dropped); - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(i16, (tuple_drop_glue::Dropped[0], bool))> @@ tuple_drop_glue-cgu.0[Internal] - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(tuple_drop_glue::Dropped[0], bool)> @@ tuple_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<(i16, (Dropped, bool))> - shim(Some((i16, (Dropped, bool)))) @@ tuple_drop_glue-cgu.0[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<(Dropped, bool)> - shim(Some((Dropped, bool))) @@ tuple_drop_glue-cgu.0[Internal] let x = (0i16, (Dropped, true)); 0 diff --git a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs index ec6be0ecf43..17b92eae00d 100644 --- a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs +++ b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs @@ -3,7 +3,7 @@ #![deny(dead_code)] #![crate_type = "rlib"] -//~ MONO_ITEM fn unreferenced_const_fn::foo[0] @@ unreferenced_const_fn-cgu.0[External] +//~ MONO_ITEM fn foo @@ unreferenced_const_fn-cgu.0[External] pub const fn foo(x: u32) -> u32 { x + 0xf00 } diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/src/test/codegen-units/item-collection/unsizing.rs index 1ed60dcf265..9421bf106ba 100644 --- a/src/test/codegen-units/item-collection/unsizing.rs +++ b/src/test/codegen-units/item-collection/unsizing.rs @@ -43,19 +43,19 @@ struct Wrapper<T: ?Sized>(*const T); impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Wrapper<U>> for Wrapper<T> {} -//~ MONO_ITEM fn unsizing::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { // simple case let bool_sized = &true; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<bool> @@ unsizing-cgu.0[Internal] - //~ MONO_ITEM fn unsizing::{{impl}}[0]::foo[0] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<bool> - shim(None) @@ unsizing-cgu.0[Internal] + //~ MONO_ITEM fn <bool as Trait>::foo let _bool_unsized = bool_sized as &Trait; let char_sized = &'a'; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<char> @@ unsizing-cgu.0[Internal] - //~ MONO_ITEM fn unsizing::{{impl}}[1]::foo[0] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<char> - shim(None) @@ unsizing-cgu.0[Internal] + //~ MONO_ITEM fn <char as Trait>::foo let _char_unsized = char_sized as &Trait; // struct field @@ -64,14 +64,14 @@ fn start(_: isize, _: *const *const u8) -> isize { _b: 2, _c: 3.0f64 }; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<f64> @@ unsizing-cgu.0[Internal] - //~ MONO_ITEM fn unsizing::{{impl}}[2]::foo[0] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<f64> - shim(None) @@ unsizing-cgu.0[Internal] + //~ MONO_ITEM fn <f64 as Trait>::foo let _struct_unsized = struct_sized as &Struct<Trait>; // custom coercion let wrapper_sized = Wrapper(&0u32); - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<u32> @@ unsizing-cgu.0[Internal] - //~ MONO_ITEM fn unsizing::{{impl}}[3]::foo[0] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<u32> - shim(None) @@ unsizing-cgu.0[Internal] + //~ MONO_ITEM fn <u32 as Trait>::foo let _wrapper_sized = wrapper_sized as Wrapper<Trait>; 0 diff --git a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs b/src/test/codegen-units/item-collection/unused-traits-and-generics.rs index 4a5e294ea0f..561dc1a5c07 100644 --- a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs +++ b/src/test/codegen-units/item-collection/unused-traits-and-generics.rs @@ -74,4 +74,4 @@ impl NonGeneric { } // Only the non-generic methods should be instantiated: -//~ MONO_ITEM fn unused_traits_and_generics::{{impl}}[3]::foo[0] +//~ MONO_ITEM fn NonGeneric::foo diff --git a/src/test/codegen-units/partitioning/extern-drop-glue.rs b/src/test/codegen-units/partitioning/extern-drop-glue.rs index 1cb85382239..3de1bdb86c1 100644 --- a/src/test/codegen-units/partitioning/extern-drop-glue.rs +++ b/src/test/codegen-units/partitioning/extern-drop-glue.rs @@ -12,13 +12,13 @@ // aux-build:cgu_extern_drop_glue.rs extern crate cgu_extern_drop_glue; -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<cgu_extern_drop_glue::Struct[0]> @@ extern_drop_glue-fallback.cgu[External] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<cgu_extern_drop_glue::Struct> - shim(Some(cgu_extern_drop_glue::Struct)) @@ extern_drop_glue-fallback.cgu[External] struct LocalStruct(cgu_extern_drop_glue::Struct); -//~ MONO_ITEM fn extern_drop_glue::user[0] @@ extern_drop_glue[External] +//~ MONO_ITEM fn user @@ extern_drop_glue[External] pub fn user() { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<extern_drop_glue::LocalStruct[0]> @@ extern_drop_glue-fallback.cgu[External] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<LocalStruct> - shim(Some(LocalStruct)) @@ extern_drop_glue-fallback.cgu[External] let _ = LocalStruct(cgu_extern_drop_glue::Struct(0)); } @@ -27,9 +27,9 @@ pub mod mod1 { struct LocalStruct(cgu_extern_drop_glue::Struct); - //~ MONO_ITEM fn extern_drop_glue::mod1[0]::user[0] @@ extern_drop_glue-mod1[External] + //~ MONO_ITEM fn mod1::user @@ extern_drop_glue-mod1[External] pub fn user() { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<extern_drop_glue::mod1[0]::LocalStruct[0]> @@ extern_drop_glue-fallback.cgu[External] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<mod1::LocalStruct> - shim(Some(mod1::LocalStruct)) @@ extern_drop_glue-fallback.cgu[External] let _ = LocalStruct(cgu_extern_drop_glue::Struct(0)); } } diff --git a/src/test/codegen-units/partitioning/extern-generic.rs b/src/test/codegen-units/partitioning/extern-generic.rs index 88d6116a987..02930f96bd1 100644 --- a/src/test/codegen-units/partitioning/extern-generic.rs +++ b/src/test/codegen-units/partitioning/extern-generic.rs @@ -9,7 +9,7 @@ // aux-build:cgu_generic_function.rs extern crate cgu_generic_function; -//~ MONO_ITEM fn extern_generic::user[0] @@ extern_generic[Internal] +//~ MONO_ITEM fn user @@ extern_generic[Internal] fn user() { let _ = cgu_generic_function::foo("abc"); } @@ -17,7 +17,7 @@ fn user() { mod mod1 { use cgu_generic_function; - //~ MONO_ITEM fn extern_generic::mod1[0]::user[0] @@ extern_generic-mod1[Internal] + //~ MONO_ITEM fn mod1::user @@ extern_generic-mod1[Internal] fn user() { let _ = cgu_generic_function::foo("abc"); } @@ -25,7 +25,7 @@ mod mod1 { mod mod1 { use cgu_generic_function; - //~ MONO_ITEM fn extern_generic::mod1[0]::mod1[0]::user[0] @@ extern_generic-mod1-mod1[Internal] + //~ MONO_ITEM fn mod1::mod1::user @@ extern_generic-mod1-mod1[Internal] fn user() { let _ = cgu_generic_function::foo("abc"); } @@ -35,18 +35,18 @@ mod mod1 { mod mod2 { use cgu_generic_function; - //~ MONO_ITEM fn extern_generic::mod2[0]::user[0] @@ extern_generic-mod2[Internal] + //~ MONO_ITEM fn mod2::user @@ extern_generic-mod2[Internal] fn user() { let _ = cgu_generic_function::foo("abc"); } } mod mod3 { - //~ MONO_ITEM fn extern_generic::mod3[0]::non_user[0] @@ extern_generic-mod3[Internal] + //~ MONO_ITEM fn mod3::non_user @@ extern_generic-mod3[Internal] fn non_user() {} } // Make sure the two generic functions from the extern crate get instantiated // once for the current crate -//~ MONO_ITEM fn cgu_generic_function::foo[0]<&str> @@ cgu_generic_function-in-extern_generic.volatile[External] -//~ MONO_ITEM fn cgu_generic_function::bar[0]<&str> @@ cgu_generic_function-in-extern_generic.volatile[External] +//~ MONO_ITEM fn cgu_generic_function::foo::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External] +//~ MONO_ITEM fn cgu_generic_function::bar::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External] diff --git a/src/test/codegen-units/partitioning/incremental-merging.rs b/src/test/codegen-units/partitioning/incremental-merging.rs index ca2df19096e..91ae6022931 100644 --- a/src/test/codegen-units/partitioning/incremental-merging.rs +++ b/src/test/codegen-units/partitioning/incremental-merging.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // We specify -C incremental here because we want to test the partitioning for // incremental compilation // compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/incremental-merging @@ -14,28 +13,28 @@ // while `ccc` and `ddd` are supposed to stay untouched. pub mod aaa { - //~ MONO_ITEM fn incremental_merging::aaa[0]::foo[0] @@ incremental_merging-aaa--incremental_merging-bbb[External] + //~ MONO_ITEM fn aaa::foo @@ incremental_merging-aaa--incremental_merging-bbb[External] pub fn foo(a: u64) -> u64 { a + 1 } } pub mod bbb { - //~ MONO_ITEM fn incremental_merging::bbb[0]::foo[0] @@ incremental_merging-aaa--incremental_merging-bbb[External] + //~ MONO_ITEM fn bbb::foo @@ incremental_merging-aaa--incremental_merging-bbb[External] pub fn foo(a: u64, b: u64) -> u64 { a + b + 1 } } pub mod ccc { - //~ MONO_ITEM fn incremental_merging::ccc[0]::foo[0] @@ incremental_merging-ccc[External] + //~ MONO_ITEM fn ccc::foo @@ incremental_merging-ccc[External] pub fn foo(a: u64, b: u64, c: u64) -> u64 { a + b + c + 1 } } pub mod ddd { - //~ MONO_ITEM fn incremental_merging::ddd[0]::foo[0] @@ incremental_merging-ddd[External] + //~ MONO_ITEM fn ddd::foo @@ incremental_merging-ddd[External] pub fn foo(a: u64, b: u64, c: u64, d: u64) -> u64 { a + b + c + d + 1 } diff --git a/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs b/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs index 7afeb0a0f36..410b77b0050 100644 --- a/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs +++ b/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs @@ -12,10 +12,10 @@ extern crate cgu_explicit_inlining; // This test makes sure that items inlined from external crates are privately // instantiated in every codegen unit they are used in. -//~ MONO_ITEM fn cgu_explicit_inlining::inlined[0] @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod1[Internal] -//~ MONO_ITEM fn cgu_explicit_inlining::always_inlined[0] @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod2[Internal] +//~ MONO_ITEM fn cgu_explicit_inlining::inlined @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod1[Internal] +//~ MONO_ITEM fn cgu_explicit_inlining::always_inlined @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod2[Internal] -//~ MONO_ITEM fn inlining_from_extern_crate::user[0] @@ inlining_from_extern_crate[External] +//~ MONO_ITEM fn user @@ inlining_from_extern_crate[External] pub fn user() { cgu_explicit_inlining::inlined(); @@ -28,7 +28,7 @@ pub fn user() pub mod mod1 { use cgu_explicit_inlining; - //~ MONO_ITEM fn inlining_from_extern_crate::mod1[0]::user[0] @@ inlining_from_extern_crate-mod1[External] + //~ MONO_ITEM fn mod1::user @@ inlining_from_extern_crate-mod1[External] pub fn user() { cgu_explicit_inlining::inlined(); @@ -41,7 +41,7 @@ pub mod mod1 { pub mod mod2 { use cgu_explicit_inlining; - //~ MONO_ITEM fn inlining_from_extern_crate::mod2[0]::user[0] @@ inlining_from_extern_crate-mod2[External] + //~ MONO_ITEM fn mod2::user @@ inlining_from_extern_crate-mod2[External] pub fn user() { cgu_explicit_inlining::always_inlined(); diff --git a/src/test/codegen-units/partitioning/local-drop-glue.rs b/src/test/codegen-units/partitioning/local-drop-glue.rs index c082b408278..98108615ce9 100644 --- a/src/test/codegen-units/partitioning/local-drop-glue.rs +++ b/src/test/codegen-units/partitioning/local-drop-glue.rs @@ -8,22 +8,22 @@ #![allow(dead_code)] #![crate_type = "rlib"] -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::Struct[0]> @@ local_drop_glue-fallback.cgu[External] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct> - shim(Some(Struct)) @@ local_drop_glue-fallback.cgu[External] struct Struct { _a: u32, } impl Drop for Struct { - //~ MONO_ITEM fn local_drop_glue::{{impl}}[0]::drop[0] @@ local_drop_glue-fallback.cgu[External] + //~ MONO_ITEM fn <Struct as std::ops::Drop>::drop @@ local_drop_glue-fallback.cgu[External] fn drop(&mut self) {} } -//~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::Outer[0]> @@ local_drop_glue-fallback.cgu[External] +//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Outer> - shim(Some(Outer)) @@ local_drop_glue-fallback.cgu[External] struct Outer { _a: Struct, } -//~ MONO_ITEM fn local_drop_glue::user[0] @@ local_drop_glue[External] +//~ MONO_ITEM fn user @@ local_drop_glue[External] pub fn user() { let _ = Outer { _a: Struct { _a: 0 } }; } @@ -31,14 +31,14 @@ pub fn user() { pub mod mod1 { use super::Struct; - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::mod1[0]::Struct2[0]> @@ local_drop_glue-fallback.cgu[External] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<mod1::Struct2> - shim(Some(mod1::Struct2)) @@ local_drop_glue-fallback.cgu[External] struct Struct2 { _a: Struct, - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, local_drop_glue::Struct[0])> @@ local_drop_glue-fallback.cgu[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<(u32, Struct)> - shim(Some((u32, Struct))) @@ local_drop_glue-fallback.cgu[Internal] _b: (u32, Struct), } - //~ MONO_ITEM fn local_drop_glue::mod1[0]::user[0] @@ local_drop_glue-mod1[External] + //~ MONO_ITEM fn mod1::user @@ local_drop_glue-mod1[External] pub fn user() { let _ = Struct2 { _a: Struct { _a: 0 }, _b: (0, Struct { _a: 0 }) }; } diff --git a/src/test/codegen-units/partitioning/local-generic.rs b/src/test/codegen-units/partitioning/local-generic.rs index 4518166a1c9..9a7743bbf46 100644 --- a/src/test/codegen-units/partitioning/local-generic.rs +++ b/src/test/codegen-units/partitioning/local-generic.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // We specify -C incremental here because we want to test the partitioning for // incremental compilation // compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/local-generic @@ -6,13 +5,13 @@ #![allow(dead_code)] #![crate_type="lib"] -//~ MONO_ITEM fn local_generic::generic[0]<u32> @@ local_generic.volatile[External] -//~ MONO_ITEM fn local_generic::generic[0]<u64> @@ local_generic.volatile[External] -//~ MONO_ITEM fn local_generic::generic[0]<char> @@ local_generic.volatile[External] -//~ MONO_ITEM fn local_generic::generic[0]<&str> @@ local_generic.volatile[External] +//~ MONO_ITEM fn generic::<u32> @@ local_generic.volatile[External] +//~ MONO_ITEM fn generic::<u64> @@ local_generic.volatile[External] +//~ MONO_ITEM fn generic::<char> @@ local_generic.volatile[External] +//~ MONO_ITEM fn generic::<&str> @@ local_generic.volatile[External] pub fn generic<T>(x: T) -> T { x } -//~ MONO_ITEM fn local_generic::user[0] @@ local_generic[Internal] +//~ MONO_ITEM fn user @@ local_generic[Internal] fn user() { let _ = generic(0u32); } @@ -20,7 +19,7 @@ fn user() { mod mod1 { pub use super::generic; - //~ MONO_ITEM fn local_generic::mod1[0]::user[0] @@ local_generic-mod1[Internal] + //~ MONO_ITEM fn mod1::user @@ local_generic-mod1[Internal] fn user() { let _ = generic(0u64); } @@ -28,7 +27,7 @@ mod mod1 { mod mod1 { use super::generic; - //~ MONO_ITEM fn local_generic::mod1[0]::mod1[0]::user[0] @@ local_generic-mod1-mod1[Internal] + //~ MONO_ITEM fn mod1::mod1::user @@ local_generic-mod1-mod1[Internal] fn user() { let _ = generic('c'); } @@ -38,7 +37,7 @@ mod mod1 { mod mod2 { use super::generic; - //~ MONO_ITEM fn local_generic::mod2[0]::user[0] @@ local_generic-mod2[Internal] + //~ MONO_ITEM fn mod2::user @@ local_generic-mod2[Internal] fn user() { let _ = generic("abc"); } diff --git a/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs b/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs index 6322f55d2b7..a24943348f3 100644 --- a/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs +++ b/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs @@ -9,7 +9,7 @@ mod inline { - //~ MONO_ITEM fn local_inlining_but_not_all::inline[0]::inlined_function[0] @@ local_inlining_but_not_all-inline[External] + //~ MONO_ITEM fn inline::inlined_function @@ local_inlining_but_not_all-inline[External] #[inline] pub fn inlined_function() { @@ -20,7 +20,7 @@ mod inline { pub mod user1 { use super::inline; - //~ MONO_ITEM fn local_inlining_but_not_all::user1[0]::foo[0] @@ local_inlining_but_not_all-user1[External] + //~ MONO_ITEM fn user1::foo @@ local_inlining_but_not_all-user1[External] pub fn foo() { inline::inlined_function(); } @@ -29,7 +29,7 @@ pub mod user1 { pub mod user2 { use super::inline; - //~ MONO_ITEM fn local_inlining_but_not_all::user2[0]::bar[0] @@ local_inlining_but_not_all-user2[External] + //~ MONO_ITEM fn user2::bar @@ local_inlining_but_not_all-user2[External] pub fn bar() { inline::inlined_function(); } @@ -37,7 +37,7 @@ pub mod user2 { pub mod non_user { - //~ MONO_ITEM fn local_inlining_but_not_all::non_user[0]::baz[0] @@ local_inlining_but_not_all-non_user[External] + //~ MONO_ITEM fn non_user::baz @@ local_inlining_but_not_all-non_user[External] pub fn baz() { } diff --git a/src/test/codegen-units/partitioning/local-inlining.rs b/src/test/codegen-units/partitioning/local-inlining.rs index d75dfc91262..0cc652eeb52 100644 --- a/src/test/codegen-units/partitioning/local-inlining.rs +++ b/src/test/codegen-units/partitioning/local-inlining.rs @@ -10,7 +10,7 @@ mod inline { // Important: This function should show up in all codegen units where it is inlined - //~ MONO_ITEM fn local_inlining::inline[0]::inlined_function[0] @@ local_inlining-user1[Internal] local_inlining-user2[Internal] + //~ MONO_ITEM fn inline::inlined_function @@ local_inlining-user1[Internal] local_inlining-user2[Internal] #[inline(always)] pub fn inlined_function() { @@ -21,7 +21,7 @@ mod inline { pub mod user1 { use super::inline; - //~ MONO_ITEM fn local_inlining::user1[0]::foo[0] @@ local_inlining-user1[External] + //~ MONO_ITEM fn user1::foo @@ local_inlining-user1[External] pub fn foo() { inline::inlined_function(); } @@ -30,7 +30,7 @@ pub mod user1 { pub mod user2 { use super::inline; - //~ MONO_ITEM fn local_inlining::user2[0]::bar[0] @@ local_inlining-user2[External] + //~ MONO_ITEM fn user2::bar @@ local_inlining-user2[External] pub fn bar() { inline::inlined_function(); } @@ -38,7 +38,7 @@ pub mod user2 { pub mod non_user { - //~ MONO_ITEM fn local_inlining::non_user[0]::baz[0] @@ local_inlining-non_user[External] + //~ MONO_ITEM fn non_user::baz @@ local_inlining-non_user[External] pub fn baz() { } diff --git a/src/test/codegen-units/partitioning/local-transitive-inlining.rs b/src/test/codegen-units/partitioning/local-transitive-inlining.rs index 3cf03966865..0c8a67aeb3d 100644 --- a/src/test/codegen-units/partitioning/local-transitive-inlining.rs +++ b/src/test/codegen-units/partitioning/local-transitive-inlining.rs @@ -9,7 +9,7 @@ mod inline { - //~ MONO_ITEM fn local_transitive_inlining::inline[0]::inlined_function[0] @@ local_transitive_inlining-indirect_user[Internal] + //~ MONO_ITEM fn inline::inlined_function @@ local_transitive_inlining-indirect_user[Internal] #[inline(always)] pub fn inlined_function() { @@ -20,7 +20,7 @@ mod inline { mod direct_user { use super::inline; - //~ MONO_ITEM fn local_transitive_inlining::direct_user[0]::foo[0] @@ local_transitive_inlining-indirect_user[Internal] + //~ MONO_ITEM fn direct_user::foo @@ local_transitive_inlining-indirect_user[Internal] #[inline(always)] pub fn foo() { inline::inlined_function(); @@ -30,7 +30,7 @@ mod direct_user { pub mod indirect_user { use super::direct_user; - //~ MONO_ITEM fn local_transitive_inlining::indirect_user[0]::bar[0] @@ local_transitive_inlining-indirect_user[External] + //~ MONO_ITEM fn indirect_user::bar @@ local_transitive_inlining-indirect_user[External] pub fn bar() { direct_user::foo(); } @@ -38,7 +38,7 @@ pub mod indirect_user { pub mod non_user { - //~ MONO_ITEM fn local_transitive_inlining::non_user[0]::baz[0] @@ local_transitive_inlining-non_user[External] + //~ MONO_ITEM fn non_user::baz @@ local_transitive_inlining-non_user[External] pub fn baz() { } diff --git a/src/test/codegen-units/partitioning/regular-modules.rs b/src/test/codegen-units/partitioning/regular-modules.rs index c8ceeafd0bf..f9b8f52b0bb 100644 --- a/src/test/codegen-units/partitioning/regular-modules.rs +++ b/src/test/codegen-units/partitioning/regular-modules.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // We specify -C incremental here because we want to test the partitioning for // incremental compilation // compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/regular-modules @@ -6,67 +5,67 @@ #![allow(dead_code)] #![crate_type="lib"] -//~ MONO_ITEM fn regular_modules::foo[0] @@ regular_modules[Internal] +//~ MONO_ITEM fn foo @@ regular_modules[Internal] fn foo() {} -//~ MONO_ITEM fn regular_modules::bar[0] @@ regular_modules[Internal] +//~ MONO_ITEM fn bar @@ regular_modules[Internal] fn bar() {} -//~ MONO_ITEM static regular_modules::BAZ[0] @@ regular_modules[Internal] +//~ MONO_ITEM static BAZ @@ regular_modules[Internal] static BAZ: u64 = 0; mod mod1 { - //~ MONO_ITEM fn regular_modules::mod1[0]::foo[0] @@ regular_modules-mod1[Internal] + //~ MONO_ITEM fn mod1::foo @@ regular_modules-mod1[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod1[0]::bar[0] @@ regular_modules-mod1[Internal] + //~ MONO_ITEM fn mod1::bar @@ regular_modules-mod1[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod1[0]::BAZ[0] @@ regular_modules-mod1[Internal] + //~ MONO_ITEM static mod1::BAZ @@ regular_modules-mod1[Internal] static BAZ: u64 = 0; mod mod1 { - //~ MONO_ITEM fn regular_modules::mod1[0]::mod1[0]::foo[0] @@ regular_modules-mod1-mod1[Internal] + //~ MONO_ITEM fn mod1::mod1::foo @@ regular_modules-mod1-mod1[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod1[0]::mod1[0]::bar[0] @@ regular_modules-mod1-mod1[Internal] + //~ MONO_ITEM fn mod1::mod1::bar @@ regular_modules-mod1-mod1[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod1[0]::mod1[0]::BAZ[0] @@ regular_modules-mod1-mod1[Internal] + //~ MONO_ITEM static mod1::mod1::BAZ @@ regular_modules-mod1-mod1[Internal] static BAZ: u64 = 0; } mod mod2 { - //~ MONO_ITEM fn regular_modules::mod1[0]::mod2[0]::foo[0] @@ regular_modules-mod1-mod2[Internal] + //~ MONO_ITEM fn mod1::mod2::foo @@ regular_modules-mod1-mod2[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod1[0]::mod2[0]::bar[0] @@ regular_modules-mod1-mod2[Internal] + //~ MONO_ITEM fn mod1::mod2::bar @@ regular_modules-mod1-mod2[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod1[0]::mod2[0]::BAZ[0] @@ regular_modules-mod1-mod2[Internal] + //~ MONO_ITEM static mod1::mod2::BAZ @@ regular_modules-mod1-mod2[Internal] static BAZ: u64 = 0; } } mod mod2 { - //~ MONO_ITEM fn regular_modules::mod2[0]::foo[0] @@ regular_modules-mod2[Internal] + //~ MONO_ITEM fn mod2::foo @@ regular_modules-mod2[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod2[0]::bar[0] @@ regular_modules-mod2[Internal] + //~ MONO_ITEM fn mod2::bar @@ regular_modules-mod2[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod2[0]::BAZ[0] @@ regular_modules-mod2[Internal] + //~ MONO_ITEM static mod2::BAZ @@ regular_modules-mod2[Internal] static BAZ: u64 = 0; mod mod1 { - //~ MONO_ITEM fn regular_modules::mod2[0]::mod1[0]::foo[0] @@ regular_modules-mod2-mod1[Internal] + //~ MONO_ITEM fn mod2::mod1::foo @@ regular_modules-mod2-mod1[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod2[0]::mod1[0]::bar[0] @@ regular_modules-mod2-mod1[Internal] + //~ MONO_ITEM fn mod2::mod1::bar @@ regular_modules-mod2-mod1[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod2[0]::mod1[0]::BAZ[0] @@ regular_modules-mod2-mod1[Internal] + //~ MONO_ITEM static mod2::mod1::BAZ @@ regular_modules-mod2-mod1[Internal] static BAZ: u64 = 0; } mod mod2 { - //~ MONO_ITEM fn regular_modules::mod2[0]::mod2[0]::foo[0] @@ regular_modules-mod2-mod2[Internal] + //~ MONO_ITEM fn mod2::mod2::foo @@ regular_modules-mod2-mod2[Internal] fn foo() {} - //~ MONO_ITEM fn regular_modules::mod2[0]::mod2[0]::bar[0] @@ regular_modules-mod2-mod2[Internal] + //~ MONO_ITEM fn mod2::mod2::bar @@ regular_modules-mod2-mod2[Internal] fn bar() {} - //~ MONO_ITEM static regular_modules::mod2[0]::mod2[0]::BAZ[0] @@ regular_modules-mod2-mod2[Internal] + //~ MONO_ITEM static mod2::mod2::BAZ @@ regular_modules-mod2-mod2[Internal] static BAZ: u64 = 0; } } diff --git a/src/test/codegen-units/partitioning/shared-generics.rs b/src/test/codegen-units/partitioning/shared-generics.rs index 99142dd6b7e..eb3196439ba 100644 --- a/src/test/codegen-units/partitioning/shared-generics.rs +++ b/src/test/codegen-units/partitioning/shared-generics.rs @@ -9,10 +9,10 @@ // aux-build:shared_generics_aux.rs extern crate shared_generics_aux; -//~ MONO_ITEM fn shared_generics::foo[0] +//~ MONO_ITEM fn foo pub fn foo() { - //~ MONO_ITEM fn shared_generics_aux::generic_fn[0]<u16> @@ shared_generics_aux-in-shared_generics.volatile[External] + //~ MONO_ITEM fn shared_generics_aux::generic_fn::<u16> @@ shared_generics_aux-in-shared_generics.volatile[External] let _ = shared_generics_aux::generic_fn(0u16, 1u16); // This should not generate a monomorphization because it's already diff --git a/src/test/codegen-units/partitioning/statics.rs b/src/test/codegen-units/partitioning/statics.rs index 5eac046b810..02d6467577f 100644 --- a/src/test/codegen-units/partitioning/statics.rs +++ b/src/test/codegen-units/partitioning/statics.rs @@ -4,34 +4,34 @@ #![crate_type="rlib"] -//~ MONO_ITEM static statics::FOO[0] @@ statics[Internal] +//~ MONO_ITEM static FOO @@ statics[Internal] static FOO: u32 = 0; -//~ MONO_ITEM static statics::BAR[0] @@ statics[Internal] +//~ MONO_ITEM static BAR @@ statics[Internal] static BAR: u32 = 0; -//~ MONO_ITEM fn statics::function[0] @@ statics[External] +//~ MONO_ITEM fn function @@ statics[External] pub fn function() { - //~ MONO_ITEM static statics::function[0]::FOO[0] @@ statics[Internal] + //~ MONO_ITEM static function::FOO @@ statics[Internal] static FOO: u32 = 0; - //~ MONO_ITEM static statics::function[0]::BAR[0] @@ statics[Internal] + //~ MONO_ITEM static function::BAR @@ statics[Internal] static BAR: u32 = 0; } pub mod mod1 { - //~ MONO_ITEM static statics::mod1[0]::FOO[0] @@ statics-mod1[Internal] + //~ MONO_ITEM static mod1::FOO @@ statics-mod1[Internal] static FOO: u32 = 0; - //~ MONO_ITEM static statics::mod1[0]::BAR[0] @@ statics-mod1[Internal] + //~ MONO_ITEM static mod1::BAR @@ statics-mod1[Internal] static BAR: u32 = 0; - //~ MONO_ITEM fn statics::mod1[0]::function[0] @@ statics-mod1[External] + //~ MONO_ITEM fn mod1::function @@ statics-mod1[External] pub fn function() { - //~ MONO_ITEM static statics::mod1[0]::function[0]::FOO[0] @@ statics-mod1[Internal] + //~ MONO_ITEM static mod1::function::FOO @@ statics-mod1[Internal] static FOO: u32 = 0; - //~ MONO_ITEM static statics::mod1[0]::function[0]::BAR[0] @@ statics-mod1[Internal] + //~ MONO_ITEM static mod1::function::BAR @@ statics-mod1[Internal] static BAR: u32 = 0; } } diff --git a/src/test/codegen-units/partitioning/vtable-through-const.rs b/src/test/codegen-units/partitioning/vtable-through-const.rs index 5a1d95d2669..03dbac6179d 100644 --- a/src/test/codegen-units/partitioning/vtable-through-const.rs +++ b/src/test/codegen-units/partitioning/vtable-through-const.rs @@ -28,7 +28,7 @@ mod mod1 { fn do_something_else(&self, x: T) -> T { x } } - //~ MONO_ITEM fn vtable_through_const::mod1[0]::id[0]<i64> @@ vtable_through_const-mod1.volatile[Internal] + //~ MONO_ITEM fn mod1::id::<i64> @@ vtable_through_const-mod1.volatile[Internal] fn id<T>(x: T) -> T { x } // These are referenced, so they produce mono-items (see start()) @@ -43,8 +43,8 @@ mod mod1 { fn do_something_else(&self) {} } - //~ MONO_ITEM fn vtable_through_const::mod1[0]::Trait2[0]::do_something[0]<u32> @@ vtable_through_const-mod1.volatile[Internal] - //~ MONO_ITEM fn vtable_through_const::mod1[0]::Trait2[0]::do_something_else[0]<u32> @@ vtable_through_const-mod1.volatile[Internal] + //~ MONO_ITEM fn <u32 as mod1::Trait2>::do_something @@ vtable_through_const-mod1.volatile[Internal] + //~ MONO_ITEM fn <u32 as mod1::Trait2>::do_something_else @@ vtable_through_const-mod1.volatile[Internal] impl Trait2 for u32 {} pub trait Trait2Gen<T> { @@ -63,30 +63,30 @@ mod mod1 { pub const ID_I64: fn(i64) -> i64 = id::<i64>; } -//~ MONO_ITEM fn vtable_through_const::start[0] +//~ MONO_ITEM fn start #[start] fn start(_: isize, _: *const *const u8) -> isize { - //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<u32> @@ vtable_through_const[Internal] + //~ MONO_ITEM fn std::intrinsics::drop_in_place::<u32> - shim(None) @@ vtable_through_const[Internal] // Since Trait1::do_something() is instantiated via its default implementation, // it is considered a generic and is instantiated here only because it is // referenced in this module. - //~ MONO_ITEM fn vtable_through_const::mod1[0]::Trait1[0]::do_something_else[0]<u32> @@ vtable_through_const-mod1.volatile[External] + //~ MONO_ITEM fn <u32 as mod1::Trait1>::do_something_else @@ vtable_through_const-mod1.volatile[External] // Although it is never used, Trait1::do_something_else() has to be // instantiated locally here too, otherwise the <&u32 as &Trait1> vtable // could not be fully constructed. - //~ MONO_ITEM fn vtable_through_const::mod1[0]::Trait1[0]::do_something[0]<u32> @@ vtable_through_const-mod1.volatile[External] + //~ MONO_ITEM fn <u32 as mod1::Trait1>::do_something @@ vtable_through_const-mod1.volatile[External] mod1::TRAIT1_REF.do_something(); // Same as above - //~ MONO_ITEM fn vtable_through_const::mod1[0]::{{impl}}[1]::do_something[0]<u8> @@ vtable_through_const-mod1.volatile[External] - //~ MONO_ITEM fn vtable_through_const::mod1[0]::{{impl}}[1]::do_something_else[0]<u8> @@ vtable_through_const-mod1.volatile[External] - //~ MONO_ITEM fn vtable_through_const::mod1[0]::{{impl}}[3]::do_something[0]<u8> @@ vtable_through_const-mod1.volatile[Internal] - //~ MONO_ITEM fn vtable_through_const::mod1[0]::{{impl}}[3]::do_something_else[0]<u8> @@ vtable_through_const-mod1.volatile[Internal] + //~ MONO_ITEM fn <u32 as mod1::Trait1Gen<u8>>::do_something @@ vtable_through_const-mod1.volatile[External] + //~ MONO_ITEM fn <u32 as mod1::Trait1Gen<u8>>::do_something_else @@ vtable_through_const-mod1.volatile[External] + //~ MONO_ITEM fn <u32 as mod1::Trait2Gen<u8>>::do_something @@ vtable_through_const-mod1.volatile[Internal] + //~ MONO_ITEM fn <u32 as mod1::Trait2Gen<u8>>::do_something_else @@ vtable_through_const-mod1.volatile[Internal] mod1::TRAIT1_GEN_REF.do_something(0u8); - //~ MONO_ITEM fn vtable_through_const::mod1[0]::id[0]<char> @@ vtable_through_const-mod1.volatile[External] + //~ MONO_ITEM fn mod1::id::<char> @@ vtable_through_const-mod1.volatile[External] mod1::ID_CHAR('x'); 0 diff --git a/src/test/codegen-units/polymorphization/unused_type_parameters.rs b/src/test/codegen-units/polymorphization/unused_type_parameters.rs index 403f68bb170..13be99635a5 100644 --- a/src/test/codegen-units/polymorphization/unused_type_parameters.rs +++ b/src/test/codegen-units/polymorphization/unused_type_parameters.rs @@ -1,5 +1,4 @@ // compile-flags:-Zpolymorphize=on -Zprint-mono-items=lazy -Copt-level=1 -// ignore-tidy-linelength #![crate_type = "rlib"] @@ -10,44 +9,44 @@ mod functions { // Function doesn't have any type parameters to be unused. pub fn no_parameters() {} -//~ MONO_ITEM fn unused_type_parameters::functions[0]::no_parameters[0] +//~ MONO_ITEM fn functions::no_parameters // Function has an unused type parameter. pub fn unused<T>() { } -//~ MONO_ITEM fn unused_type_parameters::functions[0]::unused[0]<T> +//~ MONO_ITEM fn functions::unused::<T> // Function uses type parameter in value of a binding. pub fn used_binding_value<T: Default>() { let _: T = Default::default(); } -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_binding_value[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_binding_value[0]<u64> +//~ MONO_ITEM fn functions::used_binding_value::<u32> +//~ MONO_ITEM fn functions::used_binding_value::<u64> // Function uses type parameter in type of a binding. pub fn used_binding_type<T>() { let _: Option<T> = None; } -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_binding_type[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_binding_type[0]<u64> +//~ MONO_ITEM fn functions::used_binding_type::<u32> +//~ MONO_ITEM fn functions::used_binding_type::<u64> // Function uses type parameter in argument. pub fn used_argument<T>(_: T) { } -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_argument[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_argument[0]<u64> +//~ MONO_ITEM fn functions::used_argument::<u32> +//~ MONO_ITEM fn functions::used_argument::<u64> // // Function uses type parameter in substitutions to another function. pub fn used_substs<T>() { unused::<T>() } -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_substs[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::functions[0]::used_substs[0]<u64> +//~ MONO_ITEM fn functions::used_substs::<u32> +//~ MONO_ITEM fn functions::used_substs::<u64> } @@ -57,7 +56,7 @@ mod closures { let _ = || {}; } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::no_parameters[0] +//~ MONO_ITEM fn closures::no_parameters // Function has an unused type parameter in parent and closure. pub fn unused<T>() -> u32 { @@ -65,8 +64,8 @@ mod closures { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::unused[0]::{{closure}}[0]<T, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::unused[0]<T> +//~ MONO_ITEM fn closures::unused::<T>::{{closure}}#0 +//~ MONO_ITEM fn closures::unused::<T> // Function has an unused type parameter in closure, but not in parent. pub fn used_parent<T: Default>() -> u32 { @@ -75,9 +74,9 @@ mod closures { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_parent[0]::{{closure}}[0]<T, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_parent[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_parent[0]<u64> +//~ MONO_ITEM fn closures::used_parent::<T>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_parent::<u32> +//~ MONO_ITEM fn closures::used_parent::<u64> // Function uses type parameter in value of a binding in closure. pub fn used_binding_value<T: Default>() -> T { @@ -89,10 +88,10 @@ mod closures { x() } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_value[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn(()) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_value[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn(()) -> u64, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_value[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_value[0]<u64> +//~ MONO_ITEM fn closures::used_binding_value::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_value::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_value::<u32> +//~ MONO_ITEM fn closures::used_binding_value::<u64> // Function uses type parameter in type of a binding in closure. pub fn used_binding_type<T>() -> Option<T> { @@ -104,10 +103,10 @@ mod closures { x() } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_type[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn(()) -> core::option[0]::Option[0]<u32>, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_type[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn(()) -> core::option[0]::Option[0]<u64>, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_type[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_binding_type[0]<u64> +//~ MONO_ITEM fn closures::used_binding_type::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_type::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_binding_type::<u32> +//~ MONO_ITEM fn closures::used_binding_type::<u64> // Function and closure uses type parameter in argument. pub fn used_argument<T>(t: T) -> u32 { @@ -115,10 +114,10 @@ mod closures { x(t) } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn((u64)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument[0]<u64> +//~ MONO_ITEM fn closures::used_argument::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument::<u32> +//~ MONO_ITEM fn closures::used_argument::<u64> // Closure uses type parameter in argument. pub fn used_argument_closure<T: Default>() -> u32 { @@ -127,10 +126,10 @@ mod closures { x(t) } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument_closure[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument_closure[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn((u64)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument_closure[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_argument_closure[0]<u64> +//~ MONO_ITEM fn closures::used_argument_closure::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument_closure::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_argument_closure::<u32> +//~ MONO_ITEM fn closures::used_argument_closure::<u64> // Closure uses type parameter as upvar. pub fn used_upvar<T: Default>() -> T { @@ -139,10 +138,10 @@ mod closures { y() } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_upvar[0]::{{closure}}[0]<u32, i32, extern "rust-call" fn(()) -> u32, (u32)> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_upvar[0]::{{closure}}[0]<u64, i32, extern "rust-call" fn(()) -> u64, (u64)> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_upvar[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_upvar[0]<u64> +//~ MONO_ITEM fn closures::used_upvar::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_upvar::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_upvar::<u32> +//~ MONO_ITEM fn closures::used_upvar::<u64> // Closure uses type parameter in substitutions to another function. pub fn used_substs<T>() { @@ -150,10 +149,10 @@ mod closures { x() } -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_substs[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn(()), ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_substs[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn(()), ()> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_substs[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::closures[0]::used_substs[0]<u64> +//~ MONO_ITEM fn closures::used_substs::<u32>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_substs::<u64>::{{closure}}#0 +//~ MONO_ITEM fn closures::used_substs::<u32> +//~ MONO_ITEM fn closures::used_substs::<u64> } mod methods { @@ -164,29 +163,29 @@ mod methods { pub fn unused_impl() { } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::unused_impl[0]<F> +//~ MONO_ITEM fn methods::Foo::<F>::unused_impl // Function has an unused type parameter from impl and fn. pub fn unused_both<G: Default>() { } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::unused_both[0]<F, G> +//~ MONO_ITEM fn methods::Foo::<F>::unused_both::<G> // Function uses type parameter from impl. pub fn used_impl() { let _: F = Default::default(); } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_impl[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_impl[0]<u64> +//~ MONO_ITEM fn methods::Foo::<u32>::used_impl +//~ MONO_ITEM fn methods::Foo::<u64>::used_impl // Function uses type parameter from impl. pub fn used_fn<G: Default>() { let _: G = Default::default(); } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_fn[0]<F, u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_fn[0]<F, u64> +//~ MONO_ITEM fn methods::Foo::<F>::used_fn::<u32> +//~ MONO_ITEM fn methods::Foo::<F>::used_fn::<u64> // Function uses type parameter from impl. pub fn used_both<G: Default>() { @@ -194,16 +193,16 @@ mod methods { let _: G = Default::default(); } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_both[0]<u32, u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_both[0]<u64, u64> +//~ MONO_ITEM fn methods::Foo::<u32>::used_both::<u32> +//~ MONO_ITEM fn methods::Foo::<u64>::used_both::<u64> // Function uses type parameter in substitutions to another function. pub fn used_substs() { super::functions::unused::<F>() } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_substs[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::used_substs[0]<u64> +//~ MONO_ITEM fn methods::Foo::<u32>::used_substs +//~ MONO_ITEM fn methods::Foo::<u64>::used_substs // Function has an unused type parameter from impl and fn. pub fn closure_unused_all<G: Default>() -> u32 { @@ -211,8 +210,8 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_unused_all[0]::{{closure}}[0]<F, G, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_unused_all[0]<F, G> +//~ MONO_ITEM fn methods::Foo::<F>::closure_unused_all::<G>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<F>::closure_unused_all::<G> // Function uses type parameter from impl and fn in closure. pub fn closure_used_both<G: Default>() -> u32 { @@ -225,10 +224,10 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_both[0]::{{closure}}[0]<u32, u32, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_both[0]::{{closure}}[0]<u64, u64, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_both[0]<u32, u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_both[0]<u64, u64> +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_both::<u32>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_both::<u64>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_both::<u32> +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_both::<u64> // Function uses type parameter from fn in closure. pub fn closure_used_fn<G: Default>() -> u32 { @@ -240,10 +239,10 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_fn[0]::{{closure}}[0]<F, u32, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_fn[0]::{{closure}}[0]<F, u64, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_fn[0]<F, u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_fn[0]<F, u64> +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u32>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u64>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u32> +//~ MONO_ITEM fn methods::Foo::<F>::closure_used_fn::<u64> // Function uses type parameter from impl in closure. pub fn closure_used_impl<G: Default>() -> u32 { @@ -255,10 +254,10 @@ mod methods { add_one(3) } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_impl[0]::{{closure}}[0]<u32, G, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_impl[0]::{{closure}}[0]<u64, G, i8, extern "rust-call" fn((u32)) -> u32, ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_impl[0]<u32, G> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_impl[0]<u64, G> +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_impl::<G>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_impl::<G>::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_impl::<G> +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_impl::<G> // Closure uses type parameter in substitutions to another function. pub fn closure_used_substs() { @@ -266,10 +265,10 @@ mod methods { x() } -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_substs[0]::{{closure}}[0]<u32, i8, extern "rust-call" fn(()), ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_substs[0]::{{closure}}[0]<u64, i8, extern "rust-call" fn(()), ()> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_substs[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::methods[0]::{{impl}}[0]::closure_used_substs[0]<u64> +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_substs::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_substs::{{closure}}#0 +//~ MONO_ITEM fn methods::Foo::<u32>::closure_used_substs +//~ MONO_ITEM fn methods::Foo::<u64>::closure_used_substs } } @@ -306,8 +305,8 @@ fn dispatch<T: Default>() { let _ = methods::Foo::<T>::closure_used_substs(); } -//~ MONO_ITEM fn unused_type_parameters::dispatch[0]<u32> -//~ MONO_ITEM fn unused_type_parameters::dispatch[0]<u64> +//~ MONO_ITEM fn dispatch::<u32> +//~ MONO_ITEM fn dispatch::<u64> pub fn foo() { // Generate two copies of each function to check that where the type parameter is unused, @@ -316,8 +315,8 @@ pub fn foo() { dispatch::<u64>(); } -//~ MONO_ITEM fn unused_type_parameters::foo[0] @@ unused_type_parameters-cgu.0[External] +//~ MONO_ITEM fn foo @@ unused_type_parameters-cgu.0[External] // These are all the items that aren't relevant to the test. -//~ MONO_ITEM fn core::default[0]::{{impl}}[6]::default[0] -//~ MONO_ITEM fn core::default[0]::{{impl}}[7]::default[0] +//~ MONO_ITEM fn <u32 as std::default::Default>::default +//~ MONO_ITEM fn <u64 as std::default::Default>::default |
