@@ -19,7 +19,9 @@ use rustc_ast::visit::{
19
19
use rustc_ast:: * ;
20
20
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap } ;
21
21
use rustc_errors:: codes:: * ;
22
- use rustc_errors:: { Applicability , DiagArgValue , IntoDiagArg , StashKey , Suggestions } ;
22
+ use rustc_errors:: {
23
+ Applicability , DiagArgValue , ErrorGuaranteed , IntoDiagArg , StashKey , Suggestions ,
24
+ } ;
23
25
use rustc_hir:: def:: Namespace :: { self , * } ;
24
26
use rustc_hir:: def:: { self , CtorKind , DefKind , LifetimeRes , NonMacroAttrKind , PartialRes , PerNS } ;
25
27
use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId , LOCAL_CRATE , LocalDefId } ;
@@ -264,7 +266,7 @@ impl RibKind<'_> {
264
266
#[ derive( Debug ) ]
265
267
pub ( crate ) struct Rib < ' ra , R = Res > {
266
268
pub bindings : IdentMap < R > ,
267
- pub patterns_with_skipped_bindings : FxHashMap < DefId , Vec < ( Span , bool /* recovered error */ ) > > ,
269
+ pub patterns_with_skipped_bindings : FxHashMap < DefId , Vec < ( Span , Result < ( ) , ErrorGuaranteed > ) > > ,
268
270
pub kind : RibKind < ' ra > ,
269
271
}
270
272
@@ -3841,7 +3843,10 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
3841
3843
. patterns_with_skipped_bindings
3842
3844
. entry ( def_id)
3843
3845
. or_default ( )
3844
- . push ( ( pat. span , matches ! ( rest, ast:: PatFieldsRest :: Recovered ( _) ) ) ) ;
3846
+ . push ( ( pat. span , match rest {
3847
+ ast:: PatFieldsRest :: Recovered ( guar) => Err ( * guar) ,
3848
+ _ => Ok ( ( ) ) ,
3849
+ } ) ) ;
3845
3850
}
3846
3851
}
3847
3852
ast:: PatFieldsRest :: None => { }
0 commit comments