rust/compiler/rustc_expand
Matthias Krüger 2dc88bf88a
Rollup merge of #128133 - nnethercote:fix-cfg_attr-spans, r=petrochenkov
Improve spans on evaluated `cfg_attr`s.

When converting something like `#![cfg_attr(cond, attr)]` into `#![attr]`, we currently duplicate the `#` token and the `!` token. But weirdly, there is also this comment:

// We don't really have a good span to use for the synthesized `[]`
// in `#[attr]`, so just use the span of the `#` token.

Maybe that comment used to be true? But now it is false: we can duplicate the existing delimiters (and their spans and spacing), much like we do for the `#` and `!`.

This commit does that, thus removing the incorrect comment, and improving the spans on `Group`s in a few proc-macro tests.

`@petrochenkov`
2024-07-24 18:00:41 +02:00
..
src Rollup merge of #128133 - nnethercote:fix-cfg_attr-spans, r=petrochenkov 2024-07-24 18:00:41 +02:00
Cargo.toml Move some tests from `rustc_expand` to `rustc_parse`. 2024-05-06 09:06:02 +10:00
messages.ftl delegation: Do not crash on qpaths without a trait 2024-06-22 19:57:19 +03:00