Clarify what attribute and derive macros look like.

This commit is contained in:
Mara Bos 2021-08-22 17:26:19 +02:00
parent 5dea5d7549
commit 4bd415f70a
5 changed files with 8 additions and 7 deletions

View file

@ -973,7 +973,8 @@ impl<'a> Resolver<'a> {
) {
let desc = match binding.macro_kind() {
Some(MacroKind::Bang) => "a function-like macro".to_string(),
Some(kind) => format!("{} {}", kind.article(), kind.descr_expected()),
Some(MacroKind::Attr) => format!("an attribute: `#[{}]`", ident),
Some(MacroKind::Derive) => format!("a derive macro: `#[derive({})]`", ident),
None => {
let res = binding.res();
format!("{} {}", res.article(), res.descr())