Ignore lifetime params in substitutions

This commit is contained in:
Lukas Wirth 2020-12-13 11:34:44 +01:00
parent 10f6332831
commit ae8a802085
3 changed files with 17 additions and 3 deletions

View file

@ -856,7 +856,12 @@ impl<'a> InferenceContext<'a> {
// handle provided type arguments
if let Some(generic_args) = generic_args {
// if args are provided, it should be all of them, but we can't rely on that
for arg in generic_args.args.iter().take(type_params) {
for arg in generic_args
.args
.iter()
.filter(|arg| matches!(arg, GenericArg::Type(_)))
.take(type_params)
{
match arg {
GenericArg::Type(type_ref) => {
let ty = self.make_ty(type_ref);