rust/tests/ui/impl-trait/call_method_on_inherent_impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
391 B
Rust
Raw Permalink Normal View History

2024-04-15 06:20:33 -05:00
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@[current] 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();
//[next]~^ type annotations needed
x.my_debug();
}
()
}
fn main() {}