@@ -15,21 +15,23 @@ struct Point {
15
15
_y : i32 ,
16
16
}
17
17
18
+ #[ derive( PartialEq , Eq , Debug ) ]
19
+ struct Newtype < T > ( T ) ;
20
+
18
21
const STRUCT : Point = Point { _x : 42 , _y : 42 } ;
19
22
const TUPLE1 : ( i32 , i32 ) = ( 42 , 42 ) ;
20
23
const TUPLE2 : ( & ' static str , & ' static str ) = ( "hello" , "world" ) ;
24
+ const PAIR_NEWTYPE : ( Newtype < i32 > , Newtype < i32 > ) = ( Newtype ( 42 ) , Newtype ( 42 ) ) ;
21
25
22
26
#[ rustc_mir]
23
- fn mir ( ) -> ( Point , ( i32 , i32 ) , ( & ' static str , & ' static str ) ) {
27
+ fn mir ( ) -> ( Point , ( i32 , i32 ) , ( & ' static str , & ' static str ) , ( Newtype < i32 > , Newtype < i32 > ) ) {
24
28
let struct1 = STRUCT ;
25
29
let tuple1 = TUPLE1 ;
26
30
let tuple2 = TUPLE2 ;
27
- ( struct1, tuple1, tuple2)
31
+ let pair_newtype = PAIR_NEWTYPE ;
32
+ ( struct1, tuple1, tuple2, pair_newtype)
28
33
}
29
34
30
- #[ derive( PartialEq , Eq , Debug ) ]
31
- struct Newtype < T > ( T ) ;
32
-
33
35
const NEWTYPE : Newtype < & ' static str > = Newtype ( "foobar" ) ;
34
36
35
37
#[ rustc_mir]
@@ -39,7 +41,7 @@ fn test_promoted_newtype_str_ref() {
39
41
}
40
42
41
43
fn main ( ) {
42
- assert_eq ! ( mir( ) , ( STRUCT , TUPLE1 , TUPLE2 ) ) ;
44
+ assert_eq ! ( mir( ) , ( STRUCT , TUPLE1 , TUPLE2 , PAIR_NEWTYPE ) ) ;
43
45
test_promoted_newtype_str_ref ( ) ;
44
46
}
45
47
0 commit comments