From f06bab77586e377a24393b9e2e49d1bb7003dc0b Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sat, 16 Apr 2016 21:51:26 +0300 Subject: debuginfo: argument and upvar names for MIR. --- .../function-prologue-stepping-no-stack-check.rs | 22 +++++++++++----------- .../debuginfo/var-captured-in-nested-closure.rs | 11 +++-------- .../debuginfo/var-captured-in-sendable-closure.rs | 11 +++-------- .../debuginfo/var-captured-in-stack-closure.rs | 11 +++-------- 4 files changed, 20 insertions(+), 35 deletions(-) (limited to 'src/test/debuginfo') 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 e90f7d649f5..f0ecda92993 100644 --- a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs +++ b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs @@ -251,7 +251,7 @@ #![omit_gdb_pretty_printer_section] #[no_stack_check] -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn immediate_args(a: isize, b: bool, c: f64) { println!(""); } @@ -268,51 +268,51 @@ struct BigStruct { } #[no_stack_check] -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn non_immediate_args(a: BigStruct, b: BigStruct) { println!(""); } #[no_stack_check] -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. 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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. 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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. 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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn identifier(x: u64, y: u64, z: f64) -> u64 { x } #[no_stack_check] -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. 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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. 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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn if_expr(x: u64, y: u64, z: f64) -> u64 { if x + y < 1000 { x @@ -322,7 +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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn while_expr(mut x: u64, y: u64, z: u64) -> u64 { while x + y < 1000 { x += z @@ -331,7 +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. +#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars. fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 { loop { x += z; diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index d2af828a890..7090377e5db 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, rustc_attrs, stmt_expr_attributes)] +#![feature(box_syntax)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -88,7 +88,6 @@ struct Struct { c: usize } -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let mut variable = 1; let constant = 2; @@ -102,14 +101,10 @@ fn main() { let struct_ref = &a_struct; let owned: Box<_> = box 6; - let mut closure = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - || { + let mut closure = || { let closure_local = 8; - let mut nested_closure = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - || { + let mut nested_closure = || { 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 26d46040c20..aa269edadd8 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, rustc_attrs, stmt_expr_attributes)] +#![feature(unboxed_closures, box_syntax)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -50,7 +50,6 @@ struct Struct { c: usize } -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let constant = 1; @@ -62,9 +61,7 @@ fn main() { let owned: Box<_> = box 5; - let closure = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - move || { + let closure = move || { zzz(); // #break do_something(&constant, &a_struct.a, &*owned); }; @@ -76,9 +73,7 @@ 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 = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - move || { + let immedate_env = 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 a22fbebfd1a..6def5cf2859 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, rustc_attrs, stmt_expr_attributes)] +#![feature(unboxed_closures, box_syntax)] #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -80,7 +80,6 @@ struct Struct { c: usize } -#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let mut variable = 1; let constant = 2; @@ -95,9 +94,7 @@ fn main() { let owned: Box<_> = box 6; { - let mut first_closure = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - || { + let mut first_closure = || { zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned; }; @@ -106,9 +103,7 @@ fn main() { } { - let mut second_closure = - #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. - || { + let mut second_closure = || { zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned; }; -- cgit 1.4.1-3-g733a5