]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20616.rs
rustdoc: Remove unused Clean impls
[rust.git] / src / test / ui / issues / issue-20616.rs
1 // run-pass
2 #![allow(dead_code)]
3 type MyType<'a, T> = &'a T;
4
5 // combine lifetime bounds and type arguments in usual way
6 type TypeA<'a> = MyType<'a, ()>;
7
8 // ensure token `>>` works fine
9 type TypeB = Box<TypeA<'static>>;
10 type TypeB_ = Box<TypeA<'static,>>;
11
12 // trailing comma when combine lifetime bounds and type arguments
13 type TypeC<'a> = MyType<'a, (),>;
14
15 // normal lifetime bounds
16 type TypeD = TypeA<'static>;
17
18 // trailing comma on lifetime bounds
19 type TypeE = TypeA<'static,>;
20
21 // normal type argument
22 type TypeF<T> = Box<T>;
23
24 // type argument with trailing comma
25 type TypeG<T> = Box<T,>;
26
27 // trailing comma on lifetime defs
28 type TypeH<'a,> = &'a ();
29
30 // trailing comma on type argument
31 type TypeI<T,> = T;
32
33 static STATIC: () = ();
34
35 fn main() {
36
37     // ensure token `>=` works fine
38     let _: TypeA<'static>= &STATIC;
39     let _: TypeA<'static,>= &STATIC;
40
41     // ensure token `>>=` works fine
42     let _: Box<TypeA<'static>>= Box::new(&STATIC);
43     let _: Box<TypeA<'static,>>= Box::new(&STATIC);
44 }