1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
//@ revisions: current next //@[next] compile-flags: -Znext-solver //@ check-pass trait MyDebug { fn my_debug(&self); } impl<T> MyDebug for T where T: std::fmt::Debug, { fn my_debug(&self) {} } fn my_foo() -> impl std::fmt::Debug { if false { let x = my_foo(); x.my_debug(); } () } fn main() {}