Rollup merge of #91888 - BoxyUwU:generic_arg_infer_aaaa, r=lcnr

Handle unordered const/ty generics for object lifetime defaults

*feel like I should have a PR description but cant think of what to put here*

r? ```@lcnr```
This commit is contained in:
Matthias Krüger 2021-12-15 08:36:23 +01:00 committed by GitHub
commit 6b00227666
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 21 deletions

View file

@ -2541,8 +2541,8 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
GenericParamDefKind::Type { object_lifetime_default, .. } => {
Some(object_lifetime_default)
}
GenericParamDefKind::Lifetime
| GenericParamDefKind::Const { .. } => None,
GenericParamDefKind::Const { .. } => Some(Set1::Empty),
GenericParamDefKind::Lifetime => None,
})
.collect()
})
@ -2569,12 +2569,11 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
}
GenericArg::Const(ct) => {
self.visit_anon_const(&ct.value);
i += 1;
}
GenericArg::Infer(inf) => {
self.visit_id(inf.hir_id);
if inf.kind.is_type() {
i += 1;
}
i += 1;
}
}
}