@@ -10,9 +10,7 @@ use rustc_infer::infer::TyCtxtInferExt;
1010use rustc_infer:: traits:: Obligation ;
1111use rustc_middle:: mir:: interpret:: ErrorHandled ;
1212use rustc_middle:: thir:: { FieldPat , Pat , PatKind , Thir } ;
13- use rustc_middle:: ty:: {
14- self , Ty , TyCtxt , TypeSuperVisitable , TypeVisitableExt , TypeVisitor , ValTree ,
15- } ;
13+ use rustc_middle:: ty:: { self , Ty , TyCtxt , TypeSuperVisitable , TypeVisitor , ValTree } ;
1614use rustc_middle:: { mir, span_bug} ;
1715use rustc_span:: def_id:: DefId ;
1816use rustc_span:: { Span , sym} ;
@@ -194,7 +192,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
194192 // Convert the valtree to a const.
195193 let inlined_const_as_pat = self . valtree_to_pat ( valtree, ty) ;
196194
197- if !inlined_const_as_pat . references_error ( ) {
195+ if !self . thir . pat_references_error ( & inlined_const_as_pat ) {
198196 // Always check for `PartialEq` if we had no other errors yet.
199197 if !type_has_partial_eq_impl ( self . tcx , typing_env, ty) . has_impl {
200198 let mut err = self . tcx . dcx ( ) . create_err ( TypeNotPartialEq { span : self . span , ty } ) ;
0 commit comments