]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-74684-2.rs
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[rust.git] / src / test / ui / generic-associated-types / issue-74684-2.rs
1 #![feature(generic_associated_types)]
2   //~^ WARNING: the feature `generic_associated_types` is incomplete
3
4 trait Fun {
5     type F<'a>: ?Sized;
6
7     fn identity<'a>(t: &'a Self::F<'a>) -> &'a Self::F<'a> { t }
8 }
9
10 impl <T> Fun for T {
11     type F<'a> = i32;
12 }
13
14 fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
15     let a = [0; 1];
16     let x = T::identity(&a);
17     todo!()
18 }
19
20
21 fn main() {
22     let x = 10;
23
24     bug(Box::new(x));
25       //~^ ERROR: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
26 }