rust/compiler/rustc_expand/src
Nicholas Nethercote ac26b883bf Improve spans on evaluated cfg_attrs.
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.
2024-07-24 21:03:52 +10:00
..
mbe Allow concat in repetitions 2024-07-19 21:00:46 -03:00
base.rs Rollup merge of #124135 - petrochenkov:deleglob, r=fmease 2024-06-19 01:51:36 +01: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 Rollup merge of #126177 - carbotaniuman:unsafe_attr_errors, r=jieyouxu 2024-06-24 06:27:12 +02: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 Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
proc_macro_server.rs Prefer dcx methods over fields or fields' methods 2024-06-18 13:45:08 +00:00
proc_macro.rs Remove stream_to_parser. 2024-06-05 10:37:59 +10:00