Skip to content

Commit 7fd2881

Browse files
committed
test: don't depend on locals being in scope on the return path.
1 parent 6fa61b8 commit 7fd2881

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/debuginfo/no-debug-attribute.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@
2323
// gdb-command:continue
2424

2525
#![allow(unused_variables)]
26-
#![feature(no_debug, rustc_attrs)]
26+
#![feature(no_debug)]
2727
#![feature(omit_gdb_pretty_printer_section)]
2828
#![omit_gdb_pretty_printer_section]
2929

30-
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is inaccurate for returns.
30+
#[inline(never)]
31+
fn id<T>(x: T) -> T {x}
32+
3133
fn function_with_debuginfo() {
3234
let abc = 10_usize;
33-
return (); // #break
35+
id(abc); // #break
3436
}
3537

3638
#[no_debug]
3739
fn function_without_debuginfo() {
3840
let abc = -57i32;
39-
return (); // #break
41+
id(abc); // #break
4042
}
4143

4244
fn main() {

0 commit comments

Comments
 (0)