@@ -15,21 +15,23 @@ struct Point {
1515 _y : i32 ,
1616}
1717
18+ #[ derive( PartialEq , Eq , Debug ) ]
19+ struct Newtype < T > ( T ) ;
20+
1821const STRUCT : Point = Point { _x : 42 , _y : 42 } ;
1922const TUPLE1 : ( i32 , i32 ) = ( 42 , 42 ) ;
2023const TUPLE2 : ( & ' static str , & ' static str ) = ( "hello" , "world" ) ;
24+ const PAIR_NEWTYPE : ( Newtype < i32 > , Newtype < i32 > ) = ( Newtype ( 42 ) , Newtype ( 42 ) ) ;
2125
2226#[ 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 > ) ) {
2428 let struct1 = STRUCT ;
2529 let tuple1 = TUPLE1 ;
2630 let tuple2 = TUPLE2 ;
27- ( struct1, tuple1, tuple2)
31+ let pair_newtype = PAIR_NEWTYPE ;
32+ ( struct1, tuple1, tuple2, pair_newtype)
2833}
2934
30- #[ derive( PartialEq , Eq , Debug ) ]
31- struct Newtype < T > ( T ) ;
32-
3335const NEWTYPE : Newtype < & ' static str > = Newtype ( "foobar" ) ;
3436
3537#[ rustc_mir]
@@ -39,7 +41,7 @@ fn test_promoted_newtype_str_ref() {
3941}
4042
4143fn main ( ) {
42- assert_eq ! ( mir( ) , ( STRUCT , TUPLE1 , TUPLE2 ) ) ;
44+ assert_eq ! ( mir( ) , ( STRUCT , TUPLE1 , TUPLE2 , PAIR_NEWTYPE ) ) ;
4345 test_promoted_newtype_str_ref ( ) ;
4446}
4547
0 commit comments