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 #![feature(associated_type_defaults)]
14 //FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
17 //FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`
25 // Test parameters in default values
26 type FOk<T> = Self::E<'static, T>;
27 //~^ ERROR type parameters are not allowed on this type [E0109]
28 //~| ERROR lifetime parameters are not allowed on this type [E0110]
29 type FErr1 = Self::E<'static, 'static>; // Error
30 //~^ ERROR lifetime parameters are not allowed on this type [E0110]
31 type FErr2<T> = Self::E<'static, T, u32>; // Error
32 //~^ ERROR type parameters are not allowed on this type [E0109]
33 //~| ERROR lifetime parameters are not allowed on this type [E0110]
39 type A = u32; // Error: parameter expected
40 type B<'a, T> = Vec<T>; // Error: lifetime param expected
41 type C<'a> = u32; // Error: no param expected
42 type D<'a> = u32; // Error: type param expected
43 type E<T, U> = u32; // Error: lifetime expected as the first param
49 type A<T> = u32; // Error: lifetime parameter expected
50 type B<'a> = u32; // Error: another lifetime param expected
51 type C<T> = T; // Error: no param expected
52 type D<'b, T> = u32; // Error: unexpected lifetime param
53 type E<'a, 'b> = u32; // Error: type expected as the second param