]> git.lizzy.rs Git - rust.git/commitdiff
Add checks for expected macro output in restricted shadowing tests
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Fri, 7 Sep 2018 23:50:57 +0000 (02:50 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 8 Sep 2018 11:15:11 +0000 (14:15 +0300)
src/librustc_resolve/lib.rs
src/test/ui/macros/restricted-shadowing-legacy.rs
src/test/ui/macros/restricted-shadowing-legacy.stderr
src/test/ui/macros/restricted-shadowing-modern.rs
src/test/ui/macros/restricted-shadowing-modern.stderr

index b690f305f169aaa45f7c5f6d667ada8b591fa61f..6c9a924081aeb5737bd1216aadc8172d597c18ba 100644 (file)
@@ -1274,6 +1274,8 @@ fn descr(&self) -> &'static str {
     // expansion round `max(invoc_id, binding)` when they both emerged from macros.
     // Then this function returns `true` if `self` may emerge from a macro *after* that
     // in some later round and screw up our previously found resolution.
+    // See more detailed explanation in
+    // https://github.com/rust-lang/rust/pull/53778#issuecomment-419224049
     fn may_appear_after(&self, invoc_id: Mark, binding: &NameBinding) -> bool {
         // self > max(invoc_id, binding) => !(self <= invoc_id || self <= binding)
         // Expansions are partially ordered, so "may appear after" is an inversion of
index 7950dce25a67e66d4b240a10d622293ffaa6f75a..f5cac2dfbfb4113b7593cf4ee58d59e8398c0563 100644 (file)
@@ -1,4 +1,9 @@
 // Legend:
+// `N` - number of combination, from 0 to 4*4*4=64
+// `Outer < Invoc` means that expansion that produced macro definition `Outer`
+// is a strict ancestor of expansion that produced macro definition `Inner`.
+// `>`, `=` and `Unordered` mean "strict descendant", "same" and
+// "not in ordering relation" for parent expansions.
 // `+` - possible configuration
 // `-` - configuration impossible due to properties of partial ordering
 // `-?` - configuration impossible due to block/scope syntax
 
 #![feature(decl_macro, rustc_attrs)]
 
+struct Right;
+// struct Wrong; // not defined
+
 macro_rules! include { () => {
     macro_rules! gen_outer { () => {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Wrong } }
     }}
     macro_rules! gen_inner { () => {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Right } }
     }}
     macro_rules! gen_invoc { () => {
         m!()
@@ -96,29 +104,29 @@ macro_rules! gen_gen_inner_invoc { () => {
     }
 
     fn check5() {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Wrong } }
 
         macro_rules! gen_inner_invoc { () => {
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
             m!(); // OK
         }}
         gen_inner_invoc!();
     }
 
     fn check9() {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Wrong } }
 
         macro_rules! gen_inner_gen_invoc { () => {
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
             gen_invoc!(); // OK
         }}
         gen_inner_gen_invoc!();
     }
 
     fn check10() {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Wrong } }
 
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Right } }
 
         gen_invoc!(); // OK
     }
@@ -141,9 +149,9 @@ macro_rules! m { () => {} }
     }
 
     fn check22() {
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Wrong } }
 
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Right } }
 
         m!(); // OK
     }
@@ -159,7 +167,7 @@ fn check36() {
     fn check39() {
         gen_outer!();
 
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Right } }
 
         m!(); // OK
     }
@@ -178,7 +186,7 @@ fn check56() {
         gen_outer!();
 
         macro_rules! gen_inner_invoc { () => {
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
             m!(); // OK
         }}
         gen_inner_invoc!();
@@ -187,7 +195,7 @@ macro_rules! m { () => {} }
     fn check59() {
         gen_outer!();
 
-        macro_rules! m { () => {} }
+        macro_rules! m { () => { Right } }
 
         gen_invoc!(); // OK
     }
@@ -196,7 +204,7 @@ fn check60() {
         gen_outer!();
 
         macro_rules! gen_inner_gen_invoc { () => {
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
             gen_invoc!(); // OK
         }}
         gen_inner_gen_invoc!();
@@ -226,8 +234,8 @@ macro_rules! m { () => {} }
 
     fn check34() {
         macro_rules! gen_outer_inner { () => {
-            macro_rules! m { () => {} }
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Wrong } }
+            macro_rules! m { () => { Right } }
         }}
         gen_outer_inner!();
 
@@ -237,7 +245,7 @@ macro_rules! m { () => {} }
     fn check35() {
         macro_rules! gen_gen_outer_inner { () => {
             gen_outer!();
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
         }}
         gen_gen_outer_inner!();
 
@@ -257,8 +265,8 @@ macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
 
     fn check62() {
         macro_rules! gen_outer_inner { () => {
-            macro_rules! m { () => {} }
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Wrong } }
+            macro_rules! m { () => { Right } }
         }}
         gen_outer_inner!();
 
@@ -268,7 +276,7 @@ macro_rules! m { () => {} }
     fn check63() {
         macro_rules! gen_gen_outer_inner { () => {
             gen_outer!();
-            macro_rules! m { () => {} }
+            macro_rules! m { () => { Right } }
         }}
         gen_gen_outer_inner!();
 
index cd069343c0b6863af416df36183b9c8f431fa0b9..c1a01956998b4ad576761f96e6e24dc2f4681ede 100644 (file)
@@ -1,19 +1,19 @@
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:93:13
+  --> $DIR/restricted-shadowing-legacy.rs:101:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:89:9
+  --> $DIR/restricted-shadowing-legacy.rs:97:9
    |
 LL |         macro_rules! m { () => {} }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,21 +23,21 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:131:42
+  --> $DIR/restricted-shadowing-legacy.rs:139:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:127:9
+  --> $DIR/restricted-shadowing-legacy.rs:135:9
    |
 LL |         macro_rules! m { () => {} }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,21 +47,21 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:140:9
+  --> $DIR/restricted-shadowing-legacy.rs:148:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:136:9
+  --> $DIR/restricted-shadowing-legacy.rs:144:9
    |
 LL |         macro_rules! m { () => {} }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,93 +71,93 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:156:9
+  --> $DIR/restricted-shadowing-legacy.rs:164:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:77:9
+  --> $DIR/restricted-shadowing-legacy.rs:85:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Wrong } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:172:13
+  --> $DIR/restricted-shadowing-legacy.rs:180:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:77:9
+  --> $DIR/restricted-shadowing-legacy.rs:85:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Wrong } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:210:42
+  --> $DIR/restricted-shadowing-legacy.rs:218:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:77:9
+  --> $DIR/restricted-shadowing-legacy.rs:85:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Wrong } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:224:9
+  --> $DIR/restricted-shadowing-legacy.rs:232:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:219:13
+  --> $DIR/restricted-shadowing-legacy.rs:227:13
    |
 LL |             macro_rules! m { () => {} }
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -167,21 +167,21 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-legacy.rs:254:42
+  --> $DIR/restricted-shadowing-legacy.rs:262:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:80:9
+  --> $DIR/restricted-shadowing-legacy.rs:88:9
    |
-LL |         macro_rules! m { () => {} }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         macro_rules! m { () => { Right } }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-legacy.rs:249:13
+  --> $DIR/restricted-shadowing-legacy.rs:257:13
    |
 LL |             macro_rules! m { () => {} }
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
index 20528101614996730485735dead197298dcc5b07..448f623c2208fe3d6ab10ba119ab33c045834a91 100644 (file)
@@ -1,4 +1,9 @@
 // Legend:
+// `N` - number of combination, from 0 to 4*4*4=64
+// `Outer < Invoc` means that expansion that produced macro definition `Outer`
+// is a strict ancestor of expansion that produced macro definition `Inner`.
+// `>`, `=` and `Unordered` mean "strict descendant", "same" and
+// "not in ordering relation" for parent expansions.
 // `+` - possible configuration
 // `-` - configuration impossible due to properties of partial ordering
 // `-?` - configuration impossible due to block/scope syntax
 
 #![feature(decl_macro, rustc_attrs)]
 
+struct Right;
+// struct Wrong; // not defined
+
 #[rustc_transparent_macro]
 macro include() {
     #[rustc_transparent_macro]
     macro gen_outer() {
-        macro m() {}
+        macro m() { Wrong }
     }
     #[rustc_transparent_macro]
     macro gen_inner() {
-        macro m() {}
+        macro m() { Right }
     }
     #[rustc_transparent_macro]
     macro gen_invoc() {
@@ -102,11 +110,11 @@ fn check1() {
     }
 
     fn check5() {
-        macro m() {}
+        macro m() { Wrong }
         {
             #[rustc_transparent_macro]
             macro gen_inner_invoc() {
-                macro m() {}
+                macro m() { Right }
                 m!(); // OK
             }
             gen_inner_invoc!();
@@ -114,11 +122,11 @@ fn check5() {
     }
 
     fn check9() {
-        macro m() {}
+        macro m() { Wrong }
         {
             #[rustc_transparent_macro]
             macro gen_inner_gen_invoc() {
-                macro m() {}
+                macro m() { Right }
                 gen_invoc!(); // OK
             }
             gen_inner_gen_invoc!();
@@ -126,9 +134,9 @@ fn check9() {
     }
 
     fn check10() {
-        macro m() {}
+        macro m() { Wrong }
         {
-            macro m() {}
+            macro m() { Right }
             gen_invoc!(); // OK
         }
     }
@@ -152,9 +160,9 @@ fn check17() {
     }
 
     fn check22() {
-        macro m() {}
+        macro m() { Wrong }
         {
-            macro m() {}
+            macro m() { Right }
             m!(); // OK
         }
     }
@@ -170,7 +178,7 @@ fn check36() {
     fn check39() {
         gen_outer!();
         {
-            macro m() {}
+            macro m() { Right }
             m!(); // OK
         }
     }
@@ -192,7 +200,7 @@ fn check56() {
         {
             #[rustc_transparent_macro]
             macro gen_inner_invoc() {
-                macro m() {}
+                macro m() { Right }
                 m!(); // OK
             }
             gen_inner_invoc!();
@@ -202,7 +210,7 @@ fn check56() {
     fn check59() {
         gen_outer!();
         {
-            macro m() {}
+            macro m() { Right }
             gen_invoc!(); // OK
         }
     }
@@ -212,7 +220,7 @@ fn check60() {
         {
             #[rustc_transparent_macro]
             macro gen_inner_gen_invoc() {
-                macro m() {}
+                macro m() { Right }
                 gen_invoc!(); // OK
             }
             gen_inner_gen_invoc!();
index 8d64c6c47699f5fb4b0e1872db1ba3d7f0469656..af4a93a40794590a2bff39c50a143272e49e7196 100644 (file)
@@ -1,5 +1,5 @@
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:98:17
+  --> $DIR/restricted-shadowing-modern.rs:106:17
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
    |                 ^
@@ -8,15 +8,15 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:93:9
+  --> $DIR/restricted-shadowing-modern.rs:101:9
    |
 LL |         macro m() {}
    |         ^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:141:33
+  --> $DIR/restricted-shadowing-modern.rs:149:33
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
    |                                 ^
@@ -35,15 +35,15 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:137:9
+  --> $DIR/restricted-shadowing-modern.rs:145:9
    |
 LL |         macro m() {}
    |         ^^^^^^^^^^^^
@@ -53,7 +53,7 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:150:13
+  --> $DIR/restricted-shadowing-modern.rs:158:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^
@@ -62,15 +62,15 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:147:9
+  --> $DIR/restricted-shadowing-modern.rs:155:9
    |
 LL |         macro m() {}
    |         ^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL | include!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:166:13
+  --> $DIR/restricted-shadowing-modern.rs:174:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^
@@ -89,25 +89,25 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:79:9
+  --> $DIR/restricted-shadowing-modern.rs:87:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Wrong }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:184:17
+  --> $DIR/restricted-shadowing-modern.rs:192:17
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
    |                 ^
@@ -116,25 +116,25 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:79:9
+  --> $DIR/restricted-shadowing-modern.rs:87:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Wrong }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/restricted-shadowing-modern.rs:227:33
+  --> $DIR/restricted-shadowing-modern.rs:235:33
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
    |                                 ^
@@ -143,18 +143,18 @@ LL | include!();
    | ----------- in this macro invocation
    |
 note: `m` could refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:83:9
+  --> $DIR/restricted-shadowing-modern.rs:91:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Right }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation
 note: `m` could also refer to the name defined here
-  --> $DIR/restricted-shadowing-modern.rs:79:9
+  --> $DIR/restricted-shadowing-modern.rs:87:9
    |
-LL |         macro m() {}
-   |         ^^^^^^^^^^^^
+LL |         macro m() { Wrong }
+   |         ^^^^^^^^^^^^^^^^^^^
 ...
 LL | include!();
    | ----------- in this macro invocation