Skip to content

Commit f13094e

Browse files
committed
Make expand_invalid_fragment_specifier translatable
1 parent d3a2792 commit f13094e

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

compiler/rustc_expand/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal
9191
9292
expand_invalid_fragment_specifier =
9393
invalid fragment specifier `{$fragment}`
94-
.help = {$help}
94+
.help = valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
9595
9696
expand_macro_body_stability =
9797
macros cannot have body stability attributes

compiler/rustc_expand/src/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ pub struct InvalidFragmentSpecifier {
447447
#[primary_span]
448448
pub span: Span,
449449
pub fragment: Ident,
450-
pub help: String,
451450
}
452451

453452
#[derive(Diagnostic)]

compiler/rustc_expand/src/mbe/quoted.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ use rustc_span::symbol::{kw, sym, Ident};
1313
use rustc_span::edition::Edition;
1414
use rustc_span::Span;
1515

16-
const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \
17-
`ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, \
18-
`literal`, `path`, `meta`, `tt`, `item` and `vis`";
19-
2016
/// Takes a `tokenstream::TokenStream` and returns a `Vec<self::TokenTree>`. Specifically, this
2117
/// takes a generic `TokenStream`, such as is used in the rest of the compiler, and returns a
2218
/// collection of `TokenTree` for use in parsing a macro.
@@ -86,7 +82,6 @@ pub(super) fn parse(
8682
errors::InvalidFragmentSpecifier {
8783
span,
8884
fragment,
89-
help: VALID_FRAGMENT_NAMES_MSG.into(),
9085
},
9186
);
9287
token::NonterminalKind::Ident

0 commit comments

Comments
 (0)