about summary refs log tree commit diff
path: root/tests/ui/impl-trait/call_method_on_inherent_impl.rs
blob: 0e333c3260a2ff5183ba105ec50bdbd923758cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//@ 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]~^ ERROR type annotations needed
        x.my_debug();
    }
    ()
}

fn main() {}