1
Fork 0

Rollup merge of #137758 - jdonszelmann:fix-137662, r=nnethercote

fix usage of ty decl macro fragments in attributes

See the test case. Due to one missing code path (and also the changes in #137517), using $ty or other specific fragments as part of an attr wouldn't work. $tt used to work since it wouldn't be parsed anywhere along the way.

Closes #137662
This commit is contained in:
Michael Goulet 2025-03-06 12:22:15 -05:00 committed by GitHub
commit 34d273b4bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View file

@ -473,6 +473,15 @@ impl<'a> MetaItemListParserContext<'a> {
{
self.inside_delimiters.next();
return Some(MetaItemOrLitParser::Lit(lit));
} else if let Some(TokenTree::Delimited(.., Delimiter::Invisible(_), inner_tokens)) =
self.inside_delimiters.peek()
{
self.inside_delimiters.next();
return MetaItemListParserContext {
inside_delimiters: inner_tokens.iter().peekable(),
dcx: self.dcx,
}
.next();
}
// or a path.