]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1598-generic-associated-types/shadowing.rs
Auto merge of #63462 - matthewjasper:hygienic-builtin-derives, r=petrochenkov
[rust.git] / src / test / ui / rfc1598-generic-associated-types / shadowing.rs
1 #![allow(incomplete_features)]
2 #![feature(generic_associated_types)]
3
4 trait Shadow<'a> {
5     //FIXME(#44265): The lifetime parameter shadowing should cause an error.
6     type Bar<'a>;
7 }
8
9 trait NoShadow<'a> {
10     type Bar<'b>; // OK
11 }
12
13 impl<'a> NoShadow<'a> for &'a u32 {
14     //FIXME(#44265): The lifetime parameter shadowing should cause an error.
15     type Bar<'a> = i32;
16 }
17
18 trait ShadowT<T> {
19     type Bar<T>; //~ ERROR the name `T` is already used
20 }
21
22 trait NoShadowT<T> {
23     type Bar<U>; // OK
24 }
25
26 impl<T> NoShadowT<T> for Option<T> {
27     type Bar<T> = i32; //~ ERROR the name `T` is already used
28 }
29
30 fn main() {}