]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-74684-1.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / issue-74684-1.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> = [u8];
9 }
10
11 fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(_ : Box<T>) -> &'static T::F<'a> {
12     let a = [0; 1];
13     let _x = T::identity(&a);
14       //~^ ERROR: `a` does not live long enough
15     todo!()
16 }
17
18
19 fn main() {
20     let x = 10;
21
22     bug(Box::new(x));
23 }