@@ -19,7 +19,6 @@ use rustc_hir::Node;
1919use rustc_middle:: mir:: interpret:: ErrorHandled ;
2020use rustc_middle:: ty:: error:: ExpectedFound ;
2121use rustc_middle:: ty:: fold:: TypeFolder ;
22- use rustc_middle:: ty:: subst:: GenericArgKind ;
2322use rustc_middle:: ty:: {
2423 self , fast_reject, AdtKind , SubtypePredicate , ToPolyTraitRef , ToPredicate , Ty , TyCtxt ,
2524 TypeFoldable , WithConstness ,
@@ -1532,24 +1531,13 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
15321531 err
15331532 }
15341533
1535- ty:: PredicateKind :: WellFormed ( arg ) => {
1534+ ty:: PredicateKind :: WellFormed ( ty ) => {
15361535 // Same hacky approach as above to avoid deluging user
15371536 // with error messages.
1538- if arg . references_error ( ) || self . tcx . sess . has_errors ( ) {
1537+ if ty . references_error ( ) || self . tcx . sess . has_errors ( ) {
15391538 return ;
15401539 }
1541-
1542- match arg. unpack ( ) {
1543- GenericArgKind :: Lifetime ( lt) => {
1544- span_bug ! ( span, "unexpected well formed predicate: {:?}" , lt)
1545- }
1546- GenericArgKind :: Type ( ty) => {
1547- self . need_type_info_err ( body_id, span, ty, ErrorCode :: E0282 )
1548- }
1549- GenericArgKind :: Const ( ct) => {
1550- self . need_type_info_err_const ( body_id, span, ct, ErrorCode :: E0282 )
1551- }
1552- }
1540+ self . need_type_info_err ( body_id, span, ty, ErrorCode :: E0282 )
15531541 }
15541542
15551543 ty:: PredicateKind :: Subtype ( ref data) => {
0 commit comments