rust/compiler/rustc_expand/src
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
..
mbe Always pass the visitor as the first argument to walk* functions 2024-07-22 14:01:24 +00:00
base.rs Merge impl and trait item mut visitor methods to mirror immut visitor 2024-07-22 14:01:23 +00:00
build.rs Fix formatting 2024-06-06 20:27:25 -05:00
config.rs Improve spans on evaluated cfg_attrs. 2024-07-24 21:03:52 +10:00
errors.rs delegation: Do not crash on qpaths without a trait 2024-06-22 19:57:19 +03:00
expand.rs Avoid passing state that will not be visited 2024-07-22 14:34:45 +00:00
lib.rs Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
mbe.rs Add some comments. 2024-05-23 06:03:17 +10:00
module.rs Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
placeholders.rs Avoid passing state that will not be visited 2024-07-22 14:34:45 +00:00
proc_macro.rs Remove stream_to_parser. 2024-06-05 10:37:59 +10:00
proc_macro_server.rs Prefer dcx methods over fields or fields' methods 2024-06-18 13:45:08 +00:00