rust/library
Matthias Krüger 20ca54b6a6
Rollup merge of #123769 - dtolnay:literal, r=fee1-dead
Improve escaping of byte, byte str, and c str proc-macro literals

This PR changes the behavior of `proc_macro::Literal::byte_character` (https://github.com/rust-lang/rust/issues/115268), `byte_string`, and `c_string` (https://github.com/rust-lang/rust/issues/119750) to improve their choice of escape sequences. 3 categories of changes are made:

1. Never use `\x00`. Always prefer `\0`, which is supported in all the same places.

2. Never escape `\'` inside double quotes and `\"` inside single quotes.

3. Never use `\x` for valid UTF-8 in literals that permit `\u`.

The second commit adds tests covering these cases, asserting the **old** behavior.

The third commit implements the behavior change and simultaneously updates the tests to assert the **new** behavior.
2024-06-14 12:23:35 +02:00
..
alloc remove cfg(bootstrap) 2024-06-11 16:52:04 +02:00
backtrace@72265bea21 Update backtrace to 0.3.73 2024-06-06 22:50:45 -07:00
core Rollup merge of #126402 - firefighterduck:fix-unsafe-precon-copy, r=Nilstrieb 2024-06-13 22:55:49 +02:00
panic_abort
panic_unwind
portable-simd Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu 2024-06-05 01:14:29 -07:00
proc_macro Remove superfluous escaping from byte, byte str, and c str literals 2024-06-13 09:49:15 -07:00
profiler_builtins Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #123726 - jieyouxu:command-new-docs, r=Nilstrieb 2024-06-13 22:55:44 +02:00
stdarch@df3618d9f3 feat: update stdarch submodule for intrinsics on ARM 2024-05-15 15:38:58 -04:00
sysroot Add flag to sysroot 2024-05-11 14:31:55 +02:00
test Rename std::panic::PanicInfo to PanicHookInfo. 2024-06-11 15:47:00 +02:00
unwind Fix unwinding on 32-bit watchOS ARM 2024-05-05 15:41:55 +02:00