diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index ec0af67c0463..b697f2049bd8 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -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)] diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs index 871b3e5e4de8..2daa4e715584 100644 --- a/compiler/rustc_expand/src/mbe/quoted.rs +++ b/compiler/rustc_expand/src/mbe/quoted.rs @@ -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 {