@@ -302,11 +302,11 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
302
302
self . sanitize_place ( place, location, context) ;
303
303
}
304
304
305
- fn visit_constant ( & mut self , constant : & Constant < ' tcx > , location : Location ) {
305
+ fn visit_constant ( & mut self , constant : & ConstOperand < ' tcx > , location : Location ) {
306
306
debug ! ( ?constant, ?location, "visit_constant" ) ;
307
307
308
308
self . super_constant ( constant, location) ;
309
- let ty = self . sanitize_type ( constant, constant. literal . ty ( ) ) ;
309
+ let ty = self . sanitize_type ( constant, constant. const_ . ty ( ) ) ;
310
310
311
311
self . cx . infcx . tcx . for_each_free_region ( & ty, |live_region| {
312
312
let live_region_vid =
@@ -328,7 +328,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
328
328
329
329
if let Some ( annotation_index) = constant. user_ty {
330
330
if let Err ( terr) = self . cx . relate_type_and_user_type (
331
- constant. literal . ty ( ) ,
331
+ constant. const_ . ty ( ) ,
332
332
ty:: Variance :: Invariant ,
333
333
& UserTypeProjection { base : annotation_index, projs : vec ! [ ] } ,
334
334
locations,
@@ -340,20 +340,20 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
340
340
constant,
341
341
"bad constant user type {:?} vs {:?}: {:?}" ,
342
342
annotation,
343
- constant. literal . ty( ) ,
343
+ constant. const_ . ty( ) ,
344
344
terr,
345
345
) ;
346
346
}
347
347
} else {
348
348
let tcx = self . tcx ( ) ;
349
- let maybe_uneval = match constant. literal {
350
- ConstantKind :: Ty ( ct) => match ct. kind ( ) {
349
+ let maybe_uneval = match constant. const_ {
350
+ Const :: Ty ( ct) => match ct. kind ( ) {
351
351
ty:: ConstKind :: Unevaluated ( _) => {
352
- bug ! ( "should not encounter unevaluated ConstantKind ::Ty here, got {:?}" , ct)
352
+ bug ! ( "should not encounter unevaluated Const ::Ty here, got {:?}" , ct)
353
353
}
354
354
_ => None ,
355
355
} ,
356
- ConstantKind :: Unevaluated ( uv, _) => Some ( uv) ,
356
+ Const :: Unevaluated ( uv, _) => Some ( uv) ,
357
357
_ => None ,
358
358
} ;
359
359
@@ -384,15 +384,15 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
384
384
check_err ( self , promoted_body, ty, promoted_ty) ;
385
385
} else {
386
386
self . cx . ascribe_user_type (
387
- constant. literal . ty ( ) ,
387
+ constant. const_ . ty ( ) ,
388
388
UserType :: TypeOf ( uv. def , UserArgs { args : uv. args , user_self_ty : None } ) ,
389
389
locations. span ( & self . cx . body ) ,
390
390
) ;
391
391
}
392
392
} else if let Some ( static_def_id) = constant. check_static_ptr ( tcx) {
393
393
let unnormalized_ty = tcx. type_of ( static_def_id) . instantiate_identity ( ) ;
394
394
let normalized_ty = self . cx . normalize ( unnormalized_ty, locations) ;
395
- let literal_ty = constant. literal . ty ( ) . builtin_deref ( true ) . unwrap ( ) . ty ;
395
+ let literal_ty = constant. const_ . ty ( ) . builtin_deref ( true ) . unwrap ( ) . ty ;
396
396
397
397
if let Err ( terr) = self . cx . eq_types (
398
398
literal_ty,
@@ -404,7 +404,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
404
404
}
405
405
}
406
406
407
- if let ty:: FnDef ( def_id, args) = * constant. literal . ty ( ) . kind ( ) {
407
+ if let ty:: FnDef ( def_id, args) = * constant. const_ . ty ( ) . kind ( ) {
408
408
let instantiated_predicates = tcx. predicates_of ( def_id) . instantiate ( tcx, args) ;
409
409
self . cx . normalize_and_prove_instantiated_predicates (
410
410
def_id,
@@ -1801,9 +1801,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1801
1801
debug ! ( ?op, ?location, "check_operand" ) ;
1802
1802
1803
1803
if let Operand :: Constant ( constant) = op {
1804
- let maybe_uneval = match constant. literal {
1805
- ConstantKind :: Val ( ..) | ConstantKind :: Ty ( _) => None ,
1806
- ConstantKind :: Unevaluated ( uv, _) => Some ( uv) ,
1804
+ let maybe_uneval = match constant. const_ {
1805
+ Const :: Val ( ..) | Const :: Ty ( _) => None ,
1806
+ Const :: Unevaluated ( uv, _) => Some ( uv) ,
1807
1807
} ;
1808
1808
1809
1809
if let Some ( uv) = maybe_uneval {
0 commit comments