1- use rustc:: ty:: { self , Ty } ;
1+ use rustc:: ty:: { self , Ty , adjustment :: { PointerCast } } ;
22use rustc:: ty:: cast:: { CastTy , IntTy } ;
33use rustc:: ty:: layout:: { self , LayoutOf , HasTyCtxt } ;
44use rustc:: mir;
@@ -37,7 +37,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
3737 bx
3838 }
3939
40- mir:: Rvalue :: Cast ( mir:: CastKind :: Unsize , ref source, _) => {
40+ mir:: Rvalue :: Cast ( mir:: CastKind :: Pointer ( PointerCast :: Unsize ) , ref source, _) => {
4141 // The destination necessarily contains a fat pointer, so if
4242 // it's a scalar pair, it's a fat pointer or newtype thereof.
4343 if bx. cx ( ) . is_backend_scalar_pair ( dest. layout ) {
@@ -178,7 +178,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
178178 let cast = bx. cx ( ) . layout_of ( self . monomorphize ( & mir_cast_ty) ) ;
179179
180180 let val = match * kind {
181- mir:: CastKind :: ReifyFnPointer => {
181+ mir:: CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) => {
182182 match operand. layout . ty . sty {
183183 ty:: FnDef ( def_id, substs) => {
184184 if bx. cx ( ) . tcx ( ) . has_attr ( def_id, "rustc_args_required_const" ) {
@@ -193,7 +193,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
193193 }
194194 }
195195 }
196- mir:: CastKind :: ClosureFnPointer ( _) => {
196+ mir:: CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( _) ) => {
197197 match operand. layout . ty . sty {
198198 ty:: Closure ( def_id, substs) => {
199199 let instance = monomorphize:: resolve_closure (
@@ -205,11 +205,11 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
205205 }
206206 }
207207 }
208- mir:: CastKind :: UnsafeFnPointer => {
208+ mir:: CastKind :: Pointer ( PointerCast :: UnsafeFnPointer ) => {
209209 // this is a no-op at the LLVM level
210210 operand. val
211211 }
212- mir:: CastKind :: Unsize => {
212+ mir:: CastKind :: Pointer ( PointerCast :: Unsize ) => {
213213 assert ! ( bx. cx( ) . is_backend_scalar_pair( cast) ) ;
214214 match operand. val {
215215 OperandValue :: Pair ( lldata, llextra) => {
@@ -236,7 +236,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
236236 }
237237 }
238238 }
239- mir:: CastKind :: MutToConstPointer
239+ mir:: CastKind :: Pointer ( PointerCast :: MutToConstPointer )
240240 | mir:: CastKind :: Misc if bx. cx ( ) . is_backend_scalar_pair ( operand. layout ) => {
241241 if let OperandValue :: Pair ( data_ptr, meta) = operand. val {
242242 if bx. cx ( ) . is_backend_scalar_pair ( cast) {
@@ -254,7 +254,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
254254 bug ! ( "Unexpected non-Pair operand" )
255255 }
256256 }
257- mir:: CastKind :: MutToConstPointer
257+ mir:: CastKind :: Pointer ( PointerCast :: MutToConstPointer )
258258 | mir:: CastKind :: Misc => {
259259 assert ! ( bx. cx( ) . is_backend_immediate( cast) ) ;
260260 let ll_t_out = bx. cx ( ) . immediate_backend_type ( cast) ;
0 commit comments