Skip to content

Commit 97e01f6

Browse files
committed
Improve Self.
1 parent ddd4eb1 commit 97e01f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_resolve/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,11 @@ impl<'a> Resolver<'a> {
15191519
path_span: Span)
15201520
-> Option<LexicalScopeBinding<'a>> {
15211521
if ns == TypeNS {
1522-
ident.ctxt = ident.ctxt.modern();
1522+
ident.ctxt = if ident.name == keywords::SelfType.name() {
1523+
SyntaxContext::empty() // FIXME(jseyfried) improve `Self` hygiene
1524+
} else {
1525+
ident.ctxt.modern()
1526+
}
15231527
}
15241528

15251529
// Walk backwards up the ribs in scope.

0 commit comments

Comments
 (0)