Skip to content

Commit e7dffee

Browse files
committed
Use an atom comparison for a keyword check.
Instead of a string comparison.
1 parent d34f282 commit e7dffee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_resolve/src/ident.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
11991199
// Still doesn't deal with upvars
12001200
if let Some(span) = finalize {
12011201
let (span, resolution_error) = match item {
1202-
None if rib_ident.as_str() == "self" => (span, LowercaseSelf),
1202+
None if rib_ident.name == kw::SelfLower => {
1203+
(span, LowercaseSelf)
1204+
}
12031205
None => {
12041206
// If we have a `let name = expr;`, we have the span for
12051207
// `name` and use that to see if it is followed by a type

0 commit comments

Comments
 (0)