]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-57362-2.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[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(); //~ ERROR the function
23 }
24
25 fn main() {}