@@ -2009,15 +2009,15 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2009
2009
self . prove_predicate (
2010
2010
ty:: ClauseKind :: WellFormed ( src_ty. into ( ) ) ,
2011
2011
location. to_locations ( ) ,
2012
- ConstraintCategory :: Coercion { unsize_to : None } ,
2012
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2013
2013
) ;
2014
2014
2015
2015
let src_ty = self . normalize ( src_ty, location) ;
2016
2016
if let Err ( terr) = self . sub_types (
2017
2017
src_ty,
2018
2018
* ty,
2019
2019
location. to_locations ( ) ,
2020
- ConstraintCategory :: Coercion { unsize_to : None } ,
2020
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2021
2021
) {
2022
2022
span_mirbug ! (
2023
2023
self ,
@@ -2038,7 +2038,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2038
2038
self . prove_predicate (
2039
2039
ty:: ClauseKind :: WellFormed ( src_ty. into ( ) ) ,
2040
2040
location. to_locations ( ) ,
2041
- ConstraintCategory :: Coercion { unsize_to : None } ,
2041
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2042
2042
) ;
2043
2043
2044
2044
// The type that we see in the fcx is like
@@ -2051,7 +2051,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2051
2051
src_ty,
2052
2052
* ty,
2053
2053
location. to_locations ( ) ,
2054
- ConstraintCategory :: Coercion { unsize_to : None } ,
2054
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2055
2055
) {
2056
2056
span_mirbug ! (
2057
2057
self ,
@@ -2076,7 +2076,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2076
2076
ty_fn_ptr_from,
2077
2077
* ty,
2078
2078
location. to_locations ( ) ,
2079
- ConstraintCategory :: Coercion { unsize_to : None } ,
2079
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2080
2080
) {
2081
2081
span_mirbug ! (
2082
2082
self ,
@@ -2105,7 +2105,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2105
2105
ty_fn_ptr_from,
2106
2106
* ty,
2107
2107
location. to_locations ( ) ,
2108
- ConstraintCategory :: Coercion { unsize_to : None } ,
2108
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2109
2109
) {
2110
2110
span_mirbug ! (
2111
2111
self ,
@@ -2129,7 +2129,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2129
2129
self . prove_trait_ref (
2130
2130
trait_ref,
2131
2131
location. to_locations ( ) ,
2132
- ConstraintCategory :: Coercion {
2132
+ ConstraintCategory :: Cast {
2133
+ is_coercion : true ,
2133
2134
unsize_to : Some ( tcx. fold_regions ( ty, |r, _| {
2134
2135
if let ty:: ReVar ( _) = r. kind ( ) {
2135
2136
tcx. lifetimes . re_erased
@@ -2157,7 +2158,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2157
2158
. iter ( )
2158
2159
. map ( |predicate| predicate. with_self_ty ( tcx, self_ty) ) ,
2159
2160
location. to_locations ( ) ,
2160
- ConstraintCategory :: Coercion { unsize_to : None } ,
2161
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2161
2162
) ;
2162
2163
2163
2164
let outlives_predicate = tcx. mk_predicate ( Binder :: dummy (
@@ -2168,7 +2169,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2168
2169
self . prove_predicate (
2169
2170
outlives_predicate,
2170
2171
location. to_locations ( ) ,
2171
- ConstraintCategory :: Coercion { unsize_to : None } ,
2172
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2172
2173
) ;
2173
2174
}
2174
2175
@@ -2186,7 +2187,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2186
2187
* ty_from,
2187
2188
* ty_to,
2188
2189
location. to_locations ( ) ,
2189
- ConstraintCategory :: Coercion { unsize_to : None } ,
2190
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2190
2191
) {
2191
2192
span_mirbug ! (
2192
2193
self ,
@@ -2248,7 +2249,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2248
2249
* ty_elem,
2249
2250
* ty_to,
2250
2251
location. to_locations ( ) ,
2251
- ConstraintCategory :: Coercion { unsize_to : None } ,
2252
+ ConstraintCategory :: Cast { is_coercion : true , unsize_to : None } ,
2252
2253
) {
2253
2254
span_mirbug ! (
2254
2255
self ,
@@ -2429,7 +2430,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2429
2430
src_obj,
2430
2431
dst_obj,
2431
2432
location. to_locations ( ) ,
2432
- ConstraintCategory :: Cast ,
2433
+ ConstraintCategory :: Cast {
2434
+ is_coercion : false ,
2435
+ unsize_to : None ,
2436
+ } ,
2433
2437
)
2434
2438
. unwrap ( ) ;
2435
2439
}
0 commit comments