forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest moving if non-found macro_rules! is defined later
- Loading branch information
1 parent
eb1f279
commit 75a4fa1
Showing
7 changed files
with
94 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
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,13 @@ | ||
mod demo { | ||
fn hello() { | ||
something_later!(); //~ ERROR cannot find macro `something_later` in this scope | ||
} | ||
|
||
macro_rules! something_later { | ||
() => { | ||
println!("successfully expanded!"); | ||
}; | ||
} | ||
} | ||
|
||
fn main() {} |
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,14 @@ | ||
error: cannot find macro `something_later` in this scope | ||
--> $DIR/issue-121061-defined-later-2.rs:3:9 | ||
| | ||
LL | something_later!(); | ||
| ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call | ||
| | ||
note: a macro with the same name exists, but it appears later at here | ||
--> $DIR/issue-121061-defined-later-2.rs:6:18 | ||
| | ||
LL | macro_rules! something_later { | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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,9 @@ | ||
fn main() { | ||
something_later!(); //~ ERROR cannot find macro `something_later` in this scope | ||
} | ||
|
||
macro_rules! something_later { | ||
() => { | ||
println!("successfully expanded!"); | ||
}; | ||
} |
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,14 @@ | ||
error: cannot find macro `something_later` in this scope | ||
--> $DIR/issue-121061-defined-later.rs:2:5 | ||
| | ||
LL | something_later!(); | ||
| ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call | ||
| | ||
note: a macro with the same name exists, but it appears later at here | ||
--> $DIR/issue-121061-defined-later.rs:5:14 | ||
| | ||
LL | macro_rules! something_later { | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|