diff --git a/src/test/codegen-units/item-collection/cross-crate-closures.rs b/src/test/codegen-units/item-collection/cross-crate-closures.rs index 2b5ac7e8d80..320be278198 100644 --- a/src/test/codegen-units/item-collection/cross-crate-closures.rs +++ b/src/test/codegen-units/item-collection/cross-crate-closures.rs @@ -17,12 +17,14 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] // aux-build:cgu_extern_closures.rs extern crate cgu_extern_closures; -//~ TRANS_ITEM fn cross_crate_closures::main[0] -fn main() { +//~ TRANS_ITEM fn cross_crate_closures::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn[0] //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn[0]::{{closure}}[0] @@ -35,6 +37,8 @@ fn main() { // Nothing should be generated for this call, we just link to the instance // in the extern crate. let _ = cgu_extern_closures::non_inlined_fn(6, 7); + + 0 } //~ TRANS_ITEM drop-glue i8 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 411f3da9182..bcb3b7b1dad 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 @@ -12,32 +12,14 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] // aux-build:cgu_generic_function.rs extern crate cgu_generic_function; -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ cross_crate_generic_functions0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ cross_crate_generic_functions0[Internal] -//~ TRANS_ITEM fn cross_crate_generic_functions::main[0] -fn main() -{ +//~ TRANS_ITEM fn cross_crate_generic_functions::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn cgu_generic_function::bar[0] //~ TRANS_ITEM fn cgu_generic_function::foo[0] let _ = cgu_generic_function::foo(1u32); @@ -48,4 +30,6 @@ fn main() // This should not introduce a codegen item let _ = cgu_generic_function::exported_but_not_generic(3); + + 0 } 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 a269b6da230..910ae000848 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 @@ -12,34 +12,16 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] // aux-build:cgu_export_trait_method.rs extern crate cgu_export_trait_method; use cgu_export_trait_method::Trait; -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ cross_crate_trait_method0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ cross_crate_trait_method0[Internal] -//~ TRANS_ITEM fn cross_crate_trait_method::main[0] -fn main() -{ +//~ TRANS_ITEM fn cross_crate_trait_method::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { // The object code of these methods is contained in the external crate, so // calling them should *not* introduce codegen items in the current crate. let _: (u32, u32) = Trait::without_default_impl(0); @@ -74,4 +56,6 @@ fn main() let _: (char, char) = Trait::without_default_impl_generic('c'); //~ TRANS_ITEM fn cgu_export_trait_method::{{impl}}[0]::without_default_impl_generic[0] 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 88888afa693..52af8165032 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 @@ -12,6 +12,8 @@ // compile-flags:-Zprint-trans-items=eager // compile-flags:-Zinline-in-all-cgus +#![feature(start)] + //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ drop_in_place_intrinsic0[Internal] struct StructWithDtor(u32); @@ -20,32 +22,16 @@ impl Drop for StructWithDtor { fn drop(&mut self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ drop_in_place_intrinsic0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ drop_in_place_intrinsic0[Internal] -//~ TRANS_ITEM fn drop_in_place_intrinsic::main[0] -fn main() { +//~ TRANS_ITEM fn drop_in_place_intrinsic::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]; 2]> @@ drop_in_place_intrinsic0[Internal] let x = [StructWithDtor(0), StructWithDtor(1)]; drop_slice_in_place(&x); + + 0 } //~ TRANS_ITEM fn drop_in_place_intrinsic::drop_slice_in_place[0] 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 3fb25d9b2a0..65707c1aa4d 100644 --- a/src/test/codegen-units/item-collection/function-as-argument.rs +++ b/src/test/codegen-units/item-collection/function-as-argument.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] fn take_fn_once(f: F, x: T1, y: T2) { (f)(x, y) @@ -23,27 +24,9 @@ fn take_fn_pointer(f: fn(T1, T2), x: T1, y: T2) { (f)(x, y) } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ function_as_argument0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ function_as_argument0[Internal] -//~ TRANS_ITEM fn function_as_argument::main[0] -fn main() { +//~ TRANS_ITEM fn function_as_argument::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn function_as_argument::take_fn_once[0] //~ TRANS_ITEM fn function_as_argument::function[0] @@ -62,4 +45,6 @@ fn main() { //~ TRANS_ITEM fn function_as_argument::take_fn_pointer[0] //~ TRANS_ITEM fn function_as_argument::function[0] 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 0d08611d1cc..d3d9aa3aefc 100644 --- a/src/test/codegen-units/item-collection/generic-drop-glue.rs +++ b/src/test/codegen-units/item-collection/generic-drop-glue.rs @@ -13,6 +13,7 @@ // compile-flags:-Zinline-in-all-cgus #![deny(dead_code)] +#![feature(start)] struct StructWithDrop { x: T1, @@ -53,27 +54,9 @@ impl Drop for NonGenericWithDrop { fn drop(&mut self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ generic_drop_glue0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ generic_drop_glue0[Internal] -//~ TRANS_ITEM fn generic_drop_glue::main[0] -fn main() { +//~ TRANS_ITEM fn generic_drop_glue::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ generic_drop_glue0[Internal] //~ TRANS_ITEM fn generic_drop_glue::{{impl}}[0]::drop[0] let _ = StructWithDrop { x: 0i8, y: 'a' }.x; @@ -113,4 +96,6 @@ fn main() { EnumNoDrop::A(x) => x, EnumNoDrop::B(x) => x as f64 }; + + 0 } diff --git a/src/test/codegen-units/item-collection/generic-functions.rs b/src/test/codegen-units/item-collection/generic-functions.rs index 41133f0f797..8efe4b2762a 100644 --- a/src/test/codegen-units/item-collection/generic-functions.rs +++ b/src/test/codegen-units/item-collection/generic-functions.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] fn foo1(a: T1) -> (T1, u32) { (a, 1) @@ -31,27 +32,9 @@ pub fn lifetime_only<'a>(a: &'a u32) -> &'a u32 { a } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ generic_functions0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ generic_functions0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ generic_functions0[Internal] -//~ TRANS_ITEM fn generic_functions::main[0] -fn main() { +//~ TRANS_ITEM fn generic_functions::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn generic_functions::foo1[0] let _ = foo1(2i32); //~ TRANS_ITEM fn generic_functions::foo1[0] @@ -78,4 +61,6 @@ fn main() { let _ = foo3(0i16, "a", 2usize); //~ TRANS_ITEM fn generic_functions::foo3[0] 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 6212ad0417c..d1ee8ee624c 100644 --- a/src/test/codegen-units/item-collection/generic-impl.rs +++ b/src/test/codegen-units/item-collection/generic-impl.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] struct Struct { x: T, @@ -50,27 +51,9 @@ impl<'a> LifeTimeOnly<'a> { pub fn non_instantiated(&self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ generic_impl0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ generic_impl0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ generic_impl0[Internal] -//~ TRANS_ITEM fn generic_impl::main[0] -fn main() { +//~ TRANS_ITEM fn generic_impl::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn generic_impl::{{impl}}[0]::new[0] //~ TRANS_ITEM fn generic_impl::id[0] //~ TRANS_ITEM fn generic_impl::{{impl}}[0]::get[0] @@ -94,4 +77,6 @@ fn main() { //~ TRANS_ITEM fn generic_impl::{{impl}}[0]::new[0]> //~ TRANS_ITEM fn generic_impl::id[0]> 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 aa3de2095fb..c07d26c3f8d 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 @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] trait SomeTrait { fn foo(&self); @@ -28,26 +29,10 @@ pub fn generic_function(x: T) -> (T, i32) { (x, 0) } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ impl_in_non_instantiated_generic0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ impl_in_non_instantiated_generic0[Internal] -//~ TRANS_ITEM fn impl_in_non_instantiated_generic::main[0] -fn main() { +//~ TRANS_ITEM fn impl_in_non_instantiated_generic::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { 0i64.foo(); + + 0 } 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 8b46984f72f..2e1138ef128 100644 --- a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs +++ b/src/test/codegen-units/item-collection/instantiation-through-vtable.rs @@ -13,6 +13,7 @@ // compile-flags:-Zinline-in-all-cgus #![deny(dead_code)] +#![feature(start)] trait Trait { fn foo(&self) -> u32; @@ -28,27 +29,9 @@ impl Trait for Struct { fn bar(&self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ instantiation_through_vtable0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ instantiation_through_vtable0[Internal] -//~ TRANS_ITEM fn instantiation_through_vtable::main[0] -fn main() { +//~ TRANS_ITEM fn instantiation_through_vtable::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { let s1 = Struct { _a: 0u32 }; //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ instantiation_through_vtable0[Internal] @@ -61,4 +44,6 @@ fn main() { //~ TRANS_ITEM fn instantiation_through_vtable::{{impl}}[0]::foo[0] //~ TRANS_ITEM fn instantiation_through_vtable::{{impl}}[0]::bar[0] 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 abd79dd39d6..04b54de3ce2 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 @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] fn generic_fn(a: T) -> (T, i32) { //~ TRANS_ITEM fn items_within_generic_items::generic_fn[0]::nested_fn[0] @@ -31,31 +32,15 @@ fn generic_fn(a: T) -> (T, i32) { return (a, x + nested_fn(0)); } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ items_within_generic_items0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ items_within_generic_items0[Internal] -//~ TRANS_ITEM fn items_within_generic_items::main[0] -fn main() { +//~ TRANS_ITEM fn items_within_generic_items::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn items_within_generic_items::generic_fn[0] let _ = generic_fn(0i64); //~ TRANS_ITEM fn items_within_generic_items::generic_fn[0] let _ = generic_fn(0u16); //~ TRANS_ITEM fn items_within_generic_items::generic_fn[0] let _ = generic_fn(0i8); + + 0 } diff --git a/src/test/codegen-units/item-collection/non-generic-closures.rs b/src/test/codegen-units/item-collection/non-generic-closures.rs index 278e9189dd6..f0121d56cec 100644 --- a/src/test/codegen-units/item-collection/non-generic-closures.rs +++ b/src/test/codegen-units/item-collection/non-generic-closures.rs @@ -17,6 +17,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] //~ TRANS_ITEM fn non_generic_closures::temporary[0] fn temporary() { @@ -52,12 +53,15 @@ fn assigned_to_variable_executed_directly() { f(4); } -//~ TRANS_ITEM fn non_generic_closures::main[0] -fn main() { +//~ TRANS_ITEM fn non_generic_closures::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { temporary(); assigned_to_variable_but_not_executed(); assigned_to_variable_executed_directly(); assigned_to_variable_executed_indirectly(); + + 0 } //~ TRANS_ITEM fn non_generic_closures::run_closure[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 df89b3fca9f..bf084aa96ea 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 @@ -13,6 +13,7 @@ // compile-flags:-Zinline-in-all-cgus #![deny(dead_code)] +#![feature(start)] //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ non_generic_drop_glue0[Internal] struct StructWithDrop { @@ -42,27 +43,9 @@ enum EnumNoDrop { A(i32) } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ non_generic_drop_glue0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ non_generic_drop_glue0[Internal] -//~ TRANS_ITEM fn non_generic_drop_glue::main[0] -fn main() { +//~ TRANS_ITEM fn non_generic_drop_glue::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { let _ = StructWithDrop { x: 0 }.x; let _ = StructNoDrop { x: 0 }.x; let _ = match EnumWithDrop::A(0) { @@ -71,4 +54,6 @@ fn main() { let _ = match EnumNoDrop::A(0) { EnumNoDrop::A(x) => x }; + + 0 } 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 6f254ffde60..8c487db5c96 100644 --- a/src/test/codegen-units/item-collection/non-generic-functions.rs +++ b/src/test/codegen-units/item-collection/non-generic-functions.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] //~ TRANS_ITEM fn non_generic_functions::foo[0] fn foo() { @@ -69,30 +70,14 @@ impl Struct { } } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ non_generic_functions0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ non_generic_functions0[Internal] -//~ TRANS_ITEM fn non_generic_functions::main[0] -fn main() { +//~ TRANS_ITEM fn non_generic_functions::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { foo(); bar(); Struct::foo(); let x = Struct { _x: 0 }; x.bar(); + + 0 } diff --git a/src/test/codegen-units/item-collection/static-init.rs b/src/test/codegen-units/item-collection/static-init.rs index 9921c9b84d2..5ff7c3480b1 100644 --- a/src/test/codegen-units/item-collection/static-init.rs +++ b/src/test/codegen-units/item-collection/static-init.rs @@ -11,6 +11,8 @@ // compile-flags:-Zprint-trans-items=eager // ignore-tidy-linelength +#![feature(start)] + pub static FN : fn() = foo::; pub fn foo() { } @@ -18,25 +20,9 @@ pub fn foo() { } //~ TRANS_ITEM fn static_init::foo[0] //~ TRANS_ITEM static static_init::FN[0] -fn main() { } +//~ TRANS_ITEM fn static_init::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { + 0 +} -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ static_init0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ static_init0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ static_init0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ static_init0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ static_init0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ static_init0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ static_init0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ static_init0[Internal] -//~ TRANS_ITEM fn static_init::main[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 bd3dcd2fe79..11df1da3a78 100644 --- a/src/test/codegen-units/item-collection/statics-and-consts.rs +++ b/src/test/codegen-units/item-collection/statics-and-consts.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] static STATIC1: i64 = { const STATIC1_CONST1: i64 = 2; @@ -47,9 +48,13 @@ fn foo() { }; } -fn main() { +//~ TRANS_ITEM fn statics_and_consts::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { foo(); let _ = STATIC1; + + 0 } //~ TRANS_ITEM static statics_and_consts::STATIC1[0] @@ -58,24 +63,3 @@ fn main() { //~ TRANS_ITEM static statics_and_consts::foo[0]::STATIC2[0] //~ TRANS_ITEM static statics_and_consts::foo[0]::STATIC2[1] //~ TRANS_ITEM static statics_and_consts::foo[0]::STATIC2[2] - -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ statics_and_consts0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ statics_and_consts0[Internal] -//~ TRANS_ITEM fn statics_and_consts::main[0] diff --git a/src/test/codegen-units/item-collection/trait-implementations.rs b/src/test/codegen-units/item-collection/trait-implementations.rs index e8f727cbd12..8eb33dd647f 100644 --- a/src/test/codegen-units/item-collection/trait-implementations.rs +++ b/src/test/codegen-units/item-collection/trait-implementations.rs @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] pub trait SomeTrait { fn foo(&self); @@ -55,27 +56,9 @@ impl SomeGenericTrait for f32 { fn bar(&self, _: T, _: T2) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ trait_implementations0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ trait_implementations0[Internal] -//~ TRANS_ITEM fn trait_implementations::main[0] -fn main() { +//~ TRANS_ITEM fn trait_implementations::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn trait_implementations::{{impl}}[1]::bar[0] 0i32.bar('x'); @@ -96,4 +79,6 @@ fn main() { //~ TRANS_ITEM fn trait_implementations::{{impl}}[3]::bar[0]<&str, &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 f6e3c1cf974..10b21630308 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 @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] trait Trait : Sized { fn foo(self) -> Self { self } @@ -36,27 +37,9 @@ fn take_foo_mut T>(mut f: F, arg: T) -> T { (f)(arg) } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ trait_method_as_argument0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ trait_method_as_argument0[Internal] -//~ TRANS_ITEM fn trait_method_as_argument::main[0] -fn main() { +//~ TRANS_ITEM fn trait_method_as_argument::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn trait_method_as_argument::take_foo_once[0] u32> //~ TRANS_ITEM fn trait_method_as_argument::{{impl}}[0]::foo[0] //~ TRANS_ITEM fn core::ops[0]::function[0]::FnOnce[0]::call_once[0] u32, (u32)> @@ -82,4 +65,6 @@ fn main() { //~ TRANS_ITEM fn trait_method_as_argument::take_foo_mut[0] char> //~ TRANS_ITEM fn core::ops[0]::function[0]::FnMut[0]::call_mut[0] u32, (u32)> 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 6e6793076da..a6ae3765b2e 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 @@ -12,6 +12,7 @@ // compile-flags:-Zprint-trans-items=eager #![deny(dead_code)] +#![feature(start)] trait SomeTrait { fn foo(&self) { } @@ -46,27 +47,9 @@ impl SomeGenericTrait for u32 { // since nothing is monomorphic here, nothing should be generated unless used somewhere. } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ trait_method_default_impl0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ trait_method_default_impl0[Internal] -//~ TRANS_ITEM fn trait_method_default_impl::main[0] -fn main() { +//~ TRANS_ITEM fn trait_method_default_impl::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn trait_method_default_impl::SomeTrait[0]::bar[0] let _ = 1i8.bar('c'); @@ -84,4 +67,6 @@ fn main() { //~ TRANS_ITEM fn trait_method_default_impl::SomeGenericTrait[0]::bar[0] 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 e966b9f92e4..57cd10187a2 100644 --- a/src/test/codegen-units/item-collection/transitive-drop-glue.rs +++ b/src/test/codegen-units/item-collection/transitive-drop-glue.rs @@ -13,6 +13,7 @@ // compile-flags:-Zinline-in-all-cgus #![deny(dead_code)] +#![feature(start)] //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ transitive_drop_glue0[Internal] struct Root(Intermediate); @@ -34,28 +35,9 @@ impl Drop for LeafGen { fn drop(&mut self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ transitive_drop_glue0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ transitive_drop_glue0[Internal] -//~ TRANS_ITEM fn transitive_drop_glue::main[0] -fn main() { - +//~ TRANS_ITEM fn transitive_drop_glue::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { let _ = Root(Intermediate(Leaf)); //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ transitive_drop_glue0[Internal] @@ -69,4 +51,6 @@ fn main() { //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ transitive_drop_glue0[Internal] //~ TRANS_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0] 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 93b3f832e99..a5f2409b8ae 100644 --- a/src/test/codegen-units/item-collection/tuple-drop-glue.rs +++ b/src/test/codegen-units/item-collection/tuple-drop-glue.rs @@ -13,6 +13,7 @@ // compile-flags:-Zinline-in-all-cgus #![deny(dead_code)] +#![feature(start)] //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ tuple_drop_glue0[Internal] struct Dropped; @@ -22,31 +23,15 @@ impl Drop for Dropped { fn drop(&mut self) {} } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ tuple_drop_glue0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ tuple_drop_glue0[Internal] -//~ TRANS_ITEM fn tuple_drop_glue::main[0] -fn main() { +//~ TRANS_ITEM fn tuple_drop_glue::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, tuple_drop_glue::Dropped[0])> @@ tuple_drop_glue0[Internal] let x = (0u32, Dropped); //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<(i16, (tuple_drop_glue::Dropped[0], bool))> @@ tuple_drop_glue0[Internal] //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<(tuple_drop_glue::Dropped[0], bool)> @@ tuple_drop_glue0[Internal] let x = (0i16, (Dropped, true)); + + 0 } diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/src/test/codegen-units/item-collection/unsizing.rs index 4c07177b739..87d2581e1f8 100644 --- a/src/test/codegen-units/item-collection/unsizing.rs +++ b/src/test/codegen-units/item-collection/unsizing.rs @@ -15,6 +15,7 @@ #![deny(dead_code)] #![feature(coerce_unsized)] #![feature(unsize)] +#![feature(start)] use std::marker::Unsize; use std::ops::CoerceUnsized; @@ -53,28 +54,9 @@ struct Wrapper(*const T); impl, U: ?Sized> CoerceUnsized> for Wrapper {} -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ unsizing0[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ unsizing0[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ unsizing0[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ unsizing0[Internal] -//~ TRANS_ITEM fn unsizing::main[0] -fn main() -{ +//~ TRANS_ITEM fn unsizing::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { // simple case let bool_sized = &true; //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ unsizing0[Internal] @@ -102,4 +84,6 @@ fn main() //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ unsizing0[Internal] //~ TRANS_ITEM fn unsizing::{{impl}}[3]::foo[0] let _wrapper_sized = wrapper_sized as Wrapper; + + 0 } diff --git a/src/test/codegen-units/partitioning/methods-are-with-self-type.rs b/src/test/codegen-units/partitioning/methods-are-with-self-type.rs index 1ea5aafd401..aa01289de59 100644 --- a/src/test/codegen-units/partitioning/methods-are-with-self-type.rs +++ b/src/test/codegen-units/partitioning/methods-are-with-self-type.rs @@ -19,6 +19,7 @@ // compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/methods-are-with-self-type #![allow(dead_code)] +#![feature(start)] struct SomeType; @@ -63,9 +64,9 @@ mod type2 { pub struct Struct; } -//~ TRANS_ITEM fn methods_are_with_self_type::main[0] -fn main() -{ +//~ TRANS_ITEM fn methods_are_with_self_type::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::method[0] @@ methods_are_with_self_type.volatile[WeakODR] SomeGenericType(0u32, 0u64).method(); //~ TRANS_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::associated_fn[0] @@ methods_are_with_self_type.volatile[WeakODR] @@ -80,6 +81,8 @@ fn main() type1::Struct.default(); //~ TRANS_ITEM fn methods_are_with_self_type::Trait[0]::default[0] @@ methods_are_with_self_type-type2.volatile[WeakODR] type2::Struct.default(); + + 0 } //~ TRANS_ITEM drop-glue i8 diff --git a/src/test/codegen-units/partitioning/vtable-through-const.rs b/src/test/codegen-units/partitioning/vtable-through-const.rs index 05c36810c1f..d0acddda637 100644 --- a/src/test/codegen-units/partitioning/vtable-through-const.rs +++ b/src/test/codegen-units/partitioning/vtable-through-const.rs @@ -18,6 +18,8 @@ // This test case makes sure, that references made through constants are // recorded properly in the InliningMap. +#![feature(start)] + mod mod1 { pub trait Trait1 { fn do_something(&self) {} @@ -38,7 +40,7 @@ mod mod1 { fn id(x: T) -> T { x } - // These are referenced, so they produce trans-items (see main()) + // These are referenced, so they produce trans-items (see start()) pub const TRAIT1_REF: &'static Trait1 = &0u32 as &Trait1; pub const TRAIT1_GEN_REF: &'static Trait1Gen = &0u32 as &Trait1Gen; pub const ID_CHAR: fn(char) -> char = id::; @@ -68,27 +70,9 @@ mod mod1 { pub const ID_I64: fn(i64) -> i64 = id::; } -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::align[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::from_size_align_unchecked[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn alloc::allocator[0]::{{impl}}[0]::size[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::box_free[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn alloc::heap[0]::{{impl}}[0]::dealloc[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn core::mem[0]::uninitialized[0]> @@ std-panicking.volatile[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]> @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]>> @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn core::ptr[0]::read[0]> @@ std-panicking.volatile[Internal] -//~ TRANS_ITEM fn core::ptr[0]::write[0] @@ std-panicking.volatile[Internal] -//~ TRANS_ITEM fn core::result[0]::{{impl}}[0]::unwrap_or[0]> @@ std-rt.volatile[Internal] -//~ TRANS_ITEM fn std::panic[0]::catch_unwind[0], i32> @@ std-panic.volatile[External] -//~ TRANS_ITEM fn std::panicking[0]::try[0]::do_call[0], i32> @@ std-panicking.volatile[Internal] -//~ TRANS_ITEM fn std::panicking[0]::try[0]> @@ std-panicking.volatile[External] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, fn()> @@ std-sys_common-backtrace.volatile[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]::{{closure}}[0]<(), i32, extern "rust-call" fn(()) -> i32, &fn()> @@ std-panicking.volatile[Internal] -//~ TRANS_ITEM fn std::rt[0]::lang_start[0]<()> @@ std-rt.volatile[External] -//~ TRANS_ITEM fn std::sys_common[0]::backtrace[0]::__rust_begin_short_backtrace[0], i32> @@ std-sys_common-backtrace.volatile[External] -//~ TRANS_ITEM fn vtable_through_const::main[0] @@ vtable_through_const[Internal] -fn main() { +//~ TRANS_ITEM fn vtable_through_const::start[0] +#[start] +fn start(_: isize, _: *const *const u8) -> isize { //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0] @@ vtable_through_const[Internal] // Since Trait1::do_something() is instantiated via its default implementation, @@ -109,4 +93,6 @@ fn main() { //~ TRANS_ITEM fn vtable_through_const::mod1[0]::id[0] @@ vtable_through_const-mod1.volatile[External] mod1::ID_CHAR('x'); + + 0 }