]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/shadowing.rs
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[rust.git] / src / test / ui / generic-associated-types / shadowing.rs
1 #![allow(incomplete_features)]
2 #![feature(generic_associated_types)]
3
4 trait Shadow<'a> {
5     type Bar<'a>;
6     //~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope
7 }
8
9 trait NoShadow<'a> {
10     type Bar<'b>; // OK
11 }
12
13 impl<'a> NoShadow<'a> for &'a u32 {
14     type Bar<'a> = i32;
15     //~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope
16 }
17
18 trait ShadowT<T> {
19     type Bar<T>;
20     //~^ ERROR the name `T` is already used
21 }
22
23 trait NoShadowT<T> {
24     type Bar<U>; // OK
25 }
26
27 impl<T> NoShadowT<T> for Option<T> {
28     type Bar<T> = i32;
29     //~^ ERROR the name `T` is already used
30 }
31
32 fn main() {}