]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/issues/issue-20616.rs
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.
13 type MyType
<'a
, T
> = &'a T
;
15 // combine lifetime bounds and type arguments in usual way
16 type TypeA
<'a
> = MyType
<'a
, ()>;
18 // ensure token `>>` works fine
19 type TypeB
= Box
<TypeA
<'
static>>;
20 type TypeB_
= Box
<TypeA
<'
static,>>;
22 // trailing comma when combine lifetime bounds and type arguments
23 type TypeC
<'a
> = MyType
<'a
, (),>;
25 // normal lifetime bounds
26 type TypeD
= TypeA
<'
static>;
28 // trailing comma on lifetime bounds
29 type TypeE
= TypeA
<'
static,>;
31 // normal type argument
32 type TypeF
<T
> = Box
<T
>;
34 // type argument with trailing comma
35 type TypeG
<T
> = Box
<T
,>;
37 // trailing comma on lifetime defs
38 type TypeH
<'a
,> = &'
a ();
40 // trailing comma on type argument
43 static STATIC
: () = ();
47 // ensure token `>=` works fine
48 let _
: TypeA
<'
static>= &STATIC
;
49 let _
: TypeA
<'
static,>= &STATIC
;
51 // ensure token `>>=` works fine
52 let _
: Box
<TypeA
<'
static>>= Box
::new(&STATIC
);
53 let _
: Box
<TypeA
<'
static,>>= Box
::new(&STATIC
);