44use std:: assert_matches:: assert_matches;
55
66use either:: { Either , Left , Right } ;
7+ use rustc_abi as abi;
8+ use rustc_abi:: { Abi , HasDataLayout , Size } ;
79use rustc_hir:: def:: Namespace ;
810use rustc_middle:: mir:: interpret:: ScalarSizeMismatch ;
911use rustc_middle:: ty:: layout:: { HasParamEnv , HasTyCtxt , LayoutOf , TyAndLayout } ;
1012use rustc_middle:: ty:: print:: { FmtPrinter , PrettyPrinter } ;
1113use rustc_middle:: ty:: { ConstInt , ScalarInt , Ty , TyCtxt } ;
1214use rustc_middle:: { bug, mir, span_bug, ty} ;
13- use rustc_target:: abi:: { self , Abi , HasDataLayout , Size } ;
1415use tracing:: trace;
1516
1617use super :: {
@@ -117,7 +118,7 @@ impl<Prov: Provenance> Immediate<Prov> {
117118 match ( self , abi) {
118119 ( Immediate :: Scalar ( scalar) , Abi :: Scalar ( s) ) => {
119120 assert_eq ! ( scalar. size( ) , s. size( cx) , "{msg}: scalar value has wrong size" ) ;
120- if !matches ! ( s. primitive( ) , abi:: Pointer ( ..) ) {
121+ if !matches ! ( s. primitive( ) , abi:: Primitive :: Pointer ( ..) ) {
121122 // This is not a pointer, it should not carry provenance.
122123 assert ! (
123124 matches!( scalar, Scalar :: Int ( ..) ) ,
@@ -131,7 +132,7 @@ impl<Prov: Provenance> Immediate<Prov> {
131132 a. size( cx) ,
132133 "{msg}: first component of scalar pair has wrong size"
133134 ) ;
134- if !matches ! ( a. primitive( ) , abi:: Pointer ( ..) ) {
135+ if !matches ! ( a. primitive( ) , abi:: Primitive :: Pointer ( ..) ) {
135136 assert ! (
136137 matches!( a_val, Scalar :: Int ( ..) ) ,
137138 "{msg}: first component of scalar pair should be an integer, but has provenance"
@@ -142,7 +143,7 @@ impl<Prov: Provenance> Immediate<Prov> {
142143 b. size( cx) ,
143144 "{msg}: second component of scalar pair has wrong size"
144145 ) ;
145- if !matches ! ( b. primitive( ) , abi:: Pointer ( ..) ) {
146+ if !matches ! ( b. primitive( ) , abi:: Primitive :: Pointer ( ..) ) {
146147 assert ! (
147148 matches!( b_val, Scalar :: Int ( ..) ) ,
148149 "{msg}: second component of scalar pair should be an integer, but has provenance"
@@ -572,7 +573,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
572573 assert_eq ! ( size, mplace. layout. size, "abi::Scalar size does not match layout size" ) ;
573574 let scalar = alloc. read_scalar (
574575 alloc_range ( Size :: ZERO , size) ,
575- /*read_provenance*/ matches ! ( s, abi:: Pointer ( _) ) ,
576+ /*read_provenance*/ matches ! ( s, abi:: Primitive :: Pointer ( _) ) ,
576577 ) ?;
577578 Some ( ImmTy :: from_scalar ( scalar, mplace. layout ) )
578579 }
@@ -588,11 +589,11 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
588589 assert ! ( b_offset. bytes( ) > 0 ) ; // in `operand_field` we use the offset to tell apart the fields
589590 let a_val = alloc. read_scalar (
590591 alloc_range ( Size :: ZERO , a_size) ,
591- /*read_provenance*/ matches ! ( a, abi:: Pointer ( _) ) ,
592+ /*read_provenance*/ matches ! ( a, abi:: Primitive :: Pointer ( _) ) ,
592593 ) ?;
593594 let b_val = alloc. read_scalar (
594595 alloc_range ( b_offset, b_size) ,
595- /*read_provenance*/ matches ! ( b, abi:: Pointer ( _) ) ,
596+ /*read_provenance*/ matches ! ( b, abi:: Primitive :: Pointer ( _) ) ,
596597 ) ?;
597598 Some ( ImmTy :: from_immediate ( Immediate :: ScalarPair ( a_val, b_val) , mplace. layout ) )
598599 }
0 commit comments