Skip to content

Commit 50b110b

Browse files
committed
update example for path vs textual macro ambiguity
1 parent 00588c7 commit 50b110b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/names/name-resolution.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,19 @@ r[names.resolution.expansion.imports.ambiguity.path-vs-textual-macro]
283283
Path-based scope bindings for macros may not shadow textual scope bindings to macros.
284284
285285
```rust,compile_fail,E0659
286-
macro_rules! m2 {
286+
macro_rules! ambig {
287+
// ^---- textual macro candidate
287288
() => {}
288289
}
289-
macro_rules! m {
290+
291+
macro_rules! path_based {
292+
// ^--- path-based macro candidate
290293
() => {}
291294
}
295+
292296
pub fn foo() {
293-
m!(); // ERROR: `m` is ambiguous
294-
use m2 as m; // In scope for entire function body.
297+
ambig!(); // ERROR: `ambig` is ambiguous
298+
use path_based as ambig; // In scope for entire function body.
295299
}
296300
```
297301

0 commit comments

Comments
 (0)