@@ -10,9 +10,7 @@ use rustc_infer::infer::TyCtxtInferExt;
10
10
use rustc_infer:: traits:: Obligation ;
11
11
use rustc_middle:: mir:: interpret:: ErrorHandled ;
12
12
use 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 } ;
16
14
use rustc_middle:: { mir, span_bug} ;
17
15
use rustc_span:: def_id:: DefId ;
18
16
use rustc_span:: { Span , sym} ;
@@ -194,7 +192,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
194
192
// Convert the valtree to a const.
195
193
let inlined_const_as_pat = self . valtree_to_pat ( valtree, ty) ;
196
194
197
- if !inlined_const_as_pat . references_error ( ) {
195
+ if !self . thir . pat_references_error ( & inlined_const_as_pat ) {
198
196
// Always check for `PartialEq` if we had no other errors yet.
199
197
if !type_has_partial_eq_impl ( self . tcx , typing_env, ty) . has_impl {
200
198
let mut err = self . tcx . dcx ( ) . create_err ( TypeNotPartialEq { span : self . span , ty } ) ;
0 commit comments