rust/tests/ui/fmt/fmt_debug/full.rs
Kornel 88b9edc9db
fmt-debug option
Allows disabling `fmt::Debug` derive and debug formatting.
2024-08-28 23:32:40 +01:00

16 lines
321 B
Rust

//@ compile-flags: -Zfmt-debug=full
//@ run-pass
#![feature(fmt_debug)]
#![allow(dead_code)]
#![allow(unused)]
#[derive(Debug)]
struct Foo {
bar: u32,
}
fn main() {
let s = format!("Still works: {:?} '{:?}'", cfg!(fmt_debug = "full"), Foo { bar: 1 });
assert_eq!("Still works: true 'Foo { bar: 1 }'", s);
}