Files
rust/tests/ui
Trevor Gross 73d3adc67b Rollup merge of #141996 - Daniel-Aaron-Bloom:dollar_crate, r=petrochenkov
Fix `proc_macro::Ident`'s handling of `$crate`

This PR is addresses a few minor bugs, all relating to `proc_macro::Ident`'s support for `$crate`. `Ident` currently supports `$crate` (as can be seen in the `mixed-site-span` test), but:
* `proc_macro::Symbol::can_be_raw` is out of sync with `rustc_span::Symbol::can_be_raw`
  * former doesn't cover `$crate` while the latter does cover `kw::DollarCrate`
* `Ident::new` rejects `$crate`
  * This conflicts with the [reference definition](https://doc.rust-lang.org/nightly/reference/macros-by-example.html#r-macro.decl.meta.specifier) of `ident` which includes `$crate`.
  * This also conflicts with the documentation on [`Display for Ident`](https://doc.rust-lang.org/proc_macro/struct.Ident.html#impl-Display-for-Ident) which says the output "should be losslessly convertible back into the same identifier".

This PR fixes the above issues and extends the `mixed-site-span` test to exercise these fixed code paths, as well as validating the different possible spans resolve `$crate`  as expected (for both the new and old `$crate` construction code paths).
2025-07-10 03:23:52 -04:00
..
2025-07-05 00:45:24 +05:00
2025-06-11 15:30:15 +01:00
2025-07-05 00:45:24 +05:00
2025-05-21 07:24:43 +00:00
2025-06-11 17:49:03 +05:00
2025-07-01 15:16:56 +05:00
2025-07-01 15:29:29 +05:00
2025-06-18 10:20:43 +02:00
2025-07-05 00:45:24 +05:00
2025-07-05 01:54:04 +05:00
2025-07-05 01:54:04 +05:00
2025-06-16 07:30:09 -04:00
2025-06-30 20:36:16 +02:00
2025-07-06 09:51:35 +02:00
2025-06-06 20:52:34 +00:00
2025-05-31 19:49:19 +05:00
2025-06-11 20:51:49 +05:00
2025-06-29 15:37:33 +05:00
2025-07-07 08:13:12 +00:00
2025-06-13 01:16:36 +02:00
2025-06-03 11:45:58 +02:00
2025-06-18 10:20:43 +02:00
2025-06-18 10:20:43 +02:00
2025-07-01 14:36:28 +02:00
2025-07-05 00:45:24 +05:00
2025-07-01 16:26:57 +05:00
2025-07-01 15:16:56 +05:00
2025-06-03 07:38:06 +05:00
2025-07-05 00:50:51 +05:00
2025-07-05 00:45:24 +05:00
2025-06-11 15:30:15 +01:00
2025-07-06 09:51:35 +02:00
2025-06-08 11:25:09 +05:00
2025-07-05 01:54:04 +05:00
2025-07-05 01:54:04 +05:00
2025-07-01 19:00:21 +00:00
2025-07-07 08:13:12 +00:00
2025-07-07 08:13:12 +00:00
2025-06-30 13:33:51 +10:00
2025-07-05 00:45:24 +05:00
2025-07-05 01:25:48 +05:00
2025-06-30 11:50:19 +05:00
2025-06-26 18:11:14 +00:00
2025-07-05 01:54:04 +05:00
2025-03-27 14:11:11 +01:00
2025-07-01 15:16:56 +05:00
2025-06-28 17:04:16 +05:00
2025-06-18 10:20:43 +02:00
2025-07-07 08:13:12 +00:00
2025-04-25 20:50:57 +09:00
2025-07-05 00:50:51 +05:00
2025-06-08 03:44:44 +05:00
2025-06-18 10:20:43 +02:00
2025-04-03 21:41:58 +00:00
2025-02-04 21:42:43 +05:30
2025-07-04 23:04:56 +08:00
2025-07-01 19:00:21 +00:00
2025-04-04 16:32:18 +02:00