1
- use rustc:: ty:: { self , Ty } ;
1
+ use rustc:: ty:: { self , Ty , adjustment :: { PointerCast } } ;
2
2
use rustc:: ty:: cast:: { CastTy , IntTy } ;
3
3
use rustc:: ty:: layout:: { self , LayoutOf , HasTyCtxt } ;
4
4
use rustc:: mir;
@@ -37,7 +37,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
37
37
bx
38
38
}
39
39
40
- mir:: Rvalue :: Cast ( mir:: CastKind :: Unsize , ref source, _) => {
40
+ mir:: Rvalue :: Cast ( mir:: CastKind :: Pointer ( PointerCast :: Unsize ) , ref source, _) => {
41
41
// The destination necessarily contains a fat pointer, so if
42
42
// it's a scalar pair, it's a fat pointer or newtype thereof.
43
43
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> {
178
178
let cast = bx. cx ( ) . layout_of ( self . monomorphize ( & mir_cast_ty) ) ;
179
179
180
180
let val = match * kind {
181
- mir:: CastKind :: ReifyFnPointer => {
181
+ mir:: CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) => {
182
182
match operand. layout . ty . sty {
183
183
ty:: FnDef ( def_id, substs) => {
184
184
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> {
193
193
}
194
194
}
195
195
}
196
- mir:: CastKind :: ClosureFnPointer ( _) => {
196
+ mir:: CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( _) ) => {
197
197
match operand. layout . ty . sty {
198
198
ty:: Closure ( def_id, substs) => {
199
199
let instance = monomorphize:: resolve_closure (
@@ -205,11 +205,11 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
205
205
}
206
206
}
207
207
}
208
- mir:: CastKind :: UnsafeFnPointer => {
208
+ mir:: CastKind :: Pointer ( PointerCast :: UnsafeFnPointer ) => {
209
209
// this is a no-op at the LLVM level
210
210
operand. val
211
211
}
212
- mir:: CastKind :: Unsize => {
212
+ mir:: CastKind :: Pointer ( PointerCast :: Unsize ) => {
213
213
assert ! ( bx. cx( ) . is_backend_scalar_pair( cast) ) ;
214
214
match operand. val {
215
215
OperandValue :: Pair ( lldata, llextra) => {
@@ -236,7 +236,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
236
236
}
237
237
}
238
238
}
239
- mir:: CastKind :: MutToConstPointer
239
+ mir:: CastKind :: Pointer ( PointerCast :: MutToConstPointer )
240
240
| mir:: CastKind :: Misc if bx. cx ( ) . is_backend_scalar_pair ( operand. layout ) => {
241
241
if let OperandValue :: Pair ( data_ptr, meta) = operand. val {
242
242
if bx. cx ( ) . is_backend_scalar_pair ( cast) {
@@ -254,7 +254,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
254
254
bug ! ( "Unexpected non-Pair operand" )
255
255
}
256
256
}
257
- mir:: CastKind :: MutToConstPointer
257
+ mir:: CastKind :: Pointer ( PointerCast :: MutToConstPointer )
258
258
| mir:: CastKind :: Misc => {
259
259
assert ! ( bx. cx( ) . is_backend_immediate( cast) ) ;
260
260
let ll_t_out = bx. cx ( ) . immediate_backend_type ( cast) ;
0 commit comments