File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,10 @@ struct GenericParamsStorage {
246
246
247
247
impl GenericParamsStorage {
248
248
fn alloc ( & mut self , params : GenericParams ) -> GenericParamsId {
249
- if params. types . is_empty ( ) && params. where_predicates . is_empty ( ) {
249
+ if params. types . is_empty ( )
250
+ && params. lifetimes . is_empty ( )
251
+ && params. where_predicates . is_empty ( )
252
+ {
250
253
return GenericParamsId :: EMPTY ;
251
254
}
252
255
Original file line number Diff line number Diff line change @@ -856,7 +856,12 @@ impl<'a> InferenceContext<'a> {
856
856
// handle provided type arguments
857
857
if let Some ( generic_args) = generic_args {
858
858
// if args are provided, it should be all of them, but we can't rely on that
859
- for arg in generic_args. args . iter ( ) . take ( type_params) {
859
+ for arg in generic_args
860
+ . args
861
+ . iter ( )
862
+ . filter ( |arg| matches ! ( arg, GenericArg :: Type ( _) ) )
863
+ . take ( type_params)
864
+ {
860
865
match arg {
861
866
GenericArg :: Type ( type_ref) => {
862
867
let ty = self . make_ty ( type_ref) ;
Original file line number Diff line number Diff line change @@ -565,7 +565,13 @@ fn substs_from_path_segment(
565
565
if generic_args. has_self_type { self_params + type_params } else { type_params } ;
566
566
let skip = if generic_args. has_self_type && self_params == 0 { 1 } else { 0 } ;
567
567
// if args are provided, it should be all of them, but we can't rely on that
568
- for arg in generic_args. args . iter ( ) . skip ( skip) . take ( expected_num) {
568
+ for arg in generic_args
569
+ . args
570
+ . iter ( )
571
+ . filter ( |arg| matches ! ( arg, GenericArg :: Type ( _) ) )
572
+ . skip ( skip)
573
+ . take ( expected_num)
574
+ {
569
575
match arg {
570
576
GenericArg :: Type ( type_ref) => {
571
577
had_explicit_type_args = true ;
You can’t perform that action at this time.
0 commit comments