macro_rules: Less hacky heuristic for using tt
metavariable spans
This commit is contained in:
parent
139fb22146
commit
e1d12c8caf
11 changed files with 85 additions and 92 deletions
|
@ -1,16 +1,3 @@
|
|||
$DIR/auxiliary/macro_name_span_helper.rs:
|
||||
LL| |// edition: 2021
|
||||
LL| |
|
||||
LL| |#[macro_export]
|
||||
LL| |macro_rules! macro_that_defines_a_function {
|
||||
LL| | (fn $name:ident () $body:tt) => {
|
||||
LL| 1| fn $name () -> () $body
|
||||
LL| | }
|
||||
LL| |}
|
||||
LL| |
|
||||
LL| |// Non-executable comment.
|
||||
|
||||
$DIR/macro_name_span.rs:
|
||||
LL| |// edition: 2021
|
||||
LL| |
|
||||
LL| |// Regression test for <https://github.com/rust-lang/rust/issues/117788>.
|
||||
|
@ -32,8 +19,8 @@ $DIR/macro_name_span.rs:
|
|||
LL| |}
|
||||
LL| |
|
||||
LL| |macro_name_span_helper::macro_that_defines_a_function! {
|
||||
LL| | fn affected_function() {
|
||||
LL| | macro_with_an_unreasonably_and_egregiously_long_name!();
|
||||
LL| | }
|
||||
LL| 1| fn affected_function() {
|
||||
LL| 1| macro_with_an_unreasonably_and_egregiously_long_name!();
|
||||
LL| 1| }
|
||||
LL| |}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue