Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c19eab1

Browse files
committedFeb 15, 2024
address review comment
See rust-lang#121067 (comment)
1 parent 0afb03e commit c19eab1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎compiler/rustc_expand/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ expand_invalid_cfg_no_predicate = `cfg` predicate is not specified
6363
expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal
6464
6565
expand_invalid_fragment_specifier =
66-
invalid fragment specifier `{$name}`
66+
invalid fragment specifier `{$fragment}`
6767
.help = {$help}
6868
6969
expand_macro_body_stability =

‎compiler/rustc_expand/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,6 @@ pub struct DuplicateMatcherBinding {
415415
pub struct InvalidFragmentSpecifier {
416416
#[primary_span]
417417
pub span: Span,
418-
pub name: String,
418+
pub fragment: Ident,
419419
pub help: String,
420420
}

‎compiler/rustc_expand/src/mbe/quoted.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ pub(super) fn parse(
6161
Some(&tokenstream::TokenTree::Token(Token { kind: token::Colon, span }, _)) => {
6262
match trees.next() {
6363
Some(tokenstream::TokenTree::Token(token, _)) => match token.ident() {
64-
Some((frag, _)) => {
64+
Some((fragment, _)) => {
6565
let span = token.span.with_lo(start_sp.lo());
6666

6767
let kind =
68-
token::NonterminalKind::from_symbol(frag.name, || {
68+
token::NonterminalKind::from_symbol(fragment.name, || {
6969
// FIXME(#85708) - once we properly decode a foreign
7070
// crate's `SyntaxContext::root`, then we can replace
7171
// this with just `span.edition()`. A
@@ -85,7 +85,7 @@ pub(super) fn parse(
8585
sess.dcx().emit_err(
8686
errors::InvalidFragmentSpecifier {
8787
span,
88-
name: frag.name.to_string(),
88+
fragment,
8989
help: VALID_FRAGMENT_NAMES_MSG.into(),
9090
},
9191
);

0 commit comments

Comments
 (0)
Please sign in to comment.