-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
Description
Currently the Self:: shorthand in the body of an impl is implemented by syntactic expansion in libsyntax. That leads to a bug if another item shadows the concrete type. E.g.,
struct Foo;
impl Foo {
fn foo() {}
fn bar() {
let Foo = ...;
Self::foo(); // Whoops!
}
}
The Self on the commented line will cause an error in name resolution, since Self ends up referring to the local variable Foo, not the self type.
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically