@@ -2009,15 +2009,15 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20092009 self . prove_predicate (
20102010 ty:: ClauseKind :: WellFormed ( src_ty. into ( ) ) ,
20112011 location. to_locations ( ) ,
2012- ConstraintCategory :: Coercion { unsize_to : None } ,
2012+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
20132013 ) ;
20142014
20152015 let src_ty = self . normalize ( src_ty, location) ;
20162016 if let Err ( terr) = self . sub_types (
20172017 src_ty,
20182018 * ty,
20192019 location. to_locations ( ) ,
2020- ConstraintCategory :: Coercion { unsize_to : None } ,
2020+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
20212021 ) {
20222022 span_mirbug ! (
20232023 self ,
@@ -2038,7 +2038,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20382038 self . prove_predicate (
20392039 ty:: ClauseKind :: WellFormed ( src_ty. into ( ) ) ,
20402040 location. to_locations ( ) ,
2041- ConstraintCategory :: Coercion { unsize_to : None } ,
2041+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
20422042 ) ;
20432043
20442044 // The type that we see in the fcx is like
@@ -2051,7 +2051,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20512051 src_ty,
20522052 * ty,
20532053 location. to_locations ( ) ,
2054- ConstraintCategory :: Coercion { unsize_to : None } ,
2054+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
20552055 ) {
20562056 span_mirbug ! (
20572057 self ,
@@ -2076,7 +2076,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20762076 ty_fn_ptr_from,
20772077 * ty,
20782078 location. to_locations ( ) ,
2079- ConstraintCategory :: Coercion { unsize_to : None } ,
2079+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
20802080 ) {
20812081 span_mirbug ! (
20822082 self ,
@@ -2105,7 +2105,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21052105 ty_fn_ptr_from,
21062106 * ty,
21072107 location. to_locations ( ) ,
2108- ConstraintCategory :: Coercion { unsize_to : None } ,
2108+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
21092109 ) {
21102110 span_mirbug ! (
21112111 self ,
@@ -2129,7 +2129,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21292129 self . prove_trait_ref (
21302130 trait_ref,
21312131 location. to_locations ( ) ,
2132- ConstraintCategory :: Coercion {
2132+ ConstraintCategory :: Cast {
2133+ is_coercion : true ,
21332134 unsize_to : Some ( tcx. fold_regions ( ty, |r, _| {
21342135 if let ty:: ReVar ( _) = r. kind ( ) {
21352136 tcx. lifetimes . re_erased
@@ -2157,7 +2158,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21572158 . iter ( )
21582159 . map ( |predicate| predicate. with_self_ty ( tcx, self_ty) ) ,
21592160 location. to_locations ( ) ,
2160- ConstraintCategory :: Coercion { unsize_to : None } ,
2161+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
21612162 ) ;
21622163
21632164 let outlives_predicate = tcx. mk_predicate ( Binder :: dummy (
@@ -2168,7 +2169,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21682169 self . prove_predicate (
21692170 outlives_predicate,
21702171 location. to_locations ( ) ,
2171- ConstraintCategory :: Coercion { unsize_to : None } ,
2172+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
21722173 ) ;
21732174 }
21742175
@@ -2186,7 +2187,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21862187 * ty_from,
21872188 * ty_to,
21882189 location. to_locations ( ) ,
2189- ConstraintCategory :: Coercion { unsize_to : None } ,
2190+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
21902191 ) {
21912192 span_mirbug ! (
21922193 self ,
@@ -2248,7 +2249,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22482249 * ty_elem,
22492250 * ty_to,
22502251 location. to_locations ( ) ,
2251- ConstraintCategory :: Coercion { unsize_to : None } ,
2252+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
22522253 ) {
22532254 span_mirbug ! (
22542255 self ,
@@ -2429,7 +2430,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
24292430 src_obj,
24302431 dst_obj,
24312432 location. to_locations ( ) ,
2432- ConstraintCategory :: Cast ,
2433+ ConstraintCategory :: Cast {
2434+ is_coercion : false ,
2435+ unsize_to : None ,
2436+ } ,
24332437 )
24342438 . unwrap ( ) ;
24352439 }
0 commit comments