Files
rust/tests/ui/impl-trait/call_method_on_inherent_impl.rs
2025-09-26 16:33:15 +02:00

25 lines
339 B
Rust

//@ 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() {}