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 {
246246
247247impl GenericParamsStorage {
248248 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+ {
250253 return GenericParamsId :: EMPTY ;
251254 }
252255
Original file line number Diff line number Diff line change @@ -856,7 +856,12 @@ impl<'a> InferenceContext<'a> {
856856 // handle provided type arguments
857857 if let Some ( generic_args) = generic_args {
858858 // 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+ {
860865 match arg {
861866 GenericArg :: Type ( type_ref) => {
862867 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(
565565 if generic_args. has_self_type { self_params + type_params } else { type_params } ;
566566 let skip = if generic_args. has_self_type && self_params == 0 { 1 } else { 0 } ;
567567 // 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+ {
569575 match arg {
570576 GenericArg :: Type ( type_ref) => {
571577 had_explicit_type_args = true ;
You can’t perform that action at this time.
0 commit comments