summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/context.rs
AgeCommit message (Collapse)AuthorLines
2025-04-23Use `clone` to clone `DelimArgs` in two places.Nicholas Nethercote-6/+2
2025-04-20Remove #[rustc_macro_edition_2021].Mara Bos-2/+0
It was only temporarily used by pin!(), which no longer needs it.
2025-04-17Replace infallible `name_or_empty` methods with fallible `name` methods.Nicholas Nethercote-3/+3
I'm removing empty identifiers everywhere, because in practice they always mean "no identifier" rather than "empty identifier". (An empty identifier is impossible.) It's better to use `Option` to mean "no identifier" because you then can't forget about the "no identifier" possibility. Some specifics: - When testing an attribute for a single name, the commit uses the `has_name` method. - When testing an attribute for multiple names, the commit uses the new `has_any_name` method. - When using `match` on an attribute, the match arms now have `Some` on them. In the tests, we now avoid printing empty identifiers by not printing the identifier in the `error:` line at all, instead letting the carets point out the problem.
2025-04-02Remove `TokenStream::flattened` and `InvisibleOrigin::FlattenToken`.Nicholas Nethercote-1/+1
They are no longer needed. This does slightly worsen the error message for a single test, but that test contains code that is so badly broken that I'm not worried about it.
2025-03-19add rustc_macro_edition_2021Jana Dönszelmann-0/+2
2025-03-12Introduce `sym::dummy` and `Ident::dummy`.Nicholas Nethercote-2/+1
The idea is to identify cases of symbols/identifiers that are not expected to be used. There isn't a perfectly sharp line between "dummy" and "not dummy", but I think it's useful nonetheless.
2025-02-25fix #137589Jana Dönszelmann-1/+4
2025-02-24lower attr spans and inline some functions to hopefully mitigate perf ↵Jana Dönszelmann-8/+14
regressions
2025-02-24Introduce new-style attribute parsers for several attributesJana Dönszelmann-1/+28
note: compiler compiles but librustdoc and clippy don't
2025-02-24Introduce new parsing infrastructure and types for parsed attributesJana Dönszelmann-0/+315
fixup docs in parser