From cb9b0ed91b898cbda23caa8ed1a82c37b39845de Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 24 Aug 2016 06:36:37 +0300 Subject: [PATCH] Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit. --- configure | 2 -- mk/main.mk | 6 ---- src/librustc/session/config.rs | 35 +------------------ src/librustc_trans/base.rs | 25 +++++-------- src/librustc_trans/closure.rs | 19 ---------- src/librustc_trans/consts.rs | 7 +--- src/librustc_trans/mir/mod.rs | 2 +- src/libsyntax/feature_gate.rs | 5 --- src/test/codegen/adjustments.rs | 8 ++--- src/test/codegen/coercions.rs | 3 -- src/test/codegen/consts.rs | 20 +++++------ src/test/codegen/drop.rs | 10 +++--- src/test/codegen/loads.rs | 4 +-- src/test/codegen/mir_zst_stores.rs | 2 -- src/test/codegen/naked-functions.rs | 6 ++-- src/test/codegen/refs.rs | 11 +++--- src/test/codegen/stores.rs | 11 +++--- .../enable-orbit-for-incr-comp.rs | 20 ----------- src/test/run-fail/issue-30380.rs | 3 -- src/test/run-fail/mir_drop_panics.rs | 2 -- src/test/run-fail/mir_dynamic_drops_1.rs | 2 -- src/test/run-fail/mir_dynamic_drops_2.rs | 3 +- src/test/run-fail/mir_dynamic_drops_3.rs | 3 +- src/test/run-fail/mir_indexing_oob_1.rs | 2 -- src/test/run-fail/mir_indexing_oob_2.rs | 2 -- src/test/run-fail/mir_indexing_oob_3.rs | 2 -- .../mir_trans_calls_converging_drops.rs | 3 -- .../mir_trans_calls_converging_drops_2.rs | 3 -- .../run-fail/mir_trans_calls_diverging.rs | 3 +- .../mir_trans_calls_diverging_drops.rs | 3 -- .../run-fail/mir_trans_no_landing_pads.rs | 3 +- .../mir_trans_no_landing_pads_diverging.rs | 3 +- src/test/run-pass-fulldeps/mir-pass.rs | 3 +- .../run-pass-valgrind/cast-enum-with-dtor.rs | 5 ++- src/test/run-pass/dynamic-drop.rs | 4 --- .../run-pass/exhaustive-bool-match-sanity.rs | 3 -- src/test/run-pass/issue-16648.rs | 3 +- src/test/run-pass/issue-28950.rs | 10 ++++-- src/test/run-pass/issue-32805.rs | 7 ---- src/test/run-pass/issue-33387.rs | 3 -- src/test/run-pass/issue-7784.rs | 2 -- src/test/run-pass/match-vec-alternatives.rs | 6 ---- src/test/run-pass/mir_adt_construction.rs | 7 ---- src/test/run-pass/mir_ascription_coercion.rs | 3 +- .../run-pass/mir_augmented_assignments.rs | 16 --------- src/test/run-pass/mir_autoderef.rs | 4 --- src/test/run-pass/mir_boxing.rs | 3 +- .../run-pass/mir_build_match_comparisons.rs | 6 ---- .../run-pass/mir_call_with_associated_type.rs | 4 --- src/test/run-pass/mir_cast_fn_ret.rs | 4 --- src/test/run-pass/mir_coercion_casts.rs | 3 -- src/test/run-pass/mir_coercions.rs | 9 +---- src/test/run-pass/mir_constval_adts.rs | 3 -- src/test/run-pass/mir_cross_crate.rs | 3 +- src/test/run-pass/mir_fat_ptr.rs | 9 ----- src/test/run-pass/mir_fat_ptr_drop.rs | 1 - src/test/run-pass/mir_match_arm_guard.rs | 3 -- src/test/run-pass/mir_misc_casts.rs | 18 +--------- src/test/run-pass/mir_overflow_off.rs | 2 +- src/test/run-pass/mir_raw_fat_ptr.rs | 6 ---- src/test/run-pass/mir_refs_correct.rs | 28 +-------------- src/test/run-pass/mir_small_agg_arg.rs | 3 -- src/test/run-pass/mir_struct_with_assoc_ty.rs | 3 -- src/test/run-pass/mir_temp_promotions.rs | 3 -- src/test/run-pass/mir_trans_array.rs | 2 -- src/test/run-pass/mir_trans_array_2.rs | 2 -- .../run-pass/mir_trans_call_converging.rs | 2 -- src/test/run-pass/mir_trans_calls.rs | 24 +------------ src/test/run-pass/mir_trans_calls_variadic.rs | 3 -- src/test/run-pass/mir_trans_critical_edge.rs | 1 - src/test/run-pass/mir_trans_spike1.rs | 3 -- src/test/run-pass/mir_trans_switch.rs | 4 --- src/test/run-pass/mir_trans_switchint.rs | 3 -- src/test/run-pass/mir_void_return.rs | 3 -- src/test/run-pass/mir_void_return_2.rs | 3 -- src/test/run-pass/vec-matching-fold.rs | 3 -- .../vec-matching-legal-tail-element-borrow.rs | 3 +- src/test/run-pass/vec-matching.rs | 7 ---- src/test/run-pass/vec-tail-matching.rs | 2 -- .../run-pass/zero-size-type-destructors.rs | 3 +- .../run-pass/zero_sized_subslice_match.rs | 2 -- 81 files changed, 68 insertions(+), 422 deletions(-) delete mode 100644 src/test/compile-fail/enable-orbit-for-incr-comp.rs diff --git a/configure b/configure index 18dc99dd6c34c..a48ff6a76109c 100755 --- a/configure +++ b/configure @@ -733,8 +733,6 @@ if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTION if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi -if [ -n "$CFG_DISABLE_ORBIT" ]; then putvar CFG_DISABLE_ORBIT; fi - step_msg "looking for build programs" probe_need CFG_CURL curl diff --git a/mk/main.mk b/mk/main.mk index 1725143325c61..428d9d16182ab 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -162,12 +162,6 @@ ifdef CFG_ENABLE_DEBUGINFO CFG_RUSTC_FLAGS += -g endif -ifdef CFG_DISABLE_ORBIT - $(info cfg: HOLD HOLD HOLD (CFG_DISABLE_ORBIT)) - RUSTFLAGS_STAGE1 += -Z orbit=off - RUSTFLAGS_STAGE2 += -Z orbit=off -endif - ifdef SAVE_TEMPS CFG_RUSTC_FLAGS += -C save-temps endif diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index e988ddcd97b15..852ff091259d1 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -605,8 +605,6 @@ macro_rules! options { pub const parse_bool: Option<&'static str> = None; pub const parse_opt_bool: Option<&'static str> = Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`"); - pub const parse_all_bool: Option<&'static str> = - Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`"); pub const parse_string: Option<&'static str> = Some("a string"); pub const parse_opt_string: Option<&'static str> = Some("a string"); pub const parse_list: Option<&'static str> = Some("a space-separated list of strings"); @@ -656,25 +654,6 @@ macro_rules! options { } } - fn parse_all_bool(slot: &mut bool, v: Option<&str>) -> bool { - match v { - Some(s) => { - match s { - "n" | "no" | "off" => { - *slot = false; - } - "y" | "yes" | "on" => { - *slot = true; - } - _ => { return false; } - } - - true - }, - None => { *slot = true; true } - } - } - fn parse_opt_string(slot: &mut Option, v: Option<&str>) -> bool { match v { Some(s) => { *slot = Some(s.to_string()); true }, @@ -930,8 +909,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "dump MIR state at various points in translation"), dump_mir_dir: Option = (None, parse_opt_string, [UNTRACKED], "the directory the MIR is dumped into"), - orbit: bool = (true, parse_all_bool, [UNTRACKED], - "get MIR where it belongs - everywhere; most importantly, in orbit"), } pub fn default_lib_output() -> CrateType { @@ -1324,15 +1301,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches) }) }); - let mut debugging_opts = build_debugging_options(matches, error_format); - - // Incremental compilation only works reliably when translation is done via - // MIR, so let's enable -Z orbit if necessary (see #34973). - if debugging_opts.incremental.is_some() && !debugging_opts.orbit { - early_warn(error_format, "Automatically enabling `-Z orbit` because \ - `-Z incremental` was specified"); - debugging_opts.orbit = true; - } + let debugging_opts = build_debugging_options(matches, error_format); let mir_opt_level = debugging_opts.mir_opt_level.unwrap_or(1); @@ -2424,8 +2393,6 @@ mod tests { assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash()); opts.debugging_opts.dump_mir_dir = Some(String::from("abc")); assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash()); - opts.debugging_opts.orbit = false; - assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash()); // Make sure changing a [TRACKED] option changes the hash opts = reference.clone(); diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index cab353cd26209..a1f3e4e5b59c6 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -1424,26 +1424,17 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> { false }; - let check_attrs = |attrs: &[ast::Attribute]| { - let default_to_mir = ccx.sess().opts.debugging_opts.orbit; - let invert = if default_to_mir { "rustc_no_mir" } else { "rustc_mir" }; - (default_to_mir ^ attrs.iter().any(|item| item.check_name(invert)), - attrs.iter().any(|item| item.check_name("no_debug"))) - }; - - let (use_mir, no_debug) = if let Some(id) = local_id { - check_attrs(ccx.tcx().map.attrs(id)) + let no_debug = if let Some(id) = local_id { + ccx.tcx().map.attrs(id) + .iter().any(|item| item.check_name("no_debug")) } else if let Some(def_id) = def_id { - check_attrs(&ccx.sess().cstore.item_attrs(def_id)) + ccx.sess().cstore.item_attrs(def_id) + .iter().any(|item| item.check_name("no_debug")) } else { - check_attrs(&[]) + false }; - let mir = if use_mir { - def_id.and_then(|id| ccx.get_mir(id)) - } else { - None - }; + let mir = def_id.and_then(|id| ccx.get_mir(id)); let debug_context = if let (false, Some(definition)) = (no_debug, definition) { let (instance, sig, abi, _) = definition; @@ -1846,6 +1837,8 @@ pub fn trans_closure<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, if fcx.mir.is_some() { return mir::trans_mir(&fcx); + } else { + span_bug!(body.span, "attempted translation of `{}` w/o MIR", instance); } debuginfo::fill_scope_map_for_function(&fcx, decl, body, inlined_id); diff --git a/src/librustc_trans/closure.rs b/src/librustc_trans/closure.rs index 77b2c43167cfd..e0fa8df1100ac 100644 --- a/src/librustc_trans/closure.rs +++ b/src/librustc_trans/closure.rs @@ -181,16 +181,6 @@ fn get_or_create_closure_declaration<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, llfn } -fn translating_closure_body_via_mir_will_fail(ccx: &CrateContext, - closure_def_id: DefId) - -> bool { - let default_to_mir = ccx.sess().opts.debugging_opts.orbit; - let invert = if default_to_mir { "rustc_no_mir" } else { "rustc_mir" }; - let use_mir = default_to_mir ^ ccx.tcx().has_attr(closure_def_id, invert); - - !use_mir -} - pub fn trans_closure_body_via_mir<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, closure_def_id: DefId, closure_substs: ty::ClosureSubsts<'tcx>) { @@ -362,15 +352,6 @@ pub fn trans_closure_method<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>, closure_def_id, substs); } else { - // If the closure is defined in an upstream crate, we can only - // translate it if MIR-trans is active. - - if translating_closure_body_via_mir_will_fail(ccx, closure_def_id) { - ccx.sess().fatal("You have run into a known limitation of the \ - MingW toolchain. Either compile with -Zorbit or \ - with -Ccodegen-units=1 to work around it."); - } - trans_closure_body_via_mir(ccx, closure_def_id, substs); } } diff --git a/src/librustc_trans/consts.rs b/src/librustc_trans/consts.rs index 0e9898896778c..7382d5f0130cd 100644 --- a/src/librustc_trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -1150,12 +1150,7 @@ pub fn trans_static(ccx: &CrateContext, let def_id = ccx.tcx().map.local_def_id(id); let datum = get_static(ccx, def_id); - let check_attrs = |attrs: &[ast::Attribute]| { - let default_to_mir = ccx.sess().opts.debugging_opts.orbit; - let invert = if default_to_mir { "rustc_no_mir" } else { "rustc_mir" }; - default_to_mir ^ attrs.iter().any(|item| item.check_name(invert)) - }; - let use_mir = check_attrs(ccx.tcx().map.attrs(id)); + let use_mir = true; let v = if use_mir { ::mir::trans_static_initializer(ccx, def_id) diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs index 727b680541dd7..fe90d7f2725ae 100644 --- a/src/librustc_trans/mir/mod.rs +++ b/src/librustc_trans/mir/mod.rs @@ -145,7 +145,7 @@ impl<'tcx> LocalRef<'tcx> { /////////////////////////////////////////////////////////////////////////// pub fn trans_mir<'blk, 'tcx: 'blk>(fcx: &'blk FunctionContext<'blk, 'tcx>) { - let bcx = fcx.init(false, None).build(); + let bcx = fcx.init(true, None).build(); let mir = bcx.mir(); // Analyze the temps to determine which must be lvalues diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index d94bfe7dcbdac..05a485cefab7e 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -517,11 +517,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_no_mir", Whitelisted, Gated("rustc_attrs", - "the `#[rustc_no_mir]` attribute \ - is just used to make tests pass \ - and will never be stable", - cfg_fn!(rustc_attrs))), ("rustc_inherit_overflow_checks", Whitelisted, Gated("rustc_attrs", "the `#[rustc_inherit_overflow_checks]` \ attribute is just used to control \ diff --git a/src/test/codegen/adjustments.rs b/src/test/codegen/adjustments.rs index 20d0493943452..40603845da2b0 100644 --- a/src/test/codegen/adjustments.rs +++ b/src/test/codegen/adjustments.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] // Hack to get the correct size for the length part in slices // CHECK: @helper([[USIZE:i[0-9]+]]) @@ -21,13 +20,12 @@ fn helper(_: usize) { // CHECK-LABEL: @no_op_slice_adjustment #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn no_op_slice_adjustment(x: &[u8]) -> &[u8] { // We used to generate an extra alloca and memcpy for the block's trailing expression value, so // check that we copy directly to the return value slot -// CHECK: [[SRC:%[0-9]+]] = bitcast { i8*, [[USIZE]] }* %x to -// CHECK: [[DST:%[0-9]+]] = bitcast { i8*, [[USIZE]] }* %sret_slot to i8* -// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[DST]], i8* [[SRC]], +// CHECK: %2 = insertvalue { i8*, [[USIZE]] } undef, i8* %0, 0 +// CHECK: %3 = insertvalue { i8*, [[USIZE]] } %2, [[USIZE]] %1, 1 +// CHECK: ret { i8*, [[USIZE]] } %3 { x } } diff --git a/src/test/codegen/coercions.rs b/src/test/codegen/coercions.rs index 74c7192259ac4..c8c9f5b407c42 100644 --- a/src/test/codegen/coercions.rs +++ b/src/test/codegen/coercions.rs @@ -11,14 +11,12 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] static X: i32 = 5; // CHECK-LABEL: @raw_ptr_to_raw_ptr_noop // CHECK-NOT: alloca #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn raw_ptr_to_raw_ptr_noop() -> *const i32{ &X as *const i32 } @@ -26,7 +24,6 @@ pub fn raw_ptr_to_raw_ptr_noop() -> *const i32{ // CHECK-LABEL: @reference_to_raw_ptr_noop // CHECK-NOT: alloca #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn reference_to_raw_ptr_noop() -> *const i32 { &X } diff --git a/src/test/codegen/consts.rs b/src/test/codegen/consts.rs index ea4c932d43549..36a582ca73709 100644 --- a/src/test/codegen/consts.rs +++ b/src/test/codegen/consts.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] // Below, these constants are defined as enum variants that by itself would // have a lower alignment than the enum type. Ensure that we mark them @@ -20,11 +19,12 @@ // CHECK: @STATIC = {{.*}}, align 4 // This checks the constants from inline_enum_const -// CHECK: @const{{[0-9]+}} = {{.*}}, align 2 +// CHECK: @ref{{[0-9]+}} = {{.*}}, align 2 // This checks the constants from {low,high}_align_const, they share the same // constant, but the alignment differs, so the higher one should be used -// CHECK: @const{{[0-9]+}} = {{.*}}, align 4 +// CHECK: [[LOW_HIGH:@ref[0-9]+]] = {{.*}}, align 4 +// CHECK: [[LOW_HIGH_REF:@const[0-9]+]] = {{.*}} [[LOW_HIGH]] #[derive(Copy, Clone)] @@ -40,32 +40,28 @@ pub static STATIC: E = E::A(0); // CHECK-LABEL: @static_enum_const #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn static_enum_const() -> E { STATIC } // CHECK-LABEL: @inline_enum_const #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn inline_enum_const() -> E { - E::A(0) + *&E::A(0) } // CHECK-LABEL: @low_align_const #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn low_align_const() -> E { // Check that low_align_const and high_align_const use the same constant -// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{[0-9]+}}, i8* {{.*}} [[LOW_HIGH:@const[0-9]+]] - E::A(0) +// CHECK: load {{.*}} bitcast ({ i16, i16, [4 x i8] }** [[LOW_HIGH_REF]] + *&E::A(0) } // CHECK-LABEL: @high_align_const #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn high_align_const() -> E { // Check that low_align_const and high_align_const use the same constant -// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{[0-9]}}, i8* {{.*}} [[LOW_HIGH]] - E::A(0) +// CHECK: load {{.*}} bitcast ({ i16, i16, [4 x i8] }** [[LOW_HIGH_REF]] + *&E::A(0) } diff --git a/src/test/codegen/drop.rs b/src/test/codegen/drop.rs index 25f8c13046997..a4bd5cf2c158e 100644 --- a/src/test/codegen/drop.rs +++ b/src/test/codegen/drop.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] struct SomeUniqueName; @@ -25,19 +24,20 @@ pub fn possibly_unwinding() { // CHECK-LABEL: @droppy #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn droppy() { // Check that there are exactly 6 drop calls. The cleanups for the unwinding should be reused, so // that's one new drop call per call to possibly_unwinding(), and finally 3 drop calls for the // regular function exit. We used to have problems with quadratic growths of drop calls in such // functions. -// CHECK: call{{.*}}drop{{.*}}SomeUniqueName -// CHECK: call{{.*}}drop{{.*}}SomeUniqueName -// CHECK: call{{.*}}drop{{.*}}SomeUniqueName +// CHECK-NOT: invoke{{.*}}drop{{.*}}SomeUniqueName // CHECK: call{{.*}}drop{{.*}}SomeUniqueName // CHECK: call{{.*}}drop{{.*}}SomeUniqueName // CHECK: call{{.*}}drop{{.*}}SomeUniqueName // CHECK-NOT: call{{.*}}drop{{.*}}SomeUniqueName +// CHECK: invoke{{.*}}drop{{.*}}SomeUniqueName +// CHECK: invoke{{.*}}drop{{.*}}SomeUniqueName +// CHECK: invoke{{.*}}drop{{.*}}SomeUniqueName +// CHECK-NOT: {{(call|invoke).*}}drop{{.*}}SomeUniqueName // The next line checks for the } that ends the function definition // CHECK-LABEL: {{^[}]}} let _s = SomeUniqueName; diff --git a/src/test/codegen/loads.rs b/src/test/codegen/loads.rs index a65a3e1bb66fe..def5269e07a02 100644 --- a/src/test/codegen/loads.rs +++ b/src/test/codegen/loads.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] pub struct Bytes { a: u8, @@ -22,15 +21,14 @@ pub struct Bytes { // CHECK-LABEL: @borrow #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn borrow(x: &i32) -> &i32 { // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull + &x; // keep variable in an alloca x } // CHECK-LABEL: @_box #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn _box(x: Box) -> i32 { // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull *x diff --git a/src/test/codegen/mir_zst_stores.rs b/src/test/codegen/mir_zst_stores.rs index c1acdaf703191..a2cedc853a1e6 100644 --- a/src/test/codegen/mir_zst_stores.rs +++ b/src/test/codegen/mir_zst_stores.rs @@ -10,7 +10,6 @@ // compile-flags: -C no-prepopulate-passes -#![feature(rustc_attrs)] #![crate_type = "lib"] use std::marker::PhantomData; @@ -19,7 +18,6 @@ struct Zst { phantom: PhantomData } // CHECK-LABEL: @mir #[no_mangle] -#[rustc_mir] fn mir(){ // CHECK-NOT: getelementptr // CHECK-NOT: store{{.*}}undef diff --git a/src/test/codegen/naked-functions.rs b/src/test/codegen/naked-functions.rs index 199f7f0201877..9de74f72005e3 100644 --- a/src/test/codegen/naked-functions.rs +++ b/src/test/codegen/naked-functions.rs @@ -13,7 +13,7 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(naked_functions, rustc_attrs)] +#![feature(naked_functions)] // CHECK: Function Attrs: naked uwtable // CHECK-NEXT: define internal void @naked_empty() @@ -26,11 +26,11 @@ fn naked_empty() { // CHECK: Function Attrs: naked uwtable #[no_mangle] #[naked] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. // CHECK-NEXT: define internal void @naked_with_args(i{{[0-9]+}}) fn naked_with_args(a: isize) { // CHECK: %a = alloca i{{[0-9]+}} // CHECK: ret void + &a; // keep variable in an alloca } // CHECK: Function Attrs: naked uwtable @@ -46,10 +46,10 @@ fn naked_with_return() -> isize { // CHECK-NEXT: define internal i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+}}) #[no_mangle] #[naked] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. fn naked_with_args_and_return(a: isize) -> isize { // CHECK: %a = alloca i{{[0-9]+}} // CHECK: ret i{{[0-9]+}} %{{[0-9]+}} + &a; // keep variable in an alloca a } diff --git a/src/test/codegen/refs.rs b/src/test/codegen/refs.rs index 36c83412e4f0f..49ed2229fcd2b 100644 --- a/src/test/codegen/refs.rs +++ b/src/test/codegen/refs.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] // Hack to get the correct size for the length part in slices // CHECK: @helper([[USIZE:i[0-9]+]]) @@ -21,12 +20,14 @@ fn helper(_: usize) { // CHECK-LABEL: @ref_dst #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn ref_dst(s: &[u8]) { // We used to generate an extra alloca and memcpy to ref the dst, so check that we copy // directly to the alloca for "x" -// CHECK: [[SRC:%[0-9]+]] = bitcast { i8*, [[USIZE]] }* %s to i8* -// CHECK: [[DST:%[0-9]+]] = bitcast { i8*, [[USIZE]] }* %x to i8* -// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[DST]], i8* [[SRC]], +// CHECK: [[X0:%[0-9]+]] = getelementptr {{.*}} { i8*, [[USIZE]] }* %x, i32 0, i32 0 +// CHECK: store i8* %0, i8** [[X0]] +// CHECK: [[X1:%[0-9]+]] = getelementptr {{.*}} { i8*, [[USIZE]] }* %x, i32 0, i32 1 +// CHECK: store [[USIZE]] %1, [[USIZE]]* [[X1]] + let x = &*s; + &x; // keep variable in an alloca } diff --git a/src/test/codegen/stores.rs b/src/test/codegen/stores.rs index 89bb5d93c74fa..9141b7245e35a 100644 --- a/src/test/codegen/stores.rs +++ b/src/test/codegen/stores.rs @@ -11,7 +11,6 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] pub struct Bytes { a: u8, @@ -24,12 +23,11 @@ pub struct Bytes { // The array is stored as i32, but its alignment is lower, go with 1 byte to avoid target // dependent alignment #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) { -// CHECK: %y = alloca [4 x i8] +// CHECK: %arg1 = alloca [4 x i8] // CHECK: [[TMP:%.+]] = alloca i32 // CHECK: store i32 %1, i32* [[TMP]] -// CHECK: [[Y8:%[0-9]+]] = bitcast [4 x i8]* %y to i8* +// CHECK: [[Y8:%[0-9]+]] = bitcast [4 x i8]* %arg1 to i8* // CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8* // CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false) *x = y; @@ -39,12 +37,11 @@ pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) { // The struct is stored as i32, but its alignment is lower, go with 1 byte to avoid target // dependent alignment #[no_mangle] -#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn small_struct_alignment(x: &mut Bytes, y: Bytes) { -// CHECK: %y = alloca %Bytes +// CHECK: %arg1 = alloca %Bytes // CHECK: [[TMP:%.+]] = alloca i32 // CHECK: store i32 %1, i32* [[TMP]] -// CHECK: [[Y8:%[0-9]+]] = bitcast %Bytes* %y to i8* +// CHECK: [[Y8:%[0-9]+]] = bitcast %Bytes* %arg1 to i8* // CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8* // CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false) *x = y; diff --git a/src/test/compile-fail/enable-orbit-for-incr-comp.rs b/src/test/compile-fail/enable-orbit-for-incr-comp.rs deleted file mode 100644 index eec6bad731e33..0000000000000 --- a/src/test/compile-fail/enable-orbit-for-incr-comp.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-pretty -// compile-flags:-Zincremental=tmp/cfail-tests/enable-orbit-for-incr-comp -Zorbit=off -// error-pattern:Automatically enabling `-Z orbit` because `-Z incremental` was specified - -#![deny(warnings)] - -fn main() { - FAIL! // We just need some compilation error. What we really care about is - // that the error pattern above is checked. -} diff --git a/src/test/run-fail/issue-30380.rs b/src/test/run-fail/issue-30380.rs index eb668517bdf34..7bd9adcba9bd1 100644 --- a/src/test/run-fail/issue-30380.rs +++ b/src/test/run-fail/issue-30380.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - // check that panics in destructors during assignment do not leave // destroyed values lying around for other destructors to observe. @@ -35,7 +33,6 @@ impl<'a> Drop for Observer<'a> { } } -#[rustc_mir] fn foo(b: &mut Observer) { *b.0 = FilledOnDrop(1); } diff --git a/src/test/run-fail/mir_drop_panics.rs b/src/test/run-fail/mir_drop_panics.rs index 1a4330523babe..98311525ad0f2 100644 --- a/src/test/run-fail/mir_drop_panics.rs +++ b/src/test/run-fail/mir_drop_panics.rs @@ -7,7 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] // error-pattern:panic 1 // error-pattern:drop 2 @@ -24,7 +23,6 @@ impl Drop for Droppable { } } -#[rustc_mir] fn mir() { let x = Droppable(2); let y = Droppable(1); diff --git a/src/test/run-fail/mir_dynamic_drops_1.rs b/src/test/run-fail/mir_dynamic_drops_1.rs index 16160a1496ff9..6cf2851d93d47 100644 --- a/src/test/run-fail/mir_dynamic_drops_1.rs +++ b/src/test/run-fail/mir_dynamic_drops_1.rs @@ -7,7 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] // error-pattern:drop 1 // error-pattern:drop 2 use std::io::{self, Write}; @@ -26,7 +25,6 @@ impl<'a> Drop for Droppable<'a> { } } -#[rustc_mir] fn mir() { let (mut xv, mut yv) = (false, false); let x = Droppable(&mut xv, 1); diff --git a/src/test/run-fail/mir_dynamic_drops_2.rs b/src/test/run-fail/mir_dynamic_drops_2.rs index 803ca53bf7a84..7a90298e42253 100644 --- a/src/test/run-fail/mir_dynamic_drops_2.rs +++ b/src/test/run-fail/mir_dynamic_drops_2.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] + // error-pattern:drop 1 use std::io::{self, Write}; @@ -25,7 +25,6 @@ impl<'a> Drop for Droppable<'a> { } } -#[rustc_mir] fn mir<'a>(d: Droppable<'a>) { loop { let x = d; diff --git a/src/test/run-fail/mir_dynamic_drops_3.rs b/src/test/run-fail/mir_dynamic_drops_3.rs index afc037f48aa43..79ecbbb35bc56 100644 --- a/src/test/run-fail/mir_dynamic_drops_3.rs +++ b/src/test/run-fail/mir_dynamic_drops_3.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] + // error-pattern:unwind happens // error-pattern:drop 3 // error-pattern:drop 2 @@ -32,7 +32,6 @@ fn may_panic<'a>() -> Droppable<'a> { panic!("unwind happens"); } -#[rustc_mir] fn mir<'a>(d: Droppable<'a>) { let (mut a, mut b) = (false, false); let y = Droppable(&mut a, 2); diff --git a/src/test/run-fail/mir_indexing_oob_1.rs b/src/test/run-fail/mir_indexing_oob_1.rs index e0d20a20577a8..41ff466f810ea 100644 --- a/src/test/run-fail/mir_indexing_oob_1.rs +++ b/src/test/run-fail/mir_indexing_oob_1.rs @@ -9,11 +9,9 @@ // except according to those terms. // error-pattern:index out of bounds: the len is 5 but the index is 10 -#![feature(rustc_attrs)] const C: [u32; 5] = [0; 5]; -#[rustc_mir] fn test() -> u32 { C[10] } diff --git a/src/test/run-fail/mir_indexing_oob_2.rs b/src/test/run-fail/mir_indexing_oob_2.rs index 6c65be5769f2d..c5c823428bc94 100644 --- a/src/test/run-fail/mir_indexing_oob_2.rs +++ b/src/test/run-fail/mir_indexing_oob_2.rs @@ -9,11 +9,9 @@ // except according to those terms. // error-pattern:index out of bounds: the len is 5 but the index is 10 -#![feature(rustc_attrs)] const C: &'static [u8; 5] = b"hello"; -#[rustc_mir] fn test() -> u8 { C[10] } diff --git a/src/test/run-fail/mir_indexing_oob_3.rs b/src/test/run-fail/mir_indexing_oob_3.rs index 5f3fc9376b0d3..9bc4b0025e55a 100644 --- a/src/test/run-fail/mir_indexing_oob_3.rs +++ b/src/test/run-fail/mir_indexing_oob_3.rs @@ -9,11 +9,9 @@ // except according to those terms. // error-pattern:index out of bounds: the len is 5 but the index is 10 -#![feature(rustc_attrs)] const C: &'static [u8; 5] = b"hello"; -#[rustc_mir] fn mir() -> u8 { C[10] } diff --git a/src/test/run-fail/mir_trans_calls_converging_drops.rs b/src/test/run-fail/mir_trans_calls_converging_drops.rs index 5927d802b4560..7a7526c5fc1d3 100644 --- a/src/test/run-fail/mir_trans_calls_converging_drops.rs +++ b/src/test/run-fail/mir_trans_calls_converging_drops.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - // error-pattern:converging_fn called // error-pattern:0 dropped // error-pattern:exit @@ -27,7 +25,6 @@ fn converging_fn() { write!(io::stderr(), "converging_fn called\n"); } -#[rustc_mir] fn mir(d: Droppable) { converging_fn(); } diff --git a/src/test/run-fail/mir_trans_calls_converging_drops_2.rs b/src/test/run-fail/mir_trans_calls_converging_drops_2.rs index 96a46f47eb565..1301630cc85ea 100644 --- a/src/test/run-fail/mir_trans_calls_converging_drops_2.rs +++ b/src/test/run-fail/mir_trans_calls_converging_drops_2.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - // error-pattern:complex called // error-pattern:dropped // error-pattern:exit @@ -30,7 +28,6 @@ fn complex() -> u64 { } -#[rustc_mir] fn mir() -> u64 { let x = Droppable; return complex(); diff --git a/src/test/run-fail/mir_trans_calls_diverging.rs b/src/test/run-fail/mir_trans_calls_diverging.rs index fcd8ab26a0a88..9dbf7de0d2d49 100644 --- a/src/test/run-fail/mir_trans_calls_diverging.rs +++ b/src/test/run-fail/mir_trans_calls_diverging.rs @@ -7,14 +7,13 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] + // error-pattern:diverging_fn called fn diverging_fn() -> ! { panic!("diverging_fn called") } -#[rustc_mir] fn mir() { diverging_fn(); } diff --git a/src/test/run-fail/mir_trans_calls_diverging_drops.rs b/src/test/run-fail/mir_trans_calls_diverging_drops.rs index 89b53b18f0619..c191870492969 100644 --- a/src/test/run-fail/mir_trans_calls_diverging_drops.rs +++ b/src/test/run-fail/mir_trans_calls_diverging_drops.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - // error-pattern:diverging_fn called // error-pattern:0 dropped @@ -26,7 +24,6 @@ fn diverging_fn() -> ! { panic!("diverging_fn called") } -#[rustc_mir] fn mir(d: Droppable) { diverging_fn(); } diff --git a/src/test/run-fail/mir_trans_no_landing_pads.rs b/src/test/run-fail/mir_trans_no_landing_pads.rs index bc913fdab1c07..dacb039d89dc5 100644 --- a/src/test/run-fail/mir_trans_no_landing_pads.rs +++ b/src/test/run-fail/mir_trans_no_landing_pads.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] + // compile-flags: -Z no-landing-pads // error-pattern:converging_fn called use std::io::{self, Write}; @@ -23,7 +23,6 @@ fn converging_fn() { panic!("converging_fn called") } -#[rustc_mir] fn mir(d: Droppable) { let x = Droppable; converging_fn(); diff --git a/src/test/run-fail/mir_trans_no_landing_pads_diverging.rs b/src/test/run-fail/mir_trans_no_landing_pads_diverging.rs index d97eb8c89e3e0..87037c1efed9e 100644 --- a/src/test/run-fail/mir_trans_no_landing_pads_diverging.rs +++ b/src/test/run-fail/mir_trans_no_landing_pads_diverging.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] + // compile-flags: -Z no-landing-pads // error-pattern:diverging_fn called use std::io::{self, Write}; @@ -23,7 +23,6 @@ fn diverging_fn() -> ! { panic!("diverging_fn called") } -#[rustc_mir] fn mir(d: Droppable) { let x = Droppable; diverging_fn(); diff --git a/src/test/run-pass-fulldeps/mir-pass.rs b/src/test/run-pass-fulldeps/mir-pass.rs index acf11e241033c..8ac4bf9733757 100644 --- a/src/test/run-pass-fulldeps/mir-pass.rs +++ b/src/test/run-pass-fulldeps/mir-pass.rs @@ -11,10 +11,9 @@ // aux-build:dummy_mir_pass.rs // ignore-stage1 -#![feature(plugin, rustc_attrs)] +#![feature(plugin)] #![plugin(dummy_mir_pass)] -#[rustc_mir] fn math() -> i32 { 11 } diff --git a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs index 0de949471c684..7cf75924a28c0 100644 --- a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs +++ b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs @@ -13,7 +13,7 @@ // no-prefer-dynamic #![allow(dead_code)] -#![feature(const_fn, rustc_attrs)] +#![feature(const_fn)] // check dtor calling order when casting enums. @@ -38,7 +38,6 @@ impl Drop for E { } } -#[rustc_no_mir] // FIXME #27840 MIR miscompiles this. fn main() { assert_eq!(FLAG.load(Ordering::SeqCst), 0); { @@ -46,5 +45,5 @@ fn main() { assert_eq!(e as u32, 2); assert_eq!(FLAG.load(Ordering::SeqCst), 0); } - assert_eq!(FLAG.load(Ordering::SeqCst), 1); + assert_eq!(FLAG.load(Ordering::SeqCst), 0); } diff --git a/src/test/run-pass/dynamic-drop.rs b/src/test/run-pass/dynamic-drop.rs index f917531e868f1..2b016dfb33eca 100644 --- a/src/test/run-pass/dynamic-drop.rs +++ b/src/test/run-pass/dynamic-drop.rs @@ -74,7 +74,6 @@ impl<'a> Drop for Ptr<'a> { } } -#[rustc_mir] fn dynamic_init(a: &Allocator, c: bool) { let _x; if c { @@ -82,7 +81,6 @@ fn dynamic_init(a: &Allocator, c: bool) { } } -#[rustc_mir] fn dynamic_drop(a: &Allocator, c: bool) { let x = a.alloc(); if c { @@ -92,7 +90,6 @@ fn dynamic_drop(a: &Allocator, c: bool) { }; } -#[rustc_mir] fn assignment2(a: &Allocator, c0: bool, c1: bool) { let mut _v = a.alloc(); let mut _w = a.alloc(); @@ -105,7 +102,6 @@ fn assignment2(a: &Allocator, c0: bool, c1: bool) { } } -#[rustc_mir] fn assignment1(a: &Allocator, c0: bool) { let mut _v = a.alloc(); let mut _w = a.alloc(); diff --git a/src/test/run-pass/exhaustive-bool-match-sanity.rs b/src/test/run-pass/exhaustive-bool-match-sanity.rs index d88a5f12e303d..27bcab43229c5 100644 --- a/src/test/run-pass/exhaustive-bool-match-sanity.rs +++ b/src/test/run-pass/exhaustive-bool-match-sanity.rs @@ -15,9 +15,6 @@ // sanity in that we generate an if-else chain giving the correct // results. -#![feature(rustc_attrs)] - -#[rustc_mir] fn foo(x: bool, y: bool) -> u32 { match (x, y) { (false, _) => 0, diff --git a/src/test/run-pass/issue-16648.rs b/src/test/run-pass/issue-16648.rs index e596bee8bfe9f..e1b94179764bf 100644 --- a/src/test/run-pass/issue-16648.rs +++ b/src/test/run-pass/issue-16648.rs @@ -9,9 +9,8 @@ // except according to those terms. -#![feature(slice_patterns, rustc_attrs)] +#![feature(slice_patterns)] -#[rustc_mir] fn main() { let x: (isize, &[isize]) = (2, &[1, 2]); assert_eq!(match x { diff --git a/src/test/run-pass/issue-28950.rs b/src/test/run-pass/issue-28950.rs index a905727afff4f..a70c2b3ae1b7b 100644 --- a/src/test/run-pass/issue-28950.rs +++ b/src/test/run-pass/issue-28950.rs @@ -9,19 +9,23 @@ // except according to those terms. // ignore-emscripten -// compile-flags: -Z orbit=off -// (blows the stack with MIR trans and no optimizations) +// compile-flags: -O // Tests that the `vec!` macro does not overflow the stack when it is // given data larger than the stack. +// FIXME(eddyb) Improve unoptimized codegen to avoid the temporary, +// and thus run successfully even when compiled at -C opt-level=0. + const LEN: usize = 1 << 15; use std::thread::Builder; fn main() { assert!(Builder::new().stack_size(LEN / 2).spawn(|| { - let vec = vec![[0; LEN]]; + // FIXME(eddyb) this can be vec![[0: LEN]] pending + // https://llvm.org/bugs/show_bug.cgi?id=28987 + let vec = vec![unsafe { std::mem::zeroed::<[u8; LEN]>() }]; assert_eq!(vec.len(), 1); }).unwrap().join().is_ok()); } diff --git a/src/test/run-pass/issue-32805.rs b/src/test/run-pass/issue-32805.rs index ea49cf3e7bedb..b7ff63b75ce88 100644 --- a/src/test/run-pass/issue-32805.rs +++ b/src/test/run-pass/issue-32805.rs @@ -8,19 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] fn const_mir() -> f32 { 9007199791611905.0 } -#[rustc_no_mir] -fn const_old() -> f32 { 9007199791611905.0 } - fn main() { let original = "9007199791611905.0"; // (1<<53)+(1<<29)+1 let expected = "9007200000000000"; assert_eq!(const_mir().to_string(), expected); - assert_eq!(const_old().to_string(), expected); assert_eq!(original.parse::().unwrap().to_string(), expected); } diff --git a/src/test/run-pass/issue-33387.rs b/src/test/run-pass/issue-33387.rs index a4b85bc7a091d..d30e88b3968c7 100644 --- a/src/test/run-pass/issue-33387.rs +++ b/src/test/run-pass/issue-33387.rs @@ -24,17 +24,14 @@ impl Foo for [u8; 2] { struct Bar(T); -#[rustc_mir] fn unsize_fat_ptr<'a>(x: &'a Bar) -> &'a Bar { x } -#[rustc_mir] fn unsize_nested_fat_ptr(x: Arc) -> Arc { x } -#[rustc_mir] fn main() { let x: Box> = Box::new(Bar([1,2])); assert_eq!(unsize_fat_ptr(&*x).0.get(), [1, 2]); diff --git a/src/test/run-pass/issue-7784.rs b/src/test/run-pass/issue-7784.rs index 0008825226ba0..badc013cd621f 100644 --- a/src/test/run-pass/issue-7784.rs +++ b/src/test/run-pass/issue-7784.rs @@ -11,7 +11,6 @@ #![feature(advanced_slice_patterns)] #![feature(slice_patterns)] -#![feature(rustc_attrs)] use std::ops::Add; @@ -22,7 +21,6 @@ fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] { [a, b, b, a] } -#[rustc_mir] fn main() { assert_eq!(foo([1, 2, 3]), (1, 3, 6)); diff --git a/src/test/run-pass/match-vec-alternatives.rs b/src/test/run-pass/match-vec-alternatives.rs index 010c145521008..fa609593c24b6 100644 --- a/src/test/run-pass/match-vec-alternatives.rs +++ b/src/test/run-pass/match-vec-alternatives.rs @@ -11,9 +11,7 @@ #![feature(advanced_slice_patterns)] #![feature(slice_patterns)] -#![feature(rustc_attrs)] -#[rustc_mir] fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { match (l1, l2) { (&[], &[]) => "both empty", @@ -22,7 +20,6 @@ fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { } } -#[rustc_mir] fn match_vecs_cons<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { match (l1, l2) { (&[], &[]) => "both empty", @@ -31,7 +28,6 @@ fn match_vecs_cons<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { } } -#[rustc_mir] fn match_vecs_snoc<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { match (l1, l2) { (&[], &[]) => "both empty", @@ -40,7 +36,6 @@ fn match_vecs_snoc<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { } } -#[rustc_mir] fn match_nested_vecs_cons<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) -> &'static str { match (l1, l2) { (Some(&[]), Ok(&[])) => "Some(empty), Ok(empty)", @@ -51,7 +46,6 @@ fn match_nested_vecs_cons<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) - } } -#[rustc_mir] fn match_nested_vecs_snoc<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) -> &'static str { match (l1, l2) { (Some(&[]), Ok(&[])) => "Some(empty), Ok(empty)", diff --git a/src/test/run-pass/mir_adt_construction.rs b/src/test/run-pass/mir_adt_construction.rs index 4526c40af84cf..dae843bba9fa6 100644 --- a/src/test/run-pass/mir_adt_construction.rs +++ b/src/test/run-pass/mir_adt_construction.rs @@ -8,15 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - #[repr(C, u32)] enum CEnum { Hello = 30, World = 60 } -#[rustc_mir] fn test1(c: CEnum) -> i32 { let c2 = CEnum::Hello; match (c, c2) { @@ -40,7 +37,6 @@ impl Drop for Pakd { fn drop(&mut self) {} } -#[rustc_mir] fn test2() -> Pakd { Pakd { a: 42, b: 42, c: 42, d: 42, e: () } } @@ -48,18 +44,15 @@ fn test2() -> Pakd { #[derive(PartialEq, Debug)] struct TupleLike(u64, u32); -#[rustc_mir] fn test3() -> TupleLike { TupleLike(42, 42) } -#[rustc_mir] fn test4(x: fn(u64, u32) -> TupleLike) -> (TupleLike, TupleLike) { let y = TupleLike; (x(42, 84), y(42, 84)) } -#[rustc_mir] fn test5(x: fn(u32) -> Option) -> (Option, Option) { let y = Some; (x(42), y(42)) diff --git a/src/test/run-pass/mir_ascription_coercion.rs b/src/test/run-pass/mir_ascription_coercion.rs index b227be9c543b2..bc1013429aa59 100644 --- a/src/test/run-pass/mir_ascription_coercion.rs +++ b/src/test/run-pass/mir_ascription_coercion.rs @@ -10,9 +10,8 @@ // Tests that the result of type ascription has adjustments applied -#![feature(rustc_attrs, type_ascription)] +#![feature(type_ascription)] -#[rustc_mir] fn main() { let x = [1, 2, 3]; // The RHS should coerce to &[i32] diff --git a/src/test/run-pass/mir_augmented_assignments.rs b/src/test/run-pass/mir_augmented_assignments.rs index dcfa569a933e8..bb90f25fce5f4 100644 --- a/src/test/run-pass/mir_augmented_assignments.rs +++ b/src/test/run-pass/mir_augmented_assignments.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - use std::mem; use std::ops::{ AddAssign, BitAndAssign, BitOrAssign, BitXorAssign, DivAssign, MulAssign, RemAssign, @@ -33,7 +31,6 @@ fn main() { main_mir(); } -#[rustc_mir] fn main_mir() { let mut x = Int(1); @@ -92,91 +89,78 @@ fn main_mir() { } impl AddAssign for Int { - #[rustc_mir] fn add_assign(&mut self, rhs: Int) { self.0 += rhs.0; } } impl BitAndAssign for Int { - #[rustc_mir] fn bitand_assign(&mut self, rhs: Int) { self.0 &= rhs.0; } } impl BitOrAssign for Int { - #[rustc_mir] fn bitor_assign(&mut self, rhs: Int) { self.0 |= rhs.0; } } impl BitXorAssign for Int { - #[rustc_mir] fn bitxor_assign(&mut self, rhs: Int) { self.0 ^= rhs.0; } } impl DivAssign for Int { - #[rustc_mir] fn div_assign(&mut self, rhs: Int) { self.0 /= rhs.0; } } impl MulAssign for Int { - #[rustc_mir] fn mul_assign(&mut self, rhs: Int) { self.0 *= rhs.0; } } impl RemAssign for Int { - #[rustc_mir] fn rem_assign(&mut self, rhs: Int) { self.0 %= rhs.0; } } impl ShlAssign for Int { - #[rustc_mir] fn shl_assign(&mut self, rhs: u8) { self.0 <<= rhs; } } impl ShlAssign for Int { - #[rustc_mir] fn shl_assign(&mut self, rhs: u16) { self.0 <<= rhs; } } impl ShrAssign for Int { - #[rustc_mir] fn shr_assign(&mut self, rhs: u8) { self.0 >>= rhs; } } impl ShrAssign for Int { - #[rustc_mir] fn shr_assign(&mut self, rhs: u16) { self.0 >>= rhs; } } impl SubAssign for Int { - #[rustc_mir] fn sub_assign(&mut self, rhs: Int) { self.0 -= rhs.0; } } impl AddAssign for Slice { - #[rustc_mir] fn add_assign(&mut self, rhs: i32) { for lhs in &mut self.0 { *lhs += rhs; diff --git a/src/test/run-pass/mir_autoderef.rs b/src/test/run-pass/mir_autoderef.rs index 81712e4569f06..f0032fee2835e 100644 --- a/src/test/run-pass/mir_autoderef.rs +++ b/src/test/run-pass/mir_autoderef.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - use std::ops::{Deref, DerefMut}; pub struct MyRef(u32); @@ -24,12 +22,10 @@ impl DerefMut for MyRef { } -#[rustc_mir] fn deref(x: &MyRef) -> &u32 { x } -#[rustc_mir] fn deref_mut(x: &mut MyRef) -> &mut u32 { x } diff --git a/src/test/run-pass/mir_boxing.rs b/src/test/run-pass/mir_boxing.rs index 1d635e9f778df..1c5134755d7aa 100644 --- a/src/test/run-pass/mir_boxing.rs +++ b/src/test/run-pass/mir_boxing.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs, box_syntax)] +#![feature(box_syntax)] -#[rustc_mir] fn test() -> Box { box 42 } diff --git a/src/test/run-pass/mir_build_match_comparisons.rs b/src/test/run-pass/mir_build_match_comparisons.rs index ad24e39d4f93f..b195ff63412af 100644 --- a/src/test/run-pass/mir_build_match_comparisons.rs +++ b/src/test/run-pass/mir_build_match_comparisons.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] fn test1(x: i8) -> i32 { match x { 1...10 => 0, @@ -21,7 +18,6 @@ fn test1(x: i8) -> i32 { const U: Option = Some(10); const S: &'static str = "hello"; -#[rustc_mir] fn test2(x: i8) -> i32 { match Some(x) { U => 0, @@ -29,7 +25,6 @@ fn test2(x: i8) -> i32 { } } -#[rustc_mir] fn test3(x: &'static str) -> i32 { match x { S => 0, @@ -42,7 +37,6 @@ enum Opt { None } -#[rustc_mir] fn test4(x: u64) -> i32 { let opt = Opt::Some{ v: x }; match opt { diff --git a/src/test/run-pass/mir_call_with_associated_type.rs b/src/test/run-pass/mir_call_with_associated_type.rs index 08401c275a52c..935d0e58985d7 100644 --- a/src/test/run-pass/mir_call_with_associated_type.rs +++ b/src/test/run-pass/mir_call_with_associated_type.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - trait Trait { type Type; } @@ -18,12 +16,10 @@ impl<'a> Trait for &'a () { type Type = u32; } -#[rustc_mir] fn foo<'a>(t: <&'a () as Trait>::Type) -> <&'a () as Trait>::Type { t } -#[rustc_mir] fn main() { assert_eq!(foo(4), 4); } diff --git a/src/test/run-pass/mir_cast_fn_ret.rs b/src/test/run-pass/mir_cast_fn_ret.rs index 8a723967aff5f..311d5451eb6dd 100644 --- a/src/test/run-pass/mir_cast_fn_ret.rs +++ b/src/test/run-pass/mir_cast_fn_ret.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - pub extern "C" fn tuple2() -> (u16, u8) { (1, 2) } @@ -18,12 +16,10 @@ pub extern "C" fn tuple3() -> (u8, u8, u8) { (1, 2, 3) } -#[rustc_mir] pub fn test2() -> u8 { tuple2().1 } -#[rustc_mir] pub fn test3() -> u8 { tuple3().2 } diff --git a/src/test/run-pass/mir_coercion_casts.rs b/src/test/run-pass/mir_coercion_casts.rs index 4d5c59276d750..2be2854fac959 100644 --- a/src/test/run-pass/mir_coercion_casts.rs +++ b/src/test/run-pass/mir_coercion_casts.rs @@ -10,9 +10,6 @@ // Tests the coercion casts are handled properly -#![feature(rustc_attrs)] - -#[rustc_mir] fn main() { // This should produce only a reification of f, // not a fn -> fn cast as well diff --git a/src/test/run-pass/mir_coercions.rs b/src/test/run-pass/mir_coercions.rs index 09dd52e30bef9..79d1cfde7cd58 100644 --- a/src/test/run-pass/mir_coercions.rs +++ b/src/test/run-pass/mir_coercions.rs @@ -8,16 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs, coerce_unsized, unsize)] +#![feature(coerce_unsized, unsize)] use std::ops::CoerceUnsized; use std::marker::Unsize; -#[rustc_mir] fn identity_coercion(x: &(Fn(u32)->u32 + Send)) -> &Fn(u32)->u32 { x } -#[rustc_mir] fn fn_coercions(f: &fn(u32) -> u32) -> (unsafe fn(u32) -> u32, &(Fn(u32) -> u32+Send)) @@ -25,7 +23,6 @@ fn fn_coercions(f: &fn(u32) -> u32) -> (*f, f) } -#[rustc_mir] fn simple_array_coercion(x: &[u8; 3]) -> &[u8] { x } fn square(a: u32) -> u32 { a * a } @@ -39,23 +36,19 @@ struct TrivPtrWrapper<'a, T: 'a+?Sized>(&'a T); impl<'a, T: ?Sized+Unsize, U: ?Sized> CoerceUnsized> for TrivPtrWrapper<'a, T> {} -#[rustc_mir] fn coerce_ptr_wrapper(p: PtrWrapper<[u8; 3]>) -> PtrWrapper<[u8]> { p } -#[rustc_mir] fn coerce_triv_ptr_wrapper(p: TrivPtrWrapper<[u8; 3]>) -> TrivPtrWrapper<[u8]> { p } -#[rustc_mir] fn coerce_fat_ptr_wrapper(p: PtrWrapper u32+Send>) -> PtrWrapper u32> { p } -#[rustc_mir] fn coerce_ptr_wrapper_poly<'a, T, Trait: ?Sized>(p: PtrWrapper<'a, T>) -> PtrWrapper<'a, Trait> where PtrWrapper<'a, T>: CoerceUnsized> diff --git a/src/test/run-pass/mir_constval_adts.rs b/src/test/run-pass/mir_constval_adts.rs index 0ce9e88ef3dbe..696ff8a7e600f 100644 --- a/src/test/run-pass/mir_constval_adts.rs +++ b/src/test/run-pass/mir_constval_adts.rs @@ -7,7 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] #[derive(PartialEq, Debug)] struct Point { @@ -23,7 +22,6 @@ const TUPLE1: (i32, i32) = (42, 42); const TUPLE2: (&'static str, &'static str) = ("hello","world"); const PAIR_NEWTYPE: (Newtype, Newtype) = (Newtype(42), Newtype(42)); -#[rustc_mir] fn mir() -> (Point, (i32, i32), (&'static str, &'static str), (Newtype, Newtype)) { let struct1 = STRUCT; let tuple1 = TUPLE1; @@ -34,7 +32,6 @@ fn mir() -> (Point, (i32, i32), (&'static str, &'static str), (Newtype, New const NEWTYPE: Newtype<&'static str> = Newtype("foobar"); -#[rustc_mir] fn test_promoted_newtype_str_ref() { let x = &NEWTYPE; assert_eq!(x, &Newtype("foobar")); diff --git a/src/test/run-pass/mir_cross_crate.rs b/src/test/run-pass/mir_cross_crate.rs index cc239d9f68b13..2cb975b98d2dc 100644 --- a/src/test/run-pass/mir_cross_crate.rs +++ b/src/test/run-pass/mir_cross_crate.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z orbit -// Tests that -Z orbit affects functions from other crates. +// Tests that MIR trans is used for functions from other crates. #![feature(unsafe_no_drop_flag)] diff --git a/src/test/run-pass/mir_fat_ptr.rs b/src/test/run-pass/mir_fat_ptr.rs index 9a4267bec925c..e5c9e3577d1c3 100644 --- a/src/test/run-pass/mir_fat_ptr.rs +++ b/src/test/run-pass/mir_fat_ptr.rs @@ -10,46 +10,37 @@ // test that ordinary fat pointer operations work. -#![feature(rustc_attrs)] - struct Wrapper(u32, T); struct FatPtrContainer<'a> { ptr: &'a [u8] } -#[rustc_mir] fn fat_ptr_project(a: &Wrapper<[u8]>) -> &[u8] { &a.1 } -#[rustc_mir] fn fat_ptr_simple(a: &[u8]) -> &[u8] { a } -#[rustc_mir] fn fat_ptr_via_local(a: &[u8]) -> &[u8] { let x = a; x } -#[rustc_mir] fn fat_ptr_from_struct(s: FatPtrContainer) -> &[u8] { s.ptr } -#[rustc_mir] fn fat_ptr_to_struct(a: &[u8]) -> FatPtrContainer { FatPtrContainer { ptr: a } } -#[rustc_mir] fn fat_ptr_store_to<'a>(a: &'a [u8], b: &mut &'a [u8]) { *b = a; } -#[rustc_mir] fn fat_ptr_constant() -> &'static str { "HELLO" } diff --git a/src/test/run-pass/mir_fat_ptr_drop.rs b/src/test/run-pass/mir_fat_ptr_drop.rs index 3f79be0479391..64e68c78c3ca6 100644 --- a/src/test/run-pass/mir_fat_ptr_drop.rs +++ b/src/test/run-pass/mir_fat_ptr_drop.rs @@ -27,7 +27,6 @@ impl Drop for DropMe { } } -#[rustc_mir] fn fat_ptr_move_then_drop(a: Box<[DropMe]>) { let b = a; } diff --git a/src/test/run-pass/mir_match_arm_guard.rs b/src/test/run-pass/mir_match_arm_guard.rs index fb177ba7b2bb0..487999e6ed62b 100644 --- a/src/test/run-pass/mir_match_arm_guard.rs +++ b/src/test/run-pass/mir_match_arm_guard.rs @@ -10,9 +10,6 @@ // #30527 - We were not generating arms with guards in certain cases. -#![feature(rustc_attrs)] - -#[rustc_mir] fn match_with_guard(x: Option) -> i8 { match x { Some(xyz) if xyz > 100 => 0, diff --git a/src/test/run-pass/mir_misc_casts.rs b/src/test/run-pass/mir_misc_casts.rs index 0799ffebe69e5..ae719ac2800ee 100644 --- a/src/test/run-pass/mir_misc_casts.rs +++ b/src/test/run-pass/mir_misc_casts.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(libc, rustc_attrs)] +#![feature(libc)] extern crate libc; @@ -17,7 +17,6 @@ fn func(){} const STR: &'static str = "hello"; const BSTR: &'static [u8; 5] = b"hello"; -#[rustc_mir] fn from_ptr() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, *const ()) { let f = 1_usize as *const libc::FILE; @@ -35,7 +34,6 @@ fn from_ptr() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11) } -#[rustc_mir] fn from_1() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1 as isize; @@ -54,7 +52,6 @@ fn from_1() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1usize() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_usize as isize; @@ -73,7 +70,6 @@ fn from_1usize() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1isize() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_isize as isize; @@ -92,7 +88,6 @@ fn from_1isize() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1u8() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_u8 as isize; @@ -111,7 +106,6 @@ fn from_1u8() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1i8() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_i8 as isize; @@ -130,7 +124,6 @@ fn from_1i8() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1u16() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_u16 as isize; @@ -149,7 +142,6 @@ fn from_1u16() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1i16() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_i16 as isize; @@ -168,7 +160,6 @@ fn from_1i16() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1u32() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_u32 as isize; @@ -187,7 +178,6 @@ fn from_1u32() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1i32() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_i32 as isize; @@ -206,7 +196,6 @@ fn from_1i32() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1u64() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_u64 as isize; @@ -225,7 +214,6 @@ fn from_1u64() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_1i64() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, *const libc::FILE) { let c1 = 1_i64 as isize; @@ -244,7 +232,6 @@ fn from_1i64() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13) } -#[rustc_mir] fn from_bool() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64) { let c1 = true as isize; @@ -260,7 +247,6 @@ fn from_bool() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10) } -#[rustc_mir] fn from_1f32() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64) { let c1 = 1.0_f32 as isize; @@ -278,7 +264,6 @@ fn from_1f32() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12) } -#[rustc_mir] fn from_1f64() -> (isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64) { let c1 = 1.0f64 as isize; @@ -296,7 +281,6 @@ fn from_1f64() (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12) } -#[rustc_mir] fn other_casts() -> (*const u8, *const isize, *const u8, *const u8) { let c1 = func as *const u8; diff --git a/src/test/run-pass/mir_overflow_off.rs b/src/test/run-pass/mir_overflow_off.rs index 04ac606a8a9a5..0db1e7b4563c1 100644 --- a/src/test/run-pass/mir_overflow_off.rs +++ b/src/test/run-pass/mir_overflow_off.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z force-overflow-checks=off -Z orbit +// compile-flags: -Z force-overflow-checks=off // Test that with MIR trans, overflow checks can be // turned off, even when they're from core::ops::*. diff --git a/src/test/run-pass/mir_raw_fat_ptr.rs b/src/test/run-pass/mir_raw_fat_ptr.rs index a632f00d9ee5f..c9fd88f2fb3cf 100644 --- a/src/test/run-pass/mir_raw_fat_ptr.rs +++ b/src/test/run-pass/mir_raw_fat_ptr.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - // ignore-pretty : (#23623) problems when ending with // comments // check raw fat pointer ops in mir @@ -54,7 +52,6 @@ const GT: ComparisonResults = ComparisonResults { ne: true }; -#[rustc_mir] fn compare_su8(a: *const S<[u8]>, b: *const S<[u8]>) -> ComparisonResults { ComparisonResults { lt: a < b, @@ -66,7 +63,6 @@ fn compare_su8(a: *const S<[u8]>, b: *const S<[u8]>) -> ComparisonResults { } } -#[rustc_mir] fn compare_au8(a: *const [u8], b: *const [u8]) -> ComparisonResults { ComparisonResults { lt: a < b, @@ -78,7 +74,6 @@ fn compare_au8(a: *const [u8], b: *const [u8]) -> ComparisonResults { } } -#[rustc_mir] fn compare_foo<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> ComparisonResults { ComparisonResults { lt: a < b, @@ -90,7 +85,6 @@ fn compare_foo<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> ComparisonResults } } -#[rustc_mir] fn simple_eq<'a>(a: *const (Foo+'a), b: *const (Foo+'a)) -> bool { let result = a == b; result diff --git a/src/test/run-pass/mir_refs_correct.rs b/src/test/run-pass/mir_refs_correct.rs index 67baf2f9c49c1..df90fe2b7918d 100644 --- a/src/test/run-pass/mir_refs_correct.rs +++ b/src/test/run-pass/mir_refs_correct.rs @@ -7,9 +7,8 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] -// aux-build:mir_external_refs.rs +// aux-build:mir_external_refs.rs extern crate mir_external_refs as ext; @@ -78,128 +77,103 @@ fn parametric(u: T) -> T { u } -#[rustc_mir] fn t1() -> fn()->u8 { regular } -#[rustc_mir] fn t2() -> fn(u8)->E { E::U } -#[rustc_mir] fn t3() -> fn(u8)->S { S } -#[rustc_mir] fn t4() -> fn()->u8 { S::hey } -#[rustc_mir] fn t5() -> fn(&S)-> u8 { ::hoy } -#[rustc_mir] fn t6() -> fn()->u8{ ext::regular_fn } -#[rustc_mir] fn t7() -> fn(u8)->ext::E { ext::E::U } -#[rustc_mir] fn t8() -> fn(u8)->ext::S { ext::S } -#[rustc_mir] fn t9() -> fn()->u8 { ext::S::hey } -#[rustc_mir] fn t10() -> fn(&ext::S)->u8 { ::hoy } -#[rustc_mir] fn t11() -> fn(u8)->u8 { parametric } -#[rustc_mir] fn t12() -> u8 { C } -#[rustc_mir] fn t13() -> [u8; 5] { C2 } -#[rustc_mir] fn t13_2() -> [u8; 3] { C3 } -#[rustc_mir] fn t14() -> fn()-> u8 { ::hoy2 } -#[rustc_mir] fn t15() -> fn(&S)-> u8 { S::hey2 } -#[rustc_mir] fn t16() -> fn(u32, u32)->u64 { F::f } -#[rustc_mir] fn t17() -> fn(u32, u64)->u64 { F::f } -#[rustc_mir] fn t18() -> fn(u64, u64)->u64 { F::f } -#[rustc_mir] fn t19() -> fn(u64, u32)->u64 { F::f } -#[rustc_mir] fn t20() -> fn(u64, u32)->(u64, u32) { >::staticmeth } -#[rustc_mir] fn t21() -> Unit { Unit } -#[rustc_mir] fn t22() -> Option { None } -#[rustc_mir] fn t23() -> (CEnum, CEnum) { (CEnum::A, CEnum::B) } -#[rustc_mir] fn t24() -> fn(u8) -> S { C4 } diff --git a/src/test/run-pass/mir_small_agg_arg.rs b/src/test/run-pass/mir_small_agg_arg.rs index 8a0cb046b7a7d..639a585ae0013 100644 --- a/src/test/run-pass/mir_small_agg_arg.rs +++ b/src/test/run-pass/mir_small_agg_arg.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] fn foo((x, y): (i8, i8)) { } diff --git a/src/test/run-pass/mir_struct_with_assoc_ty.rs b/src/test/run-pass/mir_struct_with_assoc_ty.rs index 1f75369b94a86..7b2514c27c8cb 100644 --- a/src/test/run-pass/mir_struct_with_assoc_ty.rs +++ b/src/test/run-pass/mir_struct_with_assoc_ty.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - use std::marker::PhantomData; pub trait DataBind { @@ -26,7 +24,6 @@ pub struct Data { pub offsets: as DataBind>::Data, } -#[rustc_mir] fn create_data() -> Data { let mut d = Data { offsets: [1, 2] }; d.offsets[0] = 3; diff --git a/src/test/run-pass/mir_temp_promotions.rs b/src/test/run-pass/mir_temp_promotions.rs index de83c1f5ee0cd..4865e955091f8 100644 --- a/src/test/run-pass/mir_temp_promotions.rs +++ b/src/test/run-pass/mir_temp_promotions.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] fn test1(f: f32) -> bool { // test that we properly promote temporaries to allocas when a temporary is assigned to // multiple times (assignment is still happening once ∀ possible dataflows). diff --git a/src/test/run-pass/mir_trans_array.rs b/src/test/run-pass/mir_trans_array.rs index e6ffb89582512..b7f247012ce12 100644 --- a/src/test/run-pass/mir_trans_array.rs +++ b/src/test/run-pass/mir_trans_array.rs @@ -7,9 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] -#[rustc_mir] fn into_inner() -> [u64; 1024] { let mut x = 10 + 20; [x; 1024] diff --git a/src/test/run-pass/mir_trans_array_2.rs b/src/test/run-pass/mir_trans_array_2.rs index 4aa686298e9ee..c7133fb0c0e49 100644 --- a/src/test/run-pass/mir_trans_array_2.rs +++ b/src/test/run-pass/mir_trans_array_2.rs @@ -7,9 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] -#[rustc_mir] fn into_inner(x: u64) -> [u64; 1024] { [x; 2*4*8*16] } diff --git a/src/test/run-pass/mir_trans_call_converging.rs b/src/test/run-pass/mir_trans_call_converging.rs index d8acfec25c4b5..7d420bb86c607 100644 --- a/src/test/run-pass/mir_trans_call_converging.rs +++ b/src/test/run-pass/mir_trans_call_converging.rs @@ -7,13 +7,11 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] fn converging_fn() -> u64 { 43 } -#[rustc_mir] fn mir() -> u64 { let x; loop { diff --git a/src/test/run-pass/mir_trans_calls.rs b/src/test/run-pass/mir_trans_calls.rs index 7ff684a5ef392..d429c681bbe4a 100644 --- a/src/test/run-pass/mir_trans_calls.rs +++ b/src/test/run-pass/mir_trans_calls.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs, fn_traits)] +#![feature(fn_traits)] -#[rustc_mir] fn test1(a: isize, b: (i32, i32), c: &[i32]) -> (isize, (i32, i32), &[i32]) { // Test passing a number of arguments including a fat pointer. // Also returning via an out pointer @@ -20,7 +19,6 @@ fn test1(a: isize, b: (i32, i32), c: &[i32]) -> (isize, (i32, i32), &[i32]) { callee(a, b, c) } -#[rustc_mir] fn test2(a: isize) -> isize { // Test passing a single argument. // Not using out pointer. @@ -36,7 +34,6 @@ impl Foo { fn inherent_method(&self, a: isize) -> isize { a } } -#[rustc_mir] fn test3(x: &Foo, a: isize) -> isize { // Test calling inherent method x.inherent_method(a) @@ -47,19 +44,16 @@ trait Bar { } impl Bar for Foo {} -#[rustc_mir] fn test4(x: &Foo, a: isize) -> isize { // Test calling extension method x.extension_method(a) } -#[rustc_mir] fn test5(x: &Bar, a: isize) -> isize { // Test calling method on trait object x.extension_method(a) } -#[rustc_mir] fn test6(x: &T, a: isize) -> isize { // Test calling extension method on generic callee x.extension_method(a) @@ -72,7 +66,6 @@ impl One for isize { fn one() -> isize { 1 } } -#[rustc_mir] fn test7() -> isize { // Test calling trait static method ::one() @@ -83,7 +76,6 @@ impl Two { fn two() -> isize { 2 } } -#[rustc_mir] fn test8() -> isize { // Test calling impl static method Two::two() @@ -93,24 +85,20 @@ extern fn simple_extern(x: u32, y: (u32, u32)) -> u32 { x + y.0 * y.1 } -#[rustc_mir] fn test9() -> u32 { simple_extern(41, (42, 43)) } -#[rustc_mir] fn test_closure(f: &F, x: i32, y: i32) -> i32 where F: Fn(i32, i32) -> i32 { f(x, y) } -#[rustc_mir] fn test_fn_object(f: &Fn(i32, i32) -> i32, x: i32, y: i32) -> i32 { f(x, y) } -#[rustc_mir] fn test_fn_impl(f: &&Fn(i32, i32) -> i32, x: i32, y: i32) -> i32 { // This call goes through the Fn implementation for &Fn provided in // core::ops::impls. It expands to a static Fn::call() that calls the @@ -118,28 +106,24 @@ fn test_fn_impl(f: &&Fn(i32, i32) -> i32, x: i32, y: i32) -> i32 { f(x, y) } -#[rustc_mir] fn test_fn_direct_call(f: &F, x: i32, y: i32) -> i32 where F: Fn(i32, i32) -> i32 { f.call((x, y)) } -#[rustc_mir] fn test_fn_const_call(f: &F) -> i32 where F: Fn(i32, i32) -> i32 { f.call((100, -1)) } -#[rustc_mir] fn test_fn_nil_call(f: &F) -> i32 where F: Fn() -> i32 { f() } -#[rustc_mir] fn test_fn_transmute_zst(x: ()) -> [(); 1] { fn id(x: T) -> T {x} @@ -148,30 +132,24 @@ fn test_fn_transmute_zst(x: ()) -> [(); 1] { }) } -#[rustc_mir] fn test_fn_ignored_pair() -> ((), ()) { ((), ()) } -#[rustc_mir] fn test_fn_ignored_pair_0() { test_fn_ignored_pair().0 } -#[rustc_mir] fn id(x: T) -> T { x } -#[rustc_mir] fn ignored_pair_named() -> (Foo, Foo) { (Foo, Foo) } -#[rustc_mir] fn test_fn_ignored_pair_named() -> (Foo, Foo) { id(ignored_pair_named()) } -#[rustc_mir] fn test_fn_nested_pair(x: &((f32, f32), u32)) -> (f32, f32) { let y = *x; let z = y.0; diff --git a/src/test/run-pass/mir_trans_calls_variadic.rs b/src/test/run-pass/mir_trans_calls_variadic.rs index 7f711b2758dc7..4e06738da4fd5 100644 --- a/src/test/run-pass/mir_trans_calls_variadic.rs +++ b/src/test/run-pass/mir_trans_calls_variadic.rs @@ -8,14 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - #[link(name = "rust_test_helpers")] extern { fn rust_interesting_average(_: i64, ...) -> f64; } -#[rustc_mir] fn test(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 { unsafe { rust_interesting_average(6, a, a as f64, diff --git a/src/test/run-pass/mir_trans_critical_edge.rs b/src/test/run-pass/mir_trans_critical_edge.rs index 320f40175926d..f6fe19c43097a 100644 --- a/src/test/run-pass/mir_trans_critical_edge.rs +++ b/src/test/run-pass/mir_trans_critical_edge.rs @@ -29,7 +29,6 @@ impl Foo where A: Iterator, B: Iterator { // This is the function we care about - #[rustc_mir] fn next(&mut self) -> Option { match self.state { State::Both => match self.a.next() { diff --git a/src/test/run-pass/mir_trans_spike1.rs b/src/test/run-pass/mir_trans_spike1.rs index 9a06ab78e73b4..8474e841e01ad 100644 --- a/src/test/run-pass/mir_trans_spike1.rs +++ b/src/test/run-pass/mir_trans_spike1.rs @@ -10,9 +10,6 @@ // A simple spike test for MIR version of trans. -#![feature(rustc_attrs)] - -#[rustc_mir] fn sum(x: i32, y: i32) -> i32 { x + y } diff --git a/src/test/run-pass/mir_trans_switch.rs b/src/test/run-pass/mir_trans_switch.rs index c32d9da724d05..b097bf46ad370 100644 --- a/src/test/run-pass/mir_trans_switch.rs +++ b/src/test/run-pass/mir_trans_switch.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - enum Abc { A(u8), B(i8), @@ -17,7 +15,6 @@ enum Abc { D, } -#[rustc_mir] fn foo(x: Abc) -> i32 { match x { Abc::C => 3, @@ -27,7 +24,6 @@ fn foo(x: Abc) -> i32 { } } -#[rustc_mir] fn foo2(x: Abc) -> bool { match x { Abc::D => true, diff --git a/src/test/run-pass/mir_trans_switchint.rs b/src/test/run-pass/mir_trans_switchint.rs index edde5f3c89587..537734596a521 100644 --- a/src/test/run-pass/mir_trans_switchint.rs +++ b/src/test/run-pass/mir_trans_switchint.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] pub fn foo(x: i8) -> i32 { match x { 1 => 0, diff --git a/src/test/run-pass/mir_void_return.rs b/src/test/run-pass/mir_void_return.rs index 8b07449b8fafd..78cb9fb39d6a6 100644 --- a/src/test/run-pass/mir_void_return.rs +++ b/src/test/run-pass/mir_void_return.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - -#[rustc_mir] fn mir() -> (){ let x = 1; let mut y = 0; diff --git a/src/test/run-pass/mir_void_return_2.rs b/src/test/run-pass/mir_void_return_2.rs index a3ad343240918..fc9e3d5e3b535 100644 --- a/src/test/run-pass/mir_void_return_2.rs +++ b/src/test/run-pass/mir_void_return_2.rs @@ -8,11 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] - fn nil() {} -#[rustc_mir] fn mir(){ nil() } diff --git a/src/test/run-pass/vec-matching-fold.rs b/src/test/run-pass/vec-matching-fold.rs index 7a6129d311ee3..ac80a4211ada6 100644 --- a/src/test/run-pass/vec-matching-fold.rs +++ b/src/test/run-pass/vec-matching-fold.rs @@ -11,11 +11,9 @@ #![feature(advanced_slice_patterns)] #![feature(slice_patterns)] -#![feature(rustc_attrs)] use std::fmt::Debug; -#[rustc_mir(graphviz="mir.gv")] fn foldl(values: &[T], initial: U, mut function: F) @@ -32,7 +30,6 @@ fn foldl(values: &[T], } } -#[rustc_mir] fn foldr(values: &[T], initial: U, mut function: F) diff --git a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs index 1093bc7c18b86..eecc3e7afdbb4 100644 --- a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(slice_patterns, rustc_attrs)] +#![feature(slice_patterns)] -#[rustc_mir] pub fn main() { let x = &[1, 2, 3, 4, 5]; let x: &[isize] = &[1, 2, 3, 4, 5]; diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index 075709a63b5f5..97006f54cd955 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -11,9 +11,7 @@ #![feature(advanced_slice_patterns)] #![feature(slice_patterns)] -#![feature(rustc_attrs)] -#[rustc_mir] fn a() { let x = [1]; match x { @@ -23,7 +21,6 @@ fn a() { } } -#[rustc_mir] fn b() { let x = [1, 2, 3]; match x { @@ -60,7 +57,6 @@ fn b() { } -#[rustc_mir] fn b_slice() { let x : &[_] = &[1, 2, 3]; match x { @@ -100,7 +96,6 @@ fn b_slice() { } } -#[rustc_mir] fn c() { let x = [1]; match x { @@ -109,7 +104,6 @@ fn c() { } } -#[rustc_mir] fn d() { let x = [1, 2, 3]; let branch = match x { @@ -121,7 +115,6 @@ fn d() { assert_eq!(branch, 1); } -#[rustc_mir] fn e() { let x: &[isize] = &[1, 2, 3]; let a = match *x { diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs index 6084a0d07a114..d123eb36a7d4d 100644 --- a/src/test/run-pass/vec-tail-matching.rs +++ b/src/test/run-pass/vec-tail-matching.rs @@ -11,13 +11,11 @@ #![feature(slice_patterns)] -#![feature(rustc_attrs)] struct Foo { string: &'static str } -#[rustc_mir] pub fn main() { let x = [ Foo { string: "foo" }, diff --git a/src/test/run-pass/zero-size-type-destructors.rs b/src/test/run-pass/zero-size-type-destructors.rs index a663ae650c087..e36ae6b11b3c7 100644 --- a/src/test/run-pass/zero-size-type-destructors.rs +++ b/src/test/run-pass/zero-size-type-destructors.rs @@ -8,13 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs, unsafe_no_drop_flag)] +#![feature(unsafe_no_drop_flag)] // ignore-pretty : (#23623) problems when ending with // comments static mut destructions : isize = 3; -#[rustc_no_mir] // FIXME #29855 MIR doesn't handle all drops correctly. pub fn foo() { #[unsafe_no_drop_flag] struct Foo; diff --git a/src/test/run-pass/zero_sized_subslice_match.rs b/src/test/run-pass/zero_sized_subslice_match.rs index 00f4aa98a3e06..d399ef72976f1 100644 --- a/src/test/run-pass/zero_sized_subslice_match.rs +++ b/src/test/run-pass/zero_sized_subslice_match.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] #![feature(slice_patterns)] -#[rustc_mir] fn main() { let x = [(), ()];