1
Fork 0

Fix ICE when opaque captures a duplicated/invalid lifetime

This commit is contained in:
Michael Goulet 2025-01-01 16:55:10 +00:00
parent 7f75bfa1ad
commit d3c6067275
8 changed files with 53 additions and 27 deletions

View file

@ -1845,11 +1845,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
GenericParamKind::Lifetime => {
// AST resolution emitted an error on those parameters, so we lower them using
// `ParamName::Error`.
let ident = self.lower_ident(param.ident);
let param_name =
if let Some(LifetimeRes::Error) = self.resolver.get_lifetime_res(param.id) {
ParamName::Error
ParamName::Error(ident)
} else {
let ident = self.lower_ident(param.ident);
ParamName::Plain(ident)
};
let kind =