mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-01 01:08:33 +00:00
18 lines
288 B
Rust
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);
|
|
}
|