rust/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-ref-impl.rs

18 lines
288 B
Rust

/// Check that only `&X: Debug` is required, not `X: Debug`
//@check-pass
use std::fmt::Debug;
use std::fmt::Formatter;
struct X;
impl Debug for &X {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
f.write_str("X")
}
}
fn main() {
dbg!(X);
}