@@ -19,7 +19,9 @@ use rustc_ast::visit::{
1919use rustc_ast:: * ;
2020use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap } ;
2121use rustc_errors:: codes:: * ;
22- use rustc_errors:: { Applicability , DiagArgValue , IntoDiagArg , StashKey , Suggestions } ;
22+ use rustc_errors:: {
23+ Applicability , DiagArgValue , ErrorGuaranteed , IntoDiagArg , StashKey , Suggestions ,
24+ } ;
2325use rustc_hir:: def:: Namespace :: { self , * } ;
2426use rustc_hir:: def:: { self , CtorKind , DefKind , LifetimeRes , NonMacroAttrKind , PartialRes , PerNS } ;
2527use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId , LOCAL_CRATE , LocalDefId } ;
@@ -264,7 +266,7 @@ impl RibKind<'_> {
264266#[ derive( Debug ) ]
265267pub ( crate ) struct Rib < ' ra , R = Res > {
266268 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 > ) > > ,
268270 pub kind : RibKind < ' ra > ,
269271}
270272
@@ -3841,7 +3843,10 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
38413843 . patterns_with_skipped_bindings
38423844 . entry ( def_id)
38433845 . 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+ } ) ) ;
38453850 }
38463851 }
38473852 ast:: PatFieldsRest :: None => { }
0 commit comments