1 // Copyright 2015 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 type MyType<'a, T> = &'a T;
13 // combine lifetime bounds and type arguments in usual way
14 type TypeA<'a> = MyType<'a, ()>;
16 // ensure token `>>` works fine
17 type TypeB = Box<TypeA<'static>>;
18 type TypeB_ = Box<TypeA<'static,>>;
20 // trailing comma when combine lifetime bounds and type arguments
21 type TypeC<'a> = MyType<'a, (),>;
23 // normal lifetime bounds
24 type TypeD = TypeA<'static>;
26 // trailing comma on lifetime bounds
27 type TypeE = TypeA<'static,>;
29 // normal type arugment
30 type TypeF<T> = Box<T>;
32 // type argument with trailing comma
33 type TypeG<T> = Box<T,>;
35 // trailing comma on lifetime defs
36 type TypeH<'a,> = &'a ();
38 // trailing comma on type argument
41 static STATIC: () = ();
45 // ensure token `>=` works fine
46 let _: TypeA<'static>= &STATIC;
47 let _: TypeA<'static,>= &STATIC;
49 // ensure token `>>=` works fine
50 let _: Box<TypeA<'static>>= Box::new(&STATIC);
51 let _: Box<TypeA<'static,>>= Box::new(&STATIC);