]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-57362-2.rs
modify leak-check to track only outgoing edges from placeholders
[rust.git] / src / test / ui / issues / issue-57362-2.rs
1 // Test for issue #57362, ensuring that the self ty is shown in cases of higher-ranked lifetimes
2 // conflicts: the `expected` and `found` trait refs would otherwise be printed the same, leading
3 // to confusing notes such as:
4 //  = note: expected type `Trait`
5 //             found type `Trait`
6
7 // extracted from a similar issue: #57642
8 trait X {
9     type G;
10     fn make_g() -> Self::G;
11 }
12
13 impl<'a> X for fn(&'a ()) {
14     type G = &'a ();
15
16     fn make_g() -> Self::G {
17         &()
18     }
19 }
20
21 fn g() {
22     let x = <fn (&())>::make_g();
23     //~^ ERROR implementation of `X` is not general enough
24     //~| ERROR implementation of `X` is not general enough
25 }
26
27 fn main() {}