Show what things are, but also what they are not.

This commit is contained in:
Mara Bos 2021-08-22 18:15:07 +02:00
parent a13c66e0a5
commit 4e22bf47d0
2 changed files with 14 additions and 8 deletions

View file

@ -978,7 +978,13 @@ impl<'a> Resolver<'a> {
Some(MacroKind::Derive) => format!("a derive macro: `#[derive({})]`", ident),
// Don't confuse the user with tool modules.
None if res == Res::ToolMod => continue,
None => format!("{} {}", res.article(), res.descr()),
None => format!(
"{} {}, not {} {}",
res.article(),
res.descr(),
macro_kind.article(),
macro_kind.descr_expected(),
),
};
if let crate::NameBindingKind::Import { import, .. } = binding.kind {
if !import.span.is_dummy() {