blob: c6e38c0758d71f7fc2e3bdfd7fc458fc55d737e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/// 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);
}
|