@@ -123,7 +123,22 @@ enum ConvertedBindingKind<'a, 'tcx> {
123
123
Constraint ( & ' a [ hir:: GenericBound < ' a > ] ) ,
124
124
}
125
125
126
- #[ derive( PartialEq ) ]
126
+ /// New-typed boolean indicating whether explicit late-bound lifetimes
127
+ /// are present in a set of generic arguments.
128
+ ///
129
+ /// For example if we have some method `fn f<'a>(&'a self)` implemented
130
+ /// for some type `T`, although `f` is generic in the lifetime `'a`, `'a`
131
+ /// is late-bound so should not be provided explicitly. Thus, if `f` is
132
+ /// instantiated with some generic arguments providing `'a` explicitly,
133
+ /// we taint those arguments with `ExplicitLateBound::Yes` so that we
134
+ /// can provide an appropriate diagnostic later.
135
+ #[ derive( Copy , Clone , PartialEq ) ]
136
+ pub enum ExplicitLateBound {
137
+ Yes ,
138
+ No ,
139
+ }
140
+
141
+ #[ derive( Copy , Clone , PartialEq ) ]
127
142
enum GenericArgPosition {
128
143
Type ,
129
144
Value , // e.g., functions
@@ -132,13 +147,22 @@ enum GenericArgPosition {
132
147
133
148
/// A marker denoting that the generic arguments that were
134
149
/// provided did not match the respective generic parameters.
150
+ #[ derive( Clone , Default ) ]
135
151
pub struct GenericArgCountMismatch {
136
152
/// Indicates whether a fatal error was reported (`Some`), or just a lint (`None`).
137
153
pub reported : Option < ErrorReported > ,
138
154
/// A list of spans of arguments provided that were not valid.
139
155
pub invalid_args : Vec < Span > ,
140
156
}
141
157
158
+ /// Decorates the result of a generic argument count mismatch
159
+ /// check with whether explicit late bounds were provided.
160
+ #[ derive( Clone ) ]
161
+ pub struct GenericArgCountResult {
162
+ pub explicit_late_bound : ExplicitLateBound ,
163
+ pub correct : Result < ( ) , GenericArgCountMismatch > ,
164
+ }
165
+
142
166
impl < ' o , ' tcx > dyn AstConv < ' tcx > + ' o {
143
167
pub fn ast_region_to_region (
144
168
& self ,
@@ -271,7 +295,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
271
295
def : & ty:: Generics ,
272
296
seg : & hir:: PathSegment < ' _ > ,
273
297
is_method_call : bool ,
274
- ) -> Result < ( ) , GenericArgCountMismatch > {
298
+ ) -> GenericArgCountResult {
275
299
let empty_args = hir:: GenericArgs :: none ( ) ;
276
300
let suppress_mismatch = Self :: check_impl_trait ( tcx, seg, & def) ;
277
301
Self :: check_generic_arg_count (
@@ -295,7 +319,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
295
319
position : GenericArgPosition ,
296
320
has_self : bool ,
297
321
infer_args : bool ,
298
- ) -> Result < ( ) , GenericArgCountMismatch > {
322
+ ) -> GenericArgCountResult {
299
323
// At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
300
324
// that lifetimes will proceed types. So it suffices to check the number of each generic
301
325
// arguments in order to validate them with respect to the generic parameters.
@@ -320,112 +344,94 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
320
344
AstConv :: prohibit_assoc_ty_binding ( tcx, args. bindings [ 0 ] . span ) ;
321
345
}
322
346
323
- // Prohibit explicit lifetime arguments if late-bound lifetime parameters are present.
324
- let mut explicit_lifetimes = Ok ( ( ) ) ;
325
- if !infer_lifetimes {
326
- if let Some ( span_late) = def. has_late_bound_regions {
327
- let msg = "cannot specify lifetime arguments explicitly \
328
- if late bound lifetime parameters are present";
329
- let note = "the late bound lifetime parameter is introduced here" ;
330
- let span = args. args [ 0 ] . span ( ) ;
331
- if position == GenericArgPosition :: Value
332
- && arg_counts. lifetimes != param_counts. lifetimes
333
- {
334
- explicit_lifetimes = Err ( true ) ;
335
- let mut err = tcx. sess . struct_span_err ( span, msg) ;
336
- err. span_note ( span_late, note) ;
337
- err. emit ( ) ;
338
- } else {
339
- explicit_lifetimes = Err ( false ) ;
340
- let mut multispan = MultiSpan :: from_span ( span) ;
341
- multispan. push_span_label ( span_late, note. to_string ( ) ) ;
342
- tcx. struct_span_lint_hir (
343
- LATE_BOUND_LIFETIME_ARGUMENTS ,
344
- args. args [ 0 ] . id ( ) ,
345
- multispan,
346
- |lint| lint. build ( msg) . emit ( ) ,
347
- ) ;
348
- }
347
+ let explicit_late_bound =
348
+ Self :: prohibit_explicit_late_bound_lifetimes ( tcx, def, args, position) ;
349
+
350
+ let check_kind_count = |kind,
351
+ required,
352
+ permitted,
353
+ provided,
354
+ offset,
355
+ unexpected_spans : & mut Vec < Span > ,
356
+ silent| {
357
+ debug ! (
358
+ "check_kind_count: kind: {} required: {} permitted: {} provided: {} offset: {}" ,
359
+ kind, required, permitted, provided, offset
360
+ ) ;
361
+ // We enforce the following: `required` <= `provided` <= `permitted`.
362
+ // For kinds without defaults (e.g.., lifetimes), `required == permitted`.
363
+ // For other kinds (i.e., types), `permitted` may be greater than `required`.
364
+ if required <= provided && provided <= permitted {
365
+ return Ok ( ( ) ) ;
349
366
}
350
- }
351
367
352
- let check_kind_count =
353
- |kind, required, permitted, provided, offset, unexpected_spans : & mut Vec < Span > | {
354
- debug ! (
355
- "check_kind_count: kind: {} required: {} permitted: {} provided: {} offset: {}" ,
356
- kind, required, permitted, provided, offset
357
- ) ;
358
- // We enforce the following: `required` <= `provided` <= `permitted`.
359
- // For kinds without defaults (e.g.., lifetimes), `required == permitted`.
360
- // For other kinds (i.e., types), `permitted` may be greater than `required`.
361
- if required <= provided && provided <= permitted {
362
- return Ok ( ( ) ) ;
363
- }
364
-
365
- // Unfortunately lifetime and type parameter mismatches are typically styled
366
- // differently in diagnostics, which means we have a few cases to consider here.
367
- let ( bound, quantifier) = if required != permitted {
368
- if provided < required {
369
- ( required, "at least " )
370
- } else {
371
- // provided > permitted
372
- ( permitted, "at most " )
373
- }
374
- } else {
375
- ( required, "" )
376
- } ;
368
+ if silent {
369
+ return Err ( true ) ;
370
+ }
377
371
378
- let ( spans, label) = if required == permitted && provided > permitted {
379
- // In the case when the user has provided too many arguments,
380
- // we want to point to the unexpected arguments.
381
- let spans: Vec < Span > = args. args [ offset + permitted..offset + provided]
382
- . iter ( )
383
- . map ( |arg| arg. span ( ) )
384
- . collect ( ) ;
385
- unexpected_spans. extend ( spans. clone ( ) ) ;
386
- ( spans, format ! ( "unexpected {} argument" , kind) )
372
+ // Unfortunately lifetime and type parameter mismatches are typically styled
373
+ // differently in diagnostics, which means we have a few cases to consider here.
374
+ let ( bound, quantifier) = if required != permitted {
375
+ if provided < required {
376
+ ( required, "at least " )
387
377
} else {
388
- (
389
- vec ! [ span] ,
390
- format ! (
391
- "expected {}{} {} argument{}" ,
392
- quantifier,
393
- bound,
394
- kind,
395
- pluralize!( bound) ,
396
- ) ,
397
- )
398
- } ;
399
-
400
- let mut err = tcx. sess . struct_span_err_with_code (
401
- spans. clone ( ) ,
402
- & format ! (
403
- "wrong number of {} arguments: expected {}{}, found {}" ,
404
- kind, quantifier, bound, provided,
405
- ) ,
406
- DiagnosticId :: Error ( "E0107" . into ( ) ) ,
407
- ) ;
408
- for span in spans {
409
- err. span_label ( span, label. as_str ( ) ) ;
378
+ // provided > permitted
379
+ ( permitted, "at most " )
410
380
}
411
- err. emit ( ) ;
381
+ } else {
382
+ ( required, "" )
383
+ } ;
412
384
413
- Err ( true )
385
+ let ( spans, label) = if required == permitted && provided > permitted {
386
+ // In the case when the user has provided too many arguments,
387
+ // we want to point to the unexpected arguments.
388
+ let spans: Vec < Span > = args. args [ offset + permitted..offset + provided]
389
+ . iter ( )
390
+ . map ( |arg| arg. span ( ) )
391
+ . collect ( ) ;
392
+ unexpected_spans. extend ( spans. clone ( ) ) ;
393
+ ( spans, format ! ( "unexpected {} argument" , kind) )
394
+ } else {
395
+ (
396
+ vec ! [ span] ,
397
+ format ! (
398
+ "expected {}{} {} argument{}" ,
399
+ quantifier,
400
+ bound,
401
+ kind,
402
+ pluralize!( bound) ,
403
+ ) ,
404
+ )
414
405
} ;
415
406
416
- let mut arg_count_correct = explicit_lifetimes;
407
+ let mut err = tcx. sess . struct_span_err_with_code (
408
+ spans. clone ( ) ,
409
+ & format ! (
410
+ "wrong number of {} arguments: expected {}{}, found {}" ,
411
+ kind, quantifier, bound, provided,
412
+ ) ,
413
+ DiagnosticId :: Error ( "E0107" . into ( ) ) ,
414
+ ) ;
415
+ for span in spans {
416
+ err. span_label ( span, label. as_str ( ) ) ;
417
+ }
418
+ err. emit ( ) ;
419
+
420
+ Err ( true )
421
+ } ;
422
+
423
+ let mut arg_count_correct = Ok ( ( ) ) ;
417
424
let mut unexpected_spans = vec ! [ ] ;
418
425
419
- if arg_count_correct. is_ok ( )
420
- && ( !infer_lifetimes || arg_counts. lifetimes > param_counts. lifetimes )
421
- {
426
+ if !infer_lifetimes || arg_counts. lifetimes > param_counts. lifetimes {
422
427
arg_count_correct = check_kind_count (
423
428
"lifetime" ,
424
429
param_counts. lifetimes ,
425
430
param_counts. lifetimes ,
426
431
arg_counts. lifetimes ,
427
432
0 ,
428
433
& mut unexpected_spans,
434
+ explicit_late_bound == ExplicitLateBound :: Yes ,
429
435
)
430
436
. and ( arg_count_correct) ;
431
437
}
@@ -438,6 +444,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
438
444
arg_counts. consts ,
439
445
arg_counts. lifetimes + arg_counts. types ,
440
446
& mut unexpected_spans,
447
+ false ,
441
448
)
442
449
. and ( arg_count_correct) ;
443
450
}
@@ -451,14 +458,18 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
451
458
arg_counts. types ,
452
459
arg_counts. lifetimes ,
453
460
& mut unexpected_spans,
461
+ false ,
454
462
)
455
463
. and ( arg_count_correct) ;
456
464
}
457
465
458
- arg_count_correct. map_err ( |reported_err| GenericArgCountMismatch {
459
- reported : if reported_err { Some ( ErrorReported ) } else { None } ,
460
- invalid_args : unexpected_spans,
461
- } )
466
+ GenericArgCountResult {
467
+ explicit_late_bound,
468
+ correct : arg_count_correct. map_err ( |reported_err| GenericArgCountMismatch {
469
+ reported : if reported_err { Some ( ErrorReported ) } else { None } ,
470
+ invalid_args : unexpected_spans,
471
+ } ) ,
472
+ }
462
473
}
463
474
464
475
/// Report an error that a generic argument did not match the generic parameter that was
@@ -512,7 +523,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
512
523
parent_substs : & [ subst:: GenericArg < ' tcx > ] ,
513
524
has_self : bool ,
514
525
self_ty : Option < Ty < ' tcx > > ,
515
- arg_count_correct : bool ,
526
+ arg_count : GenericArgCountResult ,
516
527
args_for_def_id : impl Fn ( DefId ) -> ( Option < & ' b GenericArgs < ' b > > , bool ) ,
517
528
mut provided_kind : impl FnMut ( & GenericParamDef , & GenericArg < ' _ > ) -> subst:: GenericArg < ' tcx > ,
518
529
mut inferred_kind : impl FnMut (
@@ -585,30 +596,40 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
585
596
// input. We try to handle both sensibly.
586
597
match ( args. peek ( ) , params. peek ( ) ) {
587
598
( Some ( & arg) , Some ( & param) ) => {
588
- match ( arg, & param. kind ) {
589
- ( GenericArg :: Lifetime ( _) , GenericParamDefKind :: Lifetime )
590
- | ( GenericArg :: Type ( _) , GenericParamDefKind :: Type { .. } )
591
- | ( GenericArg :: Const ( _) , GenericParamDefKind :: Const ) => {
599
+ match ( arg, & param. kind , arg_count . explicit_late_bound ) {
600
+ ( GenericArg :: Lifetime ( _) , GenericParamDefKind :: Lifetime , _ )
601
+ | ( GenericArg :: Type ( _) , GenericParamDefKind :: Type { .. } , _ )
602
+ | ( GenericArg :: Const ( _) , GenericParamDefKind :: Const , _ ) => {
592
603
substs. push ( provided_kind ( param, arg) ) ;
593
604
args. next ( ) ;
594
605
params. next ( ) ;
595
606
}
596
607
(
597
608
GenericArg :: Type ( _) | GenericArg :: Const ( _) ,
598
609
GenericParamDefKind :: Lifetime ,
610
+ _,
599
611
) => {
600
612
// We expected a lifetime argument, but got a type or const
601
613
// argument. That means we're inferring the lifetimes.
602
614
substs. push ( inferred_kind ( None , param, infer_args) ) ;
603
615
force_infer_lt = Some ( arg) ;
604
616
params. next ( ) ;
605
617
}
606
- ( _, kind) => {
618
+ ( GenericArg :: Lifetime ( _) , _, ExplicitLateBound :: Yes ) => {
619
+ // We've come across a lifetime when we expected something else in
620
+ // the presence of explicit late bounds. This is most likely
621
+ // due to the presence of the explicit bound so we're just going to
622
+ // ignore it.
623
+ args. next ( ) ;
624
+ }
625
+ ( _, kind, _) => {
607
626
// We expected one kind of parameter, but the user provided
608
627
// another. This is an error. However, if we already know that
609
628
// the arguments don't match up with the parameters, we won't issue
610
629
// an additional error, as the user already knows what's wrong.
611
- if arg_count_correct {
630
+ if arg_count. correct . is_ok ( )
631
+ && arg_count. explicit_late_bound == ExplicitLateBound :: No
632
+ {
612
633
Self :: generic_arg_mismatch_err ( tcx. sess , arg, kind. descr ( ) ) ;
613
634
}
614
635
@@ -624,17 +645,19 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
624
645
625
646
( Some ( & arg) , None ) => {
626
647
// We should never be able to reach this point with well-formed input.
627
- // There are two situations in which we can encounter this issue.
648
+ // There are three situations in which we can encounter this issue.
628
649
//
629
650
// 1. The number of arguments is incorrect. In this case, an error
630
- // will already have been emitted, and we can ignore it. This case
631
- // also occurs when late-bound lifetime parameters are present, yet
632
- // the lifetime arguments have also been explicitly specified by the
651
+ // will already have been emitted, and we can ignore it.
652
+ // 2. There are late-bound lifetime parameters present, yet the
653
+ // lifetime arguments have also been explicitly specified by the
633
654
// user.
634
- // 2 . We've inferred some lifetimes, which have been provided later (i.e.
655
+ // 3 . We've inferred some lifetimes, which have been provided later (i.e.
635
656
// after a type or const). We want to throw an error in this case.
636
657
637
- if arg_count_correct {
658
+ if arg_count. correct . is_ok ( )
659
+ && arg_count. explicit_late_bound == ExplicitLateBound :: No
660
+ {
638
661
let kind = arg. descr ( ) ;
639
662
assert_eq ! ( kind, "lifetime" ) ;
640
663
let provided =
@@ -699,8 +722,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
699
722
generic_args : & ' a hir:: GenericArgs < ' _ > ,
700
723
infer_args : bool ,
701
724
self_ty : Option < Ty < ' tcx > > ,
702
- ) -> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' a , ' tcx > > , Result < ( ) , GenericArgCountMismatch > )
703
- {
725
+ ) -> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' a , ' tcx > > , GenericArgCountResult ) {
704
726
// If the type is parameterized by this region, then replace this
705
727
// region with the current anon region binding (in other words,
706
728
// whatever & would get replaced with).
@@ -726,7 +748,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
726
748
assert ! ( self_ty. is_none( ) && parent_substs. is_empty( ) ) ;
727
749
}
728
750
729
- let arg_count_correct = Self :: check_generic_arg_count (
751
+ let arg_count = Self :: check_generic_arg_count (
730
752
tcx,
731
753
span,
732
754
& generic_params,
@@ -761,7 +783,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
761
783
parent_substs,
762
784
self_ty. is_some ( ) ,
763
785
self_ty,
764
- arg_count_correct . is_ok ( ) ,
786
+ arg_count . clone ( ) ,
765
787
// Provide the generic args, and whether types should be inferred.
766
788
|did| {
767
789
if did == def_id {
@@ -880,7 +902,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
880
902
generic_params, self_ty, substs
881
903
) ;
882
904
883
- ( substs, assoc_bindings, arg_count_correct )
905
+ ( substs, assoc_bindings, arg_count )
884
906
}
885
907
886
908
crate fn create_substs_for_associated_item (
@@ -1011,14 +1033,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1011
1033
self_ty : Ty < ' tcx > ,
1012
1034
bounds : & mut Bounds < ' tcx > ,
1013
1035
speculative : bool ,
1014
- ) -> Result < ( ) , GenericArgCountMismatch > {
1036
+ ) -> GenericArgCountResult {
1015
1037
let trait_def_id = trait_ref. trait_def_id ( ) . unwrap_or_else ( || FatalError . raise ( ) ) ;
1016
1038
1017
1039
debug ! ( "instantiate_poly_trait_ref({:?}, def_id={:?})" , trait_ref, trait_def_id) ;
1018
1040
1019
1041
self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 ) ;
1020
1042
1021
- let ( substs, assoc_bindings, arg_count_correct ) = self . create_substs_for_ast_trait_ref (
1043
+ let ( substs, assoc_bindings, arg_count ) = self . create_substs_for_ast_trait_ref (
1022
1044
trait_ref. path . span ,
1023
1045
trait_def_id,
1024
1046
self_ty,
@@ -1048,7 +1070,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1048
1070
trait_ref, bounds, poly_trait_ref
1049
1071
) ;
1050
1072
1051
- arg_count_correct
1073
+ arg_count
1052
1074
}
1053
1075
1054
1076
/// Given a trait bound like `Debug`, applies that trait bound the given self-type to construct
@@ -1076,7 +1098,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1076
1098
constness : Constness ,
1077
1099
self_ty : Ty < ' tcx > ,
1078
1100
bounds : & mut Bounds < ' tcx > ,
1079
- ) -> Result < ( ) , GenericArgCountMismatch > {
1101
+ ) -> GenericArgCountResult {
1080
1102
self . instantiate_poly_trait_ref_inner (
1081
1103
& poly_trait_ref. trait_ref ,
1082
1104
poly_trait_ref. span ,
@@ -1166,8 +1188,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1166
1188
trait_def_id : DefId ,
1167
1189
self_ty : Ty < ' tcx > ,
1168
1190
trait_segment : & ' a hir:: PathSegment < ' a > ,
1169
- ) -> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' a , ' tcx > > , Result < ( ) , GenericArgCountMismatch > )
1170
- {
1191
+ ) -> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' a , ' tcx > > , GenericArgCountResult ) {
1171
1192
debug ! ( "create_substs_for_ast_trait_ref(trait_segment={:?})" , trait_segment) ;
1172
1193
1173
1194
self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment) ;
@@ -1515,9 +1536,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1515
1536
let mut potential_assoc_types = Vec :: new ( ) ;
1516
1537
let dummy_self = self . tcx ( ) . types . trait_object_dummy_self ;
1517
1538
for trait_bound in trait_bounds. iter ( ) . rev ( ) {
1518
- if let Err ( GenericArgCountMismatch {
1519
- invalid_args : cur_potential_assoc_types, ..
1520
- } ) = self . instantiate_poly_trait_ref (
1539
+ if let GenericArgCountResult {
1540
+ correct :
1541
+ Err ( GenericArgCountMismatch { invalid_args : cur_potential_assoc_types, .. } ) ,
1542
+ ..
1543
+ } = self . instantiate_poly_trait_ref (
1521
1544
trait_bound,
1522
1545
Constness :: NotConst ,
1523
1546
dummy_self,
@@ -2473,6 +2496,47 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2473
2496
err. span_label ( span, "associated type not allowed here" ) . emit ( ) ;
2474
2497
}
2475
2498
2499
+ /// Prohibits explicit lifetime arguments if late-bound lifetime parameters
2500
+ /// are present. This is used both for datatypes and function calls.
2501
+ fn prohibit_explicit_late_bound_lifetimes (
2502
+ tcx : TyCtxt < ' _ > ,
2503
+ def : & ty:: Generics ,
2504
+ args : & hir:: GenericArgs < ' _ > ,
2505
+ position : GenericArgPosition ,
2506
+ ) -> ExplicitLateBound {
2507
+ let param_counts = def. own_counts ( ) ;
2508
+ let arg_counts = args. own_counts ( ) ;
2509
+ let infer_lifetimes = position != GenericArgPosition :: Type && arg_counts. lifetimes == 0 ;
2510
+
2511
+ if infer_lifetimes {
2512
+ ExplicitLateBound :: No
2513
+ } else if let Some ( span_late) = def. has_late_bound_regions {
2514
+ let msg = "cannot specify lifetime arguments explicitly \
2515
+ if late bound lifetime parameters are present";
2516
+ let note = "the late bound lifetime parameter is introduced here" ;
2517
+ let span = args. args [ 0 ] . span ( ) ;
2518
+ if position == GenericArgPosition :: Value
2519
+ && arg_counts. lifetimes != param_counts. lifetimes
2520
+ {
2521
+ let mut err = tcx. sess . struct_span_err ( span, msg) ;
2522
+ err. span_note ( span_late, note) ;
2523
+ err. emit ( ) ;
2524
+ } else {
2525
+ let mut multispan = MultiSpan :: from_span ( span) ;
2526
+ multispan. push_span_label ( span_late, note. to_string ( ) ) ;
2527
+ tcx. struct_span_lint_hir (
2528
+ LATE_BOUND_LIFETIME_ARGUMENTS ,
2529
+ args. args [ 0 ] . id ( ) ,
2530
+ multispan,
2531
+ |lint| lint. build ( msg) . emit ( ) ,
2532
+ ) ;
2533
+ }
2534
+ ExplicitLateBound :: Yes
2535
+ } else {
2536
+ ExplicitLateBound :: No
2537
+ }
2538
+ }
2539
+
2476
2540
// FIXME(eddyb, varkor) handle type paths here too, not just value ones.
2477
2541
pub fn def_ids_for_value_path_segments (
2478
2542
& self ,
0 commit comments