5 extern crate std = "std";
6 extern crate rt = "native";
8 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
9 // file at the top-level directory of this distribution and at
10 // http://rust-lang.org/COPYRIGHT.
12 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
13 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
14 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
15 // option. This file may not be copied, modified, or distributed
16 // except according to those terms.
18 // pretty-compare-only
20 // pp-exact:issue-4264.pp
22 // #4264 fixed-length vector types
24 pub fn foo(_: [int, ..(3 as uint)]) { }
27 static FOO: uint = ((5u as uint) - (4u as uint) as uint);
28 let _: [(), ..(FOO as uint)] = ([(() as ())] as [(), .. 1]);
30 let _: [(), ..(1u as uint)] = ([(() as ())] as [(), .. 1]);
33 (((&((([(1i as int), (2 as int), (3 as int)] as [int, .. 3])) as
34 [int, .. 3]) as &[int, .. 3]) as *const _ as
35 *const [int, .. 3]) as *const [int, ..(3u as uint)] as
41 static __STATIC_FMTSTR:
42 [::std::fmt::rt::Piece<'static>, ..(1u as uint)] =
43 ([((::std::fmt::rt::String as
44 fn(&'static str) -> core::fmt::rt::Piece<'static>)(("test"
47 as core::fmt::rt::Piece<'static>)] as
48 [core::fmt::rt::Piece<'static>, .. 1]);
50 (&([] as &'static [core::fmt::Argument<'static>]) as
51 &'static [core::fmt::Argument<'static>]);
54 ((::std::fmt::Arguments::new as
55 unsafe fn(&'static [core::fmt::rt::Piece<'static>], &'a [core::fmt::Argument<'a>]) -> core::fmt::Arguments<'a>)((__STATIC_FMTSTR
57 [core::fmt::rt::Piece<'static>, .. 1]),
60 &'static [core::fmt::Argument<'static>]))
61 as core::fmt::Arguments<'static>)
62 } as core::fmt::Arguments<'static>);
71 ((::std::fmt::format as
72 fn(&core::fmt::Arguments<'_>) -> collections::string::String)((&(__args
74 core::fmt::Arguments<'static>)
76 &core::fmt::Arguments<'static>))
77 as collections::string::String)
79 } as collections::string::String);
81 pub type Foo = [int, ..(3u as uint)];
83 pub x: [int, ..(3u as uint)],
85 pub struct TupleBar([int, ..(4u as uint)]);
86 pub enum Baz { BazVariant([int, ..(5u as uint)]), }
87 pub fn id<T>(x: T) -> T { (x as T) }
90 ((id::<[int, ..(3u as uint)]> as
91 fn([int, .. 3]) -> [int, .. 3])(([(1 as int), (2 as int),
92 (3 as int)] as [int, .. 3])) as