Replace enum ==s with matches where it makes sense

This commit is contained in:
Maybe Waffle
2023-01-30 11:03:32 +00:00
parent f55b0022db
commit fd649a3cc5
16 changed files with 258 additions and 231 deletions

View File

@@ -1552,12 +1552,12 @@ impl<'a> Resolver<'a> {
if b.is_extern_crate() && ident.span.rust_2018() {
help_msgs.push(format!("use `::{ident}` to refer to this {thing} unambiguously"))
}
if misc == AmbiguityErrorMisc::SuggestCrate {
help_msgs
.push(format!("use `crate::{ident}` to refer to this {thing} unambiguously"))
} else if misc == AmbiguityErrorMisc::SuggestSelf {
help_msgs
.push(format!("use `self::{ident}` to refer to this {thing} unambiguously"))
match misc {
AmbiguityErrorMisc::SuggestCrate => help_msgs
.push(format!("use `crate::{ident}` to refer to this {thing} unambiguously")),
AmbiguityErrorMisc::SuggestSelf => help_msgs
.push(format!("use `self::{ident}` to refer to this {thing} unambiguously")),
AmbiguityErrorMisc::FromPrelude | AmbiguityErrorMisc::None => {}
}
err.span_note(b.span, &note_msg);