-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Don't return dummy MacroData in get_macro
#156151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,29 @@ | ||
| //@edition:2018 | ||
|
|
||
| #![crate_type = "lib"] | ||
|
|
||
|
|
||
| mod a { | ||
| use ignore as cfg; | ||
| //~^ERROR name `cfg` is reserved in attribute namespace | ||
| } | ||
|
|
||
| mod b { | ||
| use cfg_attr as cfg; | ||
| //~^ERROR name `cfg` is reserved in attribute namespace | ||
| } | ||
|
|
||
| mod c { | ||
| use cfg as cfg; | ||
| //~^ERROR `cfg` is ambiguous | ||
| } | ||
|
|
||
| mod d { | ||
| use inline as cfg_attr; | ||
| //~^ERROR name `cfg_attr` is reserved in attribute namespace | ||
| } | ||
|
|
||
| mod e { | ||
| use not_found as cfg; // trigger "unresolved import", not "cfg reserved". | ||
| //~^ ERROR unresolved import `not_found` | ||
| } |
This file contains hidden or 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,39 @@ | ||
| error: name `cfg` is reserved in attribute namespace | ||
| --> $DIR/reserved-macro-names-rename.rs:7:19 | ||
| | | ||
| LL | use ignore as cfg; | ||
| | ^^^ | ||
|
|
||
| error: name `cfg` is reserved in attribute namespace | ||
| --> $DIR/reserved-macro-names-rename.rs:12:21 | ||
| | | ||
| LL | use cfg_attr as cfg; | ||
| | ^^^ | ||
|
|
||
| error: name `cfg_attr` is reserved in attribute namespace | ||
| --> $DIR/reserved-macro-names-rename.rs:22:19 | ||
| | | ||
| LL | use inline as cfg_attr; | ||
| | ^^^^^^^^ | ||
|
|
||
| error[E0432]: unresolved import `not_found` | ||
| --> $DIR/reserved-macro-names-rename.rs:27:9 | ||
| | | ||
| LL | use not_found as cfg; // trigger "unresolved import", not "cfg reserved". | ||
| | ^^^^^^^^^^^^^^^^ no external crate `not_found` | ||
|
|
||
| error[E0659]: `cfg` is ambiguous | ||
| --> $DIR/reserved-macro-names-rename.rs:17:9 | ||
| | | ||
| LL | use cfg as cfg; | ||
| | ^^^ ambiguous name | ||
| | | ||
| = note: ambiguous because of a name conflict with a builtin attribute | ||
| = note: `cfg` could refer to a built-in attribute | ||
| note: `cfg` could also refer to a macro from prelude | ||
| --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL | ||
|
|
||
| error: aborting due to 5 previous errors | ||
|
|
||
| Some errors have detailed explanations: E0432, E0659. | ||
| For more information about an error, try `rustc --explain E0432`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.