1
Fork 0

Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkov

Specify the kind of the item for E0121

Fixes #86005
This commit is contained in:
Dylan DPC 2021-06-23 00:20:18 +02:00 committed by GitHub
commit af9e5d1a14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 455 additions and 388 deletions

View file

@ -2815,6 +2815,27 @@ impl ItemKind<'_> {
_ => return None,
})
}
pub fn descr(&self) -> &'static str {
match self {
ItemKind::ExternCrate(..) => "extern crate",
ItemKind::Use(..) => "`use` import",
ItemKind::Static(..) => "static item",
ItemKind::Const(..) => "constant item",
ItemKind::Fn(..) => "function",
ItemKind::Mod(..) => "module",
ItemKind::ForeignMod { .. } => "extern block",
ItemKind::GlobalAsm(..) => "global asm item",
ItemKind::TyAlias(..) => "type alias",
ItemKind::OpaqueTy(..) => "opaque type",
ItemKind::Enum(..) => "enum",
ItemKind::Struct(..) => "struct",
ItemKind::Union(..) => "union",
ItemKind::Trait(..) => "trait",
ItemKind::TraitAlias(..) => "trait alias",
ItemKind::Impl(..) => "implementation",
}
}
}
/// A reference from an trait to one of its associated items. This