-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
resolve: Some macro resolution refactoring #53471
Conversation
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0601]: `main` function not found in crate `issue_53269` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the noise by adding a main
function
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | } } | ||
LL | m!(); | ||
| ----- in this macro invocation | ||
| | ||
= note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560) | ||
note: `panic` could also refer to the macro imported here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refers to "here", but there's nothing shown
src/librustc_resolve/macros.rs
Outdated
is_attr: bool, | ||
path_span: Span) | ||
-> Result<MacroBinding<'a>, Determinacy> { | ||
crate fn resolve_lexical_macro_path_segment(&mut self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to block indent to reduce future churn and return type breakup
…resolution code Refactor away `fn resolve_invoc_to_def`
`fn resolve_legacy_scope` can now resolve only to `macro_rules!` items, `fn resolve_lexical_macro_path_segment` is for everything else - modularized macros, preludes
Updated. |
@bors r+ |
📌 Commit 82619ea has been approved by |
resolve: Some macro resolution refactoring Work towards completing #50911 (comment) The last commit also fixes #53269 by not using `def_id()` on `Def::Err` and also fixes #53512.
☀️ Test successful - status-appveyor, status-travis |
Work towards completing #50911 (comment)
The last commit also fixes #53269 by not using
def_id()
onDef::Err
and also fixes #53512.