Closed
Description
I understand debug formatting is generally unstable, but wanted to raise this to make sure the change was intentional.
Code
I tried this test:
#[test]
fn quote_not_printable() {
assert_eq!(format!("{:?}", "foo\0bar"), r#""foo\u{0}bar""#);
}
This test passes with stable Rust 1.60.0 (7737e0b 2022-04-04) (the release candidate that's going to be released tomorrow)
I expected this test to continue passing with 1.61.0-beta.1
Instead, I get this failure:
---- quote_not_printable stdout ----
thread 'quote_not_printable' panicked at 'assertion failed: `(left == right)`
left: `"\"foo\\0bar\""`,
right: `"\"foo\\u{0}bar\""`', src/lib.rs:3:5
Version it worked on
It most recently worked on: stable release candidate 1.60.0 (7737e0b 2022-04-04)
Version with regression
rustc --version --verbose
:
rustc 1.61.0-beta.1 (0f231250b 2022-04-05)
binary: rustc
commit-hash: 0f231250ba7fe3a3f98a18aee9abfd65b104fb92
commit-date: 2022-04-05
host: aarch64-apple-darwin
release: 1.61.0-beta.1
LLVM version: 14.0.0
@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged