]> git.proxmox.com Git - rustc.git/blame - src/test/pretty/issue-4264.pp
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / pretty / issue-4264.pp
CommitLineData
1a4d82fc
JJ
1#[prelude_import]
2use std::prelude::v1::*;
85aaf69f 3#[macro_use]
c34b1796 4extern crate std as std;
1a4d82fc
JJ
5// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
6// file at the top-level directory of this distribution and at
7// http://rust-lang.org/COPYRIGHT.
8//
9// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
10// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
11// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
12// option. This file may not be copied, modified, or distributed
13// except according to those terms.
14
15// pretty-compare-only
e9174d1e 16// pretty-mode:hir,typed
1a4d82fc
JJ
17// pp-exact:issue-4264.pp
18
19// #4264 fixed-length vector types
20
476ff2be 21pub fn foo(_: [i32; (3 as usize)]) ({ } as ())
1a4d82fc 22
476ff2be
SL
23pub fn bar() ({
24 const FOO: usize = ((5 as usize) - (4 as usize) as usize);
25 let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
1a4d82fc 26
476ff2be 27 let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
1a4d82fc 28
476ff2be
SL
29 let _ =
30 (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3])
31 as &[i32; 3]) as *const _ as *const [i32; 3]) as
32 *const [i32; (3 as usize)] as *const [i32; 3]);
1a4d82fc
JJ
33
34
35
36
37
38
39
40
476ff2be 41
32a655c1 42 ((::fmt::format as
abe05a73
XL
43 for<'r> fn(std::fmt::Arguments<'r>) -> std::string::String {std::fmt::format})(((<::std::fmt::Arguments>::new_v1
44 as
45 fn(&[&str], &[std::fmt::ArgumentV1<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments<'_>::new_v1})((&([("test"
46 as
47 &'static str)]
48 as
49 [&str; 1])
50 as
51 &[&str; 1]),
52 (&(match (()
53 as
54 ())
55 {
56 ()
57 =>
58 ([]
59 as
60 [std::fmt::ArgumentV1<'_>; 0]),
61 }
62 as
63 [std::fmt::ArgumentV1<'_>; 0])
64 as
65 &[std::fmt::ArgumentV1<'_>; 0]))
66 as
67 std::fmt::Arguments<'_>))
476ff2be
SL
68 as std::string::String);
69 } as ())
85aaf69f 70pub type Foo = [i32; (3 as usize)];
1a4d82fc 71pub struct Bar {
85aaf69f 72 pub x: [i32; (3 as usize)],
1a4d82fc 73}
85aaf69f
SL
74pub struct TupleBar([i32; (4 as usize)]);
75pub enum Baz { BazVariant([i32; (5 as usize)]), }
476ff2be
SL
76pub fn id<T>(x: T) -> T ({ (x as T) } as T)
77pub fn use_id() ({
78 let _ =
79 ((id::<[i32; (3 as usize)]> as
80 fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1
81 as
82 i32),
83 (2
84 as
85 i32),
86 (3
87 as
88 i32)]
89 as
90 [i32; 3]))
91 as [i32; 3]);
92 } as ())
93fn main() ({ } as ())