mbe: Use TokenTree as the fallback for invalid fragment specifiers
`tt` should match more, so use this for both missing and invalid fragment specifiers. Also remove one unneeded instance of `String`.
This commit is contained in:
parent
b9e9be38c0
commit
cd5de49eaa
2 changed files with 3 additions and 3 deletions
|
|
@ -444,7 +444,7 @@ pub(crate) struct InvalidFragmentSpecifier {
|
|||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub fragment: Ident,
|
||||
pub help: String,
|
||||
pub help: &'static str,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ pub(super) fn parse(
|
|||
sess.dcx().emit_err(errors::InvalidFragmentSpecifier {
|
||||
span,
|
||||
fragment,
|
||||
help: VALID_FRAGMENT_NAMES_MSG.into(),
|
||||
help: VALID_FRAGMENT_NAMES_MSG,
|
||||
});
|
||||
NonterminalKind::Ident
|
||||
NonterminalKind::TT
|
||||
});
|
||||
result.push(TokenTree::MetaVarDecl { span, name: ident, kind });
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue