-
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
Don't suggest incorrect syntax #51670
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
We probably get the same bad suggestion when creating the binding via a macro that takes the name of the local to be created via an ident fragment. |
Can you provide a repro case? I'll see if I have any way of differentiate them (other than checking the span context). |
somewhat xD I found other stuff: let x: _ = 42;
x.pow(2);
and macro_rules! foo {
($ident:ident) => { let $ident = 42; }
}
fn main() {
foo!(bar);
bar.pow(2);
} suggests to modify a macro (which might be not from this crate)
|
@oli-obk as is, on external macros, the suggestion uses the compiled macro output:
|
Changed to account for both of the presented cases.
|
match parent_node { | ||
hir_map::NodeLocal(hir::Local { | ||
|
||
match (is_real_filename, parent_node) { |
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.
You match on filename above toget this bool. Can you just match on it directly 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.
Done.
@bors r+ |
📌 Commit cc0ab82 has been approved by |
Don't suggest incorrect syntax Fix #51634.
☀️ Test successful - status-appveyor, status-travis |
Fix #51634.