-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[E0403] False positive generated for implicit future type #129265
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
hchataing
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Aug 19, 2024
Oof -- I think I caused this regression in #128357. |
Minimal: pub fn foo() {
let a = 1;
struct Foo<a> { a: a, };
} |
That was fast :) thank you for your help |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Aug 20, 2024
…dowing, r=petrochenkov Don't consider locals to shadow inner items' generics We don't want to consider the bindings from a `RibKind::Module` itself, because for an inner item that module will contain the local bindings from the function body or wherever else the inner item is being defined. Fixes rust-lang#129265 r? petrochenkov
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 21, 2024
Rollup merge of rust-lang#129270 - compiler-errors:inner-generics-shadowing, r=petrochenkov Don't consider locals to shadow inner items' generics We don't want to consider the bindings from a `RibKind::Module` itself, because for an inner item that module will contain the local bindings from the function body or wherever else the inner item is being defined. Fixes rust-lang#129265 r? petrochenkov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
This code snippet uses neither of the two error code conditions presented in https://doc.rust-lang.org/error_codes/E0403.html.
It seems that the variable name
a
for the assignmentlet a = async { loop { test::a().await; } };
is used implicitly in the type name, which would cause the struct declaration to shadow the first declaration.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: