Skip to content

Commit

Permalink
Use an atom comparison for a keyword check.
Browse files Browse the repository at this point in the history
Instead of a string comparison.
  • Loading branch information
nnethercote committed Nov 14, 2024
1 parent d34f282 commit e7dffee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
// Still doesn't deal with upvars
if let Some(span) = finalize {
let (span, resolution_error) = match item {
None if rib_ident.as_str() == "self" => (span, LowercaseSelf),
None if rib_ident.name == kw::SelfLower => {
(span, LowercaseSelf)
}
None => {
// If we have a `let name = expr;`, we have the span for
// `name` and use that to see if it is followed by a type
Expand Down

0 comments on commit e7dffee

Please sign in to comment.