about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-12 14:53:45 +0000
committerbors <bors@rust-lang.org>2022-08-12 14:53:45 +0000
commitcee1e157d74fe4b00e7764ca97c58c7c9f0d93c2 (patch)
tree80134953cc4d1956d7bfd46a9dea4c21a1e6b27d /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent696bee324677d1ae3cb6b9454b33301adfc1077e (diff)
parentba6db3e9b054902549a0cf487cd7f69db2654aa1 (diff)
downloadrust-cee1e157d74fe4b00e7764ca97c58c7c9f0d93c2.tar.gz
rust-cee1e157d74fe4b00e7764ca97c58c7c9f0d93c2.zip
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).
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions