Skip to content

Commit

Permalink
address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tshepang committed Feb 15, 2024
1 parent 0afb03e commit c19eab1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_expand/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ expand_invalid_cfg_no_predicate = `cfg` predicate is not specified
expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal
expand_invalid_fragment_specifier =
invalid fragment specifier `{$name}`
invalid fragment specifier `{$fragment}`
.help = {$help}
expand_macro_body_stability =
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,6 @@ pub struct DuplicateMatcherBinding {
pub struct InvalidFragmentSpecifier {
#[primary_span]
pub span: Span,
pub name: String,
pub fragment: Ident,
pub help: String,
}
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/mbe/quoted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ pub(super) fn parse(
Some(&tokenstream::TokenTree::Token(Token { kind: token::Colon, span }, _)) => {
match trees.next() {
Some(tokenstream::TokenTree::Token(token, _)) => match token.ident() {
Some((frag, _)) => {
Some((fragment, _)) => {
let span = token.span.with_lo(start_sp.lo());

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

0 comments on commit c19eab1

Please sign in to comment.