1 // Copyright 2016 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.
10 #![feature(rustc_attrs)]
12 #[derive(PartialEq, Debug)]
18 #[derive(PartialEq, Eq, Debug)]
21 const STRUCT: Point = Point { _x: 42, _y: 42 };
22 const TUPLE1: (i32, i32) = (42, 42);
23 const TUPLE2: (&'static str, &'static str) = ("hello","world");
24 const PAIR_NEWTYPE: (Newtype<i32>, Newtype<i32>) = (Newtype(42), Newtype(42));
27 fn mir() -> (Point, (i32, i32), (&'static str, &'static str), (Newtype<i32>, Newtype<i32>)) {
31 let pair_newtype = PAIR_NEWTYPE;
32 (struct1, tuple1, tuple2, pair_newtype)
35 const NEWTYPE: Newtype<&'static str> = Newtype("foobar");
38 fn test_promoted_newtype_str_ref() {
40 assert_eq!(x, &Newtype("foobar"));
44 assert_eq!(mir(), (STRUCT, TUPLE1, TUPLE2, PAIR_NEWTYPE));
45 test_promoted_newtype_str_ref();