rust/crates
bors cee1e157d7 Auto merge of #12993 - lowr:patch/swap-name-and-escaped-name, r=Veykril
Make `Name` hold escaped name

Resolves #12787
Resolves rust-lang/rust#99361

This PR effectively swaps `Name` and `EscapedName` in hir. In other words, it makes `Name` hold and print escaped raw identifiers and introduces another struct `UnescapedName` for cases where you need to print names without "r#" prefix.

My rationale is that it makes it easier for us to format an escaped name into string, which is what we want when we serialize names in general. This is because we format a name into string usually when we are presenting it to the users and arguably they expect its escaped form as that's what they see and write in the source code.

I split the change for `Name` into 3 commits to make it easier to follow but it also made some tests fail in the intermediate commits. I can squash them into a commit after the review if desired. I've also made similar changes for `ModPath` and `EscapedModPath` as it makes them consistent with `Name`.

For reference, there was a brief discussion on this in [a zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/escaping.20.60Name.60s).
2022-08-12 14:53:45 +00:00
..
base-db remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
cfg Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
flycheck Auto merge of #12808 - Veykril:check-workspace, r=Veykril 2022-08-04 12:57:04 +00:00
hir Fix panic in no_such_field when using tuple fields on record structs 2022-08-11 10:41:30 +02:00
hir-def Make tests pass 2022-08-11 01:16:35 +09:00
hir-expand Make ModPath display escaped path 2022-08-11 03:41:10 +09:00
hir-ty fix: infer byte string pattern as &[u8] when matched against slices 2022-08-10 19:17:13 +09:00
ide Add test for runnables with raw identifiers 2022-08-11 03:41:23 +09:00
ide-assists Fixes tests 2022-08-10 16:29:23 +08:00
ide-completion Make ModPath display escaped path 2022-08-11 03:41:10 +09:00
ide-db remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
ide-diagnostics Fix panic in no_such_field when using tuple fields on record structs 2022-08-11 10:41:30 +02:00
ide-ssr Fix r-a spelling in some places 2022-08-01 13:47:09 +02:00
limit Properly cfg the max field of Limit 2022-07-31 19:27:20 +02:00
mbe Improve insert whitespace in mbe 2022-08-10 16:28:56 +08:00
parser Recover from missing ellipsis in record literals for path expressions 2022-08-09 18:23:25 +02:00
paths Auto merge of #12808 - Veykril:check-workspace, r=Veykril 2022-08-04 12:57:04 +00:00
proc-macro-api remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
proc-macro-srv Auto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril 2022-08-10 14:53:21 +00:00
proc-macro-srv-cli Gate and rename binary, use it if it's in the sysroot 2022-07-25 16:22:39 +02:00
proc-macro-test revert nightly rustfmt formatting that accidentally slipped in 2022-07-25 14:18:30 +02:00
profile Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
project-model Re-try build script building with --keep-going 2022-08-10 10:23:46 +02:00
rust-analyzer Use --keep-going cargo flag when building build scripts 2022-08-09 14:31:17 +02:00
sourcegen run stable fmt through rustup 2022-08-06 17:25:02 +03:00
stdx Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
syntax remove imports that are also in edition 2021's prelude 2022-08-09 01:16:32 +02:00
test-utils Don't run slow tests in Rust CI, only RA CI 2022-07-24 10:38:19 +02:00
text-edit Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
toolchain Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
tt Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
vfs Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
vfs-notify Don't switch workspace on vfs file changes from libraries 2022-08-05 12:06:42 +02:00