-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
-Ztrace-macrosUnstable option: trace-macrosUnstable option: trace-macrosA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
(filed per #42103 (comment) )
trace_macro
output now contains both "before" and "after" text.
But often a macro-call expands to another macro-call. In that case, we get redundant lines from trace_macro
:
note: trace_macro
--> trace-macro.rs:14:5
|
14 | println!("Hello, World!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= note: expanding `println! { "Hello, World!" }`
= note: to `print ! ( concat ! ( "Hello, World!" , "\n" ) )`
= note: expanding `print! { concat ! ( "Hello, World!" , "\n" ) }`
= note: to `$crate :: io :: _print ( format_args ! ( concat ! ( "Hello, World!" , "\n" ) )
)`
The second "expanding
" note is basically the same as the previous line. We could eliminate that.
Note that it's also common for a macro-call to expand to code that merely contains another macro-call somewhere, and in that case we probably shouldn't elide anything.
Metadata
Metadata
Assignees
Labels
-Ztrace-macrosUnstable option: trace-macrosUnstable option: trace-macrosA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.