about summary refs log tree commit diff
path: root/tests/ui/methods/self-type-is-sup-no-eq.rs
blob: ec28b964a05183f34681bd46f36124e07761ff5f (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
//@ check-pass

// Test that we use `sup` not `eq` during method probe, since this has an effect
// on the leak check. This is (conceptually) minimized from a crater run for
// `wrend 0.3.6`.

use std::ops::Deref;

struct A;

impl Deref for A {
    type Target = B<dyn Fn(&())>;

    fn deref(&self) -> &<Self as Deref>::Target { todo!() }
}

struct B<T: ?Sized>(T);
impl<T> B<dyn Fn(T)> {
    fn method(&self) {}
}

fn main() {
    A.method();
}