]> git.lizzy.rs Git - rust.git/blob - tests/target/type.rs
Merge pull request #1666 from topecongiro/tuple-type
[rust.git] / tests / target / type.rs
1 // rustfmt-normalize_comments: true
2 fn types() {
3     let x: [Vec<_>] = [];
4     let y: *mut [SomeType; konst_funk()] = expr();
5     let z: (
6         // #digits
7         usize,
8         // exp
9         i16,
10     ) = funk();
11     let z: (usize /* #digits */, i16 /* exp */) = funk();
12 }
13
14 struct F {
15     f: extern "C" fn(x: u8, ... /* comment */),
16     g: extern "C" fn(x: u8,
17                      // comment
18                      ...),
19     h: extern "C" fn(x: u8, ...),
20     i: extern "C" fn(x: u8,
21                      // comment 4
22                      y: String, // comment 3
23                      z: Foo,
24                      // comment
25                      ... /* comment 2 */),
26 }
27
28 fn issue_1006(def_id_to_string: for<'a, 'b> unsafe fn(TyCtxt<'b, 'tcx, 'tcx>, DefId) -> String) {}
29
30 fn impl_trait_fn_1() -> impl Fn(i32) -> Option<u8> {}
31
32 fn impl_trait_fn_2<E>() -> impl Future<Item = &'a i64, Error = E> {}
33
34 fn issue_1234() {
35     do_parse!(name: take_while1!(is_token) >> (Header))
36 }