]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-74684-2.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / issue-74684-2.rs
1 trait Fun {
2     type F<'a>: ?Sized;
3
4     fn identity<'a>(t: &'a Self::F<'a>) -> &'a Self::F<'a> { t }
5 }
6
7 impl <T> Fun for T {
8     type F<'a> = i32;
9 }
10
11 fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
12     let a = [0; 1];
13     let x = T::identity(&a);
14     todo!()
15 }
16
17
18 fn main() {
19     let x = 10;
20
21     bug(Box::new(x));
22       //~^ ERROR: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
23 }