about summary refs log tree commit diff
path: root/tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs
blob: 40739d6a0ce4b7c6c75e9cab513b529a53757972 (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
//@ 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_bar() -> impl std::fmt::Debug {
    if false {
        let x = &my_bar();
        x.my_debug();
    }
    ()
}

fn main() {}