about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-04-07 22:43:46 +0300
committerEduard Burtescu <edy.burt@gmail.com>2016-04-11 20:51:45 +0300
commit373b6ec935fb64767d03da9a79d4614ccbb3f084 (patch)
treeea81a53af75b514e9676f3b83ec00440a2f41003
parentce8d4a21348c6185e7df2817a80910f86e9db205 (diff)
downloadrust-373b6ec935fb64767d03da9a79d4614ccbb3f084.tar.gz
rust-373b6ec935fb64767d03da9a79d4614ccbb3f084.zip
tests: update for MIR debuginfo.
-rw-r--r--src/compiletest/runtest.rs18
-rw-r--r--src/test/compile-fail/bad-intrinsic-monomorphization.rs5
-rw-r--r--src/test/compile-fail/non-interger-atomic.rs18
-rw-r--r--src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs3
-rw-r--r--src/test/compile-fail/simd-intrinsic-generic-cast.rs3
-rw-r--r--src/test/compile-fail/simd-intrinsic-generic-comparison.rs3
-rw-r--r--src/test/compile-fail/simd-intrinsic-generic-elements.rs1
-rw-r--r--src/test/debuginfo/associated-types.rs3
-rw-r--r--src/test/debuginfo/c-style-enum.rs3
-rw-r--r--src/test/debuginfo/function-prologue-stepping-no-stack-check.rs13
-rw-r--r--src/test/debuginfo/no-debug-attribute.rs3
-rw-r--r--src/test/debuginfo/var-captured-in-nested-closure.rs11
-rw-r--r--src/test/debuginfo/var-captured-in-sendable-closure.rs11
-rw-r--r--src/test/debuginfo/var-captured-in-stack-closure.rs11
-rw-r--r--src/test/run-pass/backtrace-debuginfo-aux.rs2
-rw-r--r--src/test/run-pass/backtrace-debuginfo.rs6
-rw-r--r--src/test/run-pass/backtrace.rs6
17 files changed, 48 insertions, 72 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 994f45da146..b95bd8e52d0 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -868,27 +868,11 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
         "-g".to_owned(),
         "--debuginfo".to_owned()
     ];
-    let mut new_options =
+    let new_options =
         split_maybe_args(options).into_iter()
                                  .filter(|x| !options_to_remove.contains(x))
                                  .collect::<Vec<String>>();
 
-    let mut i = 0;
-    while i + 1 < new_options.len() {
-        if new_options[i] == "-Z" {
-            // FIXME #31005 MIR missing debuginfo currently.
-            if new_options[i + 1] == "orbit" {
-                // Remove "-Z" and "orbit".
-                new_options.remove(i);
-                new_options.remove(i);
-                continue;
-            }
-            // Always skip over -Z's argument.
-            i += 1;
-        }
-        i += 1;
-    }
-
     Some(new_options.join(" "))
 }
 
diff --git a/src/test/compile-fail/bad-intrinsic-monomorphization.rs b/src/test/compile-fail/bad-intrinsic-monomorphization.rs
index 049552aa2d7..cfb64f80767 100644
--- a/src/test/compile-fail/bad-intrinsic-monomorphization.rs
+++ b/src/test/compile-fail/bad-intrinsic-monomorphization.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics, rustc_attrs, core_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, core_intrinsics)]
 #![allow(warnings)]
 
 // Bad monomorphizations could previously cause LLVM asserts even though the
@@ -23,19 +23,16 @@ use std::intrinsics;
 #[derive(Copy, Clone)]
 struct Foo(i64);
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_cttz(v: Foo) -> Foo {
     intrinsics::cttz(v)
     //~^ ERROR `cttz` intrinsic: expected basic integer type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_fadd_fast(a: Foo, b: Foo) -> Foo {
     intrinsics::fadd_fast(a, b)
     //~^ ERROR `fadd_fast` intrinsic: expected basic float type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_simd_add(a: Foo, b: Foo) -> Foo {
     simd_add(a, b)
     //~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
diff --git a/src/test/compile-fail/non-interger-atomic.rs b/src/test/compile-fail/non-interger-atomic.rs
index d2376eecd9b..0b7b33de421 100644
--- a/src/test/compile-fail/non-interger-atomic.rs
+++ b/src/test/compile-fail/non-interger-atomic.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core_intrinsics, rustc_attrs)]
+#![feature(core_intrinsics)]
 #![allow(warnings)]
 
 use std::intrinsics;
@@ -18,97 +18,81 @@ struct Foo(i64);
 type Bar = &'static Fn();
 type Quux = [u8; 100];
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_bool_load(p: &mut bool, v: bool) {
     intrinsics::atomic_load(p);
     //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_bool_store(p: &mut bool, v: bool) {
     intrinsics::atomic_store(p, v);
     //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_bool_xchg(p: &mut bool, v: bool) {
     intrinsics::atomic_xchg(p, v);
     //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_bool_cxchg(p: &mut bool, v: bool) {
     intrinsics::atomic_cxchg(p, v, v);
     //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Foo_load(p: &mut Foo, v: Foo) {
     intrinsics::atomic_load(p);
     //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Foo_store(p: &mut Foo, v: Foo) {
     intrinsics::atomic_store(p, v);
     //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) {
     intrinsics::atomic_xchg(p, v);
     //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) {
     intrinsics::atomic_cxchg(p, v, v);
     //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Bar_load(p: &mut Bar, v: Bar) {
     intrinsics::atomic_load(p);
     //~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Bar_store(p: &mut Bar, v: Bar) {
     intrinsics::atomic_store(p, v);
     //~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) {
     intrinsics::atomic_xchg(p, v);
     //~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) {
     intrinsics::atomic_cxchg(p, v, v);
     //~^ ERROR expected basic integer type, found `&'static std::ops::Fn() + 'static`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Quux_load(p: &mut Quux, v: Quux) {
     intrinsics::atomic_load(p);
     //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Quux_store(p: &mut Quux, v: Quux) {
     intrinsics::atomic_store(p, v);
     //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) {
     intrinsics::atomic_xchg(p, v);
     //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]`
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) {
     intrinsics::atomic_cxchg(p, v, v);
     //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]`
diff --git a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs b/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs
index 33954d23b19..35c368f4cbe 100644
--- a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs
+++ b/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
+#![feature(repr_simd, platform_intrinsics)]
 #![allow(non_camel_case_types)]
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -34,7 +34,6 @@ extern "platform-intrinsic" {
     fn simd_xor<T>(x: T, y: T) -> T;
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
     let y = u32x4(0, 0, 0, 0);
diff --git a/src/test/compile-fail/simd-intrinsic-generic-cast.rs b/src/test/compile-fail/simd-intrinsic-generic-cast.rs
index cb3bed7209e..4999b790b13 100644
--- a/src/test/compile-fail/simd-intrinsic-generic-cast.rs
+++ b/src/test/compile-fail/simd-intrinsic-generic-cast.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
+#![feature(repr_simd, platform_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -35,7 +35,6 @@ extern "platform-intrinsic" {
     fn simd_cast<T, U>(x: T) -> U;
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
diff --git a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs b/src/test/compile-fail/simd-intrinsic-generic-comparison.rs
index 0e7b2bd4904..617b03a8711 100644
--- a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs
+++ b/src/test/compile-fail/simd-intrinsic-generic-comparison.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
+#![feature(repr_simd, platform_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -29,7 +29,6 @@ extern "platform-intrinsic" {
     fn simd_ge<T, U>(x: T, y: T) -> U;
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
diff --git a/src/test/compile-fail/simd-intrinsic-generic-elements.rs b/src/test/compile-fail/simd-intrinsic-generic-elements.rs
index 1f4cc72ffe7..78f7d42e25a 100644
--- a/src/test/compile-fail/simd-intrinsic-generic-elements.rs
+++ b/src/test/compile-fail/simd-intrinsic-generic-elements.rs
@@ -56,7 +56,6 @@ extern "platform-intrinsic" {
     fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
 }
 
-#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
diff --git a/src/test/debuginfo/associated-types.rs b/src/test/debuginfo/associated-types.rs
index ebaad663bb4..8615c8a7ef6 100644
--- a/src/test/debuginfo/associated-types.rs
+++ b/src/test/debuginfo/associated-types.rs
@@ -80,7 +80,7 @@
 
 #![allow(unused_variables)]
 #![allow(dead_code)]
-#![feature(omit_gdb_pretty_printer_section)]
+#![feature(omit_gdb_pretty_printer_section, rustc_attrs)]
 #![omit_gdb_pretty_printer_section]
 
 trait TraitWithAssocType {
@@ -127,6 +127,7 @@ fn assoc_tuple<T: TraitWithAssocType>(arg: (T, T::Type)) {
     zzz(); // #break
 }
 
+#[rustc_no_mir] // FIXME(#32790) MIR reuses scopes for match arms.
 fn assoc_enum<T: TraitWithAssocType>(arg: Enum<T>) {
 
     match arg {
diff --git a/src/test/debuginfo/c-style-enum.rs b/src/test/debuginfo/c-style-enum.rs
index 4eec26d335c..dbd336d2dc6 100644
--- a/src/test/debuginfo/c-style-enum.rs
+++ b/src/test/debuginfo/c-style-enum.rs
@@ -157,7 +157,8 @@ fn main() {
 
     zzz(); // #break
 
-    let a = SINGLE_VARIANT;
+    // Borrow to avoid an eager load of the constant value in the static.
+    let a = &SINGLE_VARIANT;
     let a = unsafe { AUTO_ONE };
     let a = unsafe { MANUAL_ONE };
 }
diff --git a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs
index b5b6ca75727..e90f7d649f5 100644
--- a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs
+++ b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs
@@ -247,10 +247,11 @@
 // lldb-command:continue
 
 #![allow(dead_code, unused_assignments, unused_variables)]
-#![feature(omit_gdb_pretty_printer_section)]
+#![feature(omit_gdb_pretty_printer_section, rustc_attrs)]
 #![omit_gdb_pretty_printer_section]
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn immediate_args(a: isize, b: bool, c: f64) {
     println!("");
 }
@@ -267,43 +268,51 @@ struct BigStruct {
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn non_immediate_args(a: BigStruct, b: BigStruct) {
     println!("");
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn binding(a: i64, b: u64, c: f64) {
     let x = 0;
     println!("");
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn assignment(mut a: u64, b: u64, c: f64) {
     a = b;
     println!("");
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn function_call(x: u64, y: u64, z: f64) {
     println!("Hi!")
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn identifier(x: u64, y: u64, z: f64) -> u64 {
     x
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn return_expr(x: u64, y: u64, z: f64) -> u64 {
     return x;
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
     x + y
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn if_expr(x: u64, y: u64, z: f64) -> u64 {
     if x + y < 1000 {
         x
@@ -313,6 +322,7 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 {
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
     while x + y < 1000 {
         x += z
@@ -321,6 +331,7 @@ fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
 }
 
 #[no_stack_check]
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
 fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
     loop {
         x += z;
diff --git a/src/test/debuginfo/no-debug-attribute.rs b/src/test/debuginfo/no-debug-attribute.rs
index 6bdd68d5e26..ea237e5970c 100644
--- a/src/test/debuginfo/no-debug-attribute.rs
+++ b/src/test/debuginfo/no-debug-attribute.rs
@@ -23,10 +23,11 @@
 // gdb-command:continue
 
 #![allow(unused_variables)]
-#![feature(no_debug)]
+#![feature(no_debug, rustc_attrs)]
 #![feature(omit_gdb_pretty_printer_section)]
 #![omit_gdb_pretty_printer_section]
 
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is inaccurate for returns.
 fn function_with_debuginfo() {
     let abc = 10_usize;
     return (); // #break
diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs
index 7090377e5db..d2af828a890 100644
--- a/src/test/debuginfo/var-captured-in-nested-closure.rs
+++ b/src/test/debuginfo/var-captured-in-nested-closure.rs
@@ -78,7 +78,7 @@
 // lldb-command:continue
 
 #![allow(unused_variables)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_attrs, stmt_expr_attributes)]
 #![feature(omit_gdb_pretty_printer_section)]
 #![omit_gdb_pretty_printer_section]
 
@@ -88,6 +88,7 @@ struct Struct {
     c: usize
 }
 
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
 fn main() {
     let mut variable = 1;
     let constant = 2;
@@ -101,10 +102,14 @@ fn main() {
     let struct_ref = &a_struct;
     let owned: Box<_> = box 6;
 
-    let mut closure = || {
+    let mut closure =
+    #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+    || {
         let closure_local = 8;
 
-        let mut nested_closure = || {
+        let mut nested_closure =
+        #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+        || {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;
         };
diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs
index aa269edadd8..26d46040c20 100644
--- a/src/test/debuginfo/var-captured-in-sendable-closure.rs
+++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs
@@ -40,7 +40,7 @@
 // lldb-check:[...]$2 = 5
 
 #![allow(unused_variables)]
-#![feature(unboxed_closures, box_syntax)]
+#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)]
 #![feature(omit_gdb_pretty_printer_section)]
 #![omit_gdb_pretty_printer_section]
 
@@ -50,6 +50,7 @@ struct Struct {
     c: usize
 }
 
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
 fn main() {
     let constant = 1;
 
@@ -61,7 +62,9 @@ fn main() {
 
     let owned: Box<_> = box 5;
 
-    let closure = move || {
+    let closure =
+    #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+    move || {
         zzz(); // #break
         do_something(&constant, &a_struct.a, &*owned);
     };
@@ -73,7 +76,9 @@ fn main() {
     // The `self` argument of the following closure should be passed by value
     // to FnOnce::call_once(self, args), which gets translated a bit differently
     // than the regular case. Let's make sure this is supported too.
-    let immedate_env = move || {
+    let immedate_env =
+    #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+    move || {
         zzz(); // #break
         return constant2;
     };
diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs
index 6def5cf2859..a22fbebfd1a 100644
--- a/src/test/debuginfo/var-captured-in-stack-closure.rs
+++ b/src/test/debuginfo/var-captured-in-stack-closure.rs
@@ -69,7 +69,7 @@
 // lldb-command:print *owned
 // lldb-check:[...]$9 = 6
 
-#![feature(unboxed_closures, box_syntax)]
+#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)]
 #![allow(unused_variables)]
 #![feature(omit_gdb_pretty_printer_section)]
 #![omit_gdb_pretty_printer_section]
@@ -80,6 +80,7 @@ struct Struct {
     c: usize
 }
 
+#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
 fn main() {
     let mut variable = 1;
     let constant = 2;
@@ -94,7 +95,9 @@ fn main() {
     let owned: Box<_> = box 6;
 
     {
-        let mut first_closure = || {
+        let mut first_closure =
+        #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+        || {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned;
         };
@@ -103,7 +106,9 @@ fn main() {
     }
 
     {
-        let mut second_closure = || {
+        let mut second_closure =
+        #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
+        || {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned;
         };
diff --git a/src/test/run-pass/backtrace-debuginfo-aux.rs b/src/test/run-pass/backtrace-debuginfo-aux.rs
index b80c938fed5..48df600214a 100644
--- a/src/test/run-pass/backtrace-debuginfo-aux.rs
+++ b/src/test/run-pass/backtrace-debuginfo-aux.rs
@@ -11,7 +11,6 @@
 // ignore-test: not a test, used by backtrace-debuginfo.rs to test file!()
 
 #[inline(never)]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
     f((file!(), line!()))
 }
@@ -21,7 +20,6 @@ pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
 // this case.
 #[cfg_attr(not(target_env = "msvc"), inline(always))]
 #[cfg_attr(target_env = "msvc", inline(never))]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 pub fn callback_inlined<F>(f: F) where F: FnOnce((&'static str, u32)) {
     f((file!(), line!()))
 }
diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs
index fd1c0172339..8b2b2694882 100644
--- a/src/test/run-pass/backtrace-debuginfo.rs
+++ b/src/test/run-pass/backtrace-debuginfo.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_attrs)]
-
 // We disable tail merging here because it can't preserve debuginfo and thus
 // potentially breaks the backtraces. Also, subtle changes can decide whether
 // tail merging suceeds, so the test might work today but fail tomorrow due to a
@@ -74,7 +72,6 @@ fn dump_filelines(filelines: &[Pos]) {
 }
 
 #[inline(never)]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn inner(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
     check!(counter; main_pos, outer_pos);
     check!(counter; main_pos, outer_pos);
@@ -91,7 +88,6 @@ fn inner(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
 // this case.
 #[cfg_attr(not(target_env = "msvc"), inline(always))]
 #[cfg_attr(target_env = "msvc", inline(never))]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn inner_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
     check!(counter; main_pos, outer_pos);
     check!(counter; main_pos, outer_pos);
@@ -117,7 +113,6 @@ fn inner_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
 }
 
 #[inline(never)]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn outer(mut counter: i32, main_pos: Pos) {
     inner(&mut counter, main_pos, pos!());
     inner_inlined(&mut counter, main_pos, pos!());
@@ -162,7 +157,6 @@ fn run_test(me: &str) {
 }
 
 #[inline(never)]
-#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn main() {
     let args: Vec<String> = env::args().collect();
     if args.len() >= 2 {
diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs
index a2108ff041d..5b364358a59 100644
--- a/src/test/run-pass/backtrace.rs
+++ b/src/test/run-pass/backtrace.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_attrs)]
-
 // no-pretty-expanded FIXME #15189
 // ignore-android FIXME #17520
 // compile-flags:-g
@@ -18,8 +16,6 @@ use std::env;
 use std::process::{Command, Stdio};
 use std::str;
 
-// FIXME #31005 MIR missing debuginfo currently.
-#[cfg_attr(target_env = "msvc", rustc_no_mir)]
 #[inline(never)]
 fn foo() {
     let _v = vec![1, 2, 3];
@@ -28,8 +24,6 @@ fn foo() {
     }
 }
 
-// FIXME #31005 MIR missing debuginfo currently.
-#[cfg_attr(target_env = "msvc", rustc_no_mir)]
 #[inline(never)]
 fn double() {
     struct Double;