@@ -1282,6 +1282,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12821282
12831283 let mut infer_args_for_err = FxHashSet :: default ( ) ;
12841284
1285+ let mut explicit_late_bound = ExplicitLateBound :: No ;
12851286 for & PathSeg ( def_id, index) in & path_segs {
12861287 let seg = & segments[ index] ;
12871288 let generics = tcx. generics_of ( def_id) ;
@@ -1290,17 +1291,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12901291 // parameter internally, but we don't allow users to specify the
12911292 // parameter's value explicitly, so we have to do some error-
12921293 // checking here.
1293- if let GenericArgCountResult {
1294- correct : Err ( GenericArgCountMismatch { reported : Some ( _) , .. } ) ,
1295- ..
1296- } = <dyn AstConv < ' _ > >:: check_generic_arg_count_for_call (
1294+ let arg_count = <dyn AstConv < ' _ > >:: check_generic_arg_count_for_call (
12971295 tcx,
12981296 span,
12991297 def_id,
13001298 & generics,
13011299 seg,
13021300 IsMethodCall :: No ,
1303- ) {
1301+ ) ;
1302+
1303+ if let ExplicitLateBound :: Yes = arg_count. explicit_late_bound {
1304+ explicit_late_bound = ExplicitLateBound :: Yes ;
1305+ }
1306+
1307+ if let Err ( GenericArgCountMismatch { reported : Some ( _) , .. } ) = arg_count. correct {
13041308 infer_args_for_err. insert ( index) ;
13051309 self . set_tainted_by_errors ( ) ; // See issue #53251.
13061310 }
@@ -1357,7 +1361,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13571361 let ty = tcx. type_of ( def_id) ;
13581362
13591363 let arg_count = GenericArgCountResult {
1360- explicit_late_bound : ExplicitLateBound :: No ,
1364+ explicit_late_bound,
13611365 correct : if infer_args_for_err. is_empty ( ) {
13621366 Ok ( ( ) )
13631367 } else {
0 commit comments