]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-87748.rs
Rollup merge of #88286 - LeSeulArtichaut:unnecessary-unsafe-block-std, r=dtolnay
[rust.git] / src / test / ui / generic-associated-types / issue-87748.rs
1 // Checks that we properly add implied bounds from unnormalized projections in
2 // inputs when typechecking functions.
3
4 // check-pass
5
6 #![feature(generic_associated_types)]
7
8 trait MyTrait {
9     type Assoc<'a, 'b> where 'b: 'a;
10     fn do_sth(arg: Self::Assoc<'_, '_>);
11 }
12
13 struct A;
14 struct B;
15 struct C;
16
17 impl MyTrait for A {
18     type Assoc<'a, 'b> where 'b: 'a = u32;
19     fn do_sth(_: u32) {}
20 }
21 impl MyTrait for B {
22     type Assoc<'a, 'b> where 'b: 'a = u32;
23     fn do_sth(_: Self::Assoc<'_, '_>) {}
24 }
25 impl MyTrait for C {
26     type Assoc<'a, 'b> where 'b: 'a = u32;
27     fn do_sth(_: Self::Assoc<'static, 'static>) {}
28 }
29
30 fn main () {}