Do not lower generic lifetime params when AST resolution emitted an error.
This commit is contained in:
parent
a265c49b25
commit
c75409d5e4
4 changed files with 18 additions and 24 deletions
|
@ -1939,6 +1939,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
param.ident,
|
||||
orig_is_param,
|
||||
);
|
||||
// Record lifetime res, so lowering knows there is something fishy.
|
||||
self.record_lifetime_res(param.id, LifetimeRes::Error);
|
||||
continue;
|
||||
}
|
||||
Entry::Vacant(entry) => {
|
||||
entry.insert(true);
|
||||
|
@ -1966,6 +1969,8 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
)
|
||||
.span_label(param.ident.span, "`'_` is a reserved lifetime name")
|
||||
.emit();
|
||||
// Record lifetime res, so lowering knows there is something fishy.
|
||||
self.record_lifetime_res(param.id, LifetimeRes::Error);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1979,6 +1984,8 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
)
|
||||
.span_label(param.ident.span, "'static is a reserved lifetime name")
|
||||
.emit();
|
||||
// Record lifetime res, so lowering knows there is something fishy.
|
||||
self.record_lifetime_res(param.id, LifetimeRes::Error);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue