1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(generic_associated_types)]
12 //~^ WARNING the feature `generic_associated_types` is incomplete
13 #![feature(associated_type_defaults)]
15 // FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
18 // FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`.
26 // Test parameters in default values
27 type FOk<T> = Self::E<'static, T>;
28 //~^ ERROR type parameters are not allowed on this type [E0109]
29 //~| ERROR lifetime parameters are not allowed on this type [E0110]
30 type FErr1 = Self::E<'static, 'static>; // Error
31 //~^ ERROR lifetime parameters are not allowed on this type [E0110]
32 type FErr2<T> = Self::E<'static, T, u32>; // Error
33 //~^ ERROR type parameters are not allowed on this type [E0109]
34 //~| ERROR lifetime parameters are not allowed on this type [E0110]
40 type A = u32; // Error: parameter expected
41 type B<'a, T> = Vec<T>; // Error: lifetime param expected
42 type C<'a> = u32; // Error: no param expected
43 type D<'a> = u32; // Error: type param expected
44 type E<T, U> = u32; // Error: lifetime expected as the first param
50 type A<T> = u32; // Error: lifetime parameter expected
51 type B<'a> = u32; // Error: another lifetime param expected
52 type C<T> = T; // Error: no param expected
53 type D<'b, T> = u32; // Error: unexpected lifetime param
54 type E<'a, 'b> = u32; // Error: type expected as the second param