forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#120204 - azhogin:azhogin/collapse_debuginfo…
…_for_builtin, r=petrochenkov Builtin macros effectively have implicit #[collapse_debuginfo(yes)] If collapse_debuginfo attribute for builtin macro is not specified explicitly, it will be effectively set to `#[collapse_debuginfo(yes)]`.
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// ignore-lldb | ||
#![feature(collapse_debuginfo)] | ||
|
||
use std::fmt; | ||
|
||
// Test that builtin macro debug info is collapsed. | ||
// Debug info for format_args must be #format_arg_external, not #format_arg_internal. | ||
// Because format_args is a builtin macro. | ||
// compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:run | ||
// gdb-command:next 2 | ||
// gdb-command:frame | ||
// gdb-check:[...]#format_arg_external[...] | ||
// gdb-command:continue | ||
|
||
fn main() { | ||
let ret = 0; // #break | ||
let w = "world".to_string(); | ||
let s = fmt::format( | ||
format_args!( // #format_arg_external | ||
"hello {}", w // #format_arg_internal | ||
) | ||
); // #format_callsite | ||
println!( | ||
"{}", | ||
s | ||
); // #println_callsite | ||
std::process::exit(ret); | ||
} |