Use an atom comparison for a keyword check.

Instead of a string comparison.
This commit is contained in:
Nicholas Nethercote 2024-11-08 10:42:07 +11:00
parent d34f2823fd
commit e7dffeedcf

View File

@ -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