@@ -27,6 +27,7 @@ use rustc_middle::mir::tcx::PlaceTy;
27
27
use rustc_middle:: mir:: visit:: { NonMutatingUseContext , PlaceContext , Visitor } ;
28
28
use rustc_middle:: mir:: AssertKind ;
29
29
use rustc_middle:: mir:: * ;
30
+ use rustc_middle:: traits:: query:: NoSolution ;
30
31
use rustc_middle:: ty:: adjustment:: PointerCast ;
31
32
use rustc_middle:: ty:: cast:: CastTy ;
32
33
use rustc_middle:: ty:: subst:: { SubstsRef , UserSubsts } ;
@@ -42,7 +43,7 @@ use rustc_target::abi::{FieldIdx, FIRST_VARIANT};
42
43
use rustc_trait_selection:: traits:: query:: type_op:: custom:: scrape_region_constraints;
43
44
use rustc_trait_selection:: traits:: query:: type_op:: custom:: CustomTypeOp ;
44
45
use rustc_trait_selection:: traits:: query:: type_op:: { TypeOp , TypeOpOutput } ;
45
- use rustc_trait_selection :: traits :: query :: Fallible ;
46
+
46
47
use rustc_trait_selection:: traits:: PredicateObligation ;
47
48
48
49
use rustc_mir_dataflow:: impls:: MaybeInitializedPlaces ;
@@ -1133,7 +1134,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1133
1134
sup : Ty < ' tcx > ,
1134
1135
locations : Locations ,
1135
1136
category : ConstraintCategory < ' tcx > ,
1136
- ) -> Fallible < ( ) > {
1137
+ ) -> Result < ( ) , NoSolution > {
1137
1138
// Use this order of parameters because the sup type is usually the
1138
1139
// "expected" type in diagnostics.
1139
1140
self . relate_types ( sup, ty:: Variance :: Contravariant , sub, locations, category)
@@ -1146,7 +1147,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1146
1147
found : Ty < ' tcx > ,
1147
1148
locations : Locations ,
1148
1149
category : ConstraintCategory < ' tcx > ,
1149
- ) -> Fallible < ( ) > {
1150
+ ) -> Result < ( ) , NoSolution > {
1150
1151
self . relate_types ( expected, ty:: Variance :: Invariant , found, locations, category)
1151
1152
}
1152
1153
@@ -1158,7 +1159,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1158
1159
user_ty : & UserTypeProjection ,
1159
1160
locations : Locations ,
1160
1161
category : ConstraintCategory < ' tcx > ,
1161
- ) -> Fallible < ( ) > {
1162
+ ) -> Result < ( ) , NoSolution > {
1162
1163
let annotated_type = self . user_type_annotations [ user_ty. base ] . inferred_ty ;
1163
1164
trace ! ( ?annotated_type) ;
1164
1165
let mut curr_projected_ty = PlaceTy :: from_ty ( annotated_type) ;
0 commit comments