mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user