Update tests of "unused_lifetimes" lint for async functions and corresponding source code
This commit is contained in:
parent
5be3f9f10e
commit
64f11b9639
3 changed files with 58 additions and 57 deletions
|
@ -644,17 +644,17 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
|||
} else {
|
||||
bug!();
|
||||
};
|
||||
if let hir::ParamName::Plain(param_name) = name {
|
||||
if param_name.name == kw::UnderscoreLifetime {
|
||||
// Pick the elided lifetime "definition" if one exists
|
||||
// and use it to make an elision scope.
|
||||
self.lifetime_uses.insert(def_id, LifetimeUseSet::Many);
|
||||
elision = Some(reg);
|
||||
} else {
|
||||
lifetimes.insert(name, reg);
|
||||
}
|
||||
// We cannot predict what lifetimes are unused in opaque type.
|
||||
self.lifetime_uses.insert(def_id, LifetimeUseSet::Many);
|
||||
if let hir::ParamName::Plain(Ident {
|
||||
name: kw::UnderscoreLifetime,
|
||||
..
|
||||
}) = name
|
||||
{
|
||||
// Pick the elided lifetime "definition" if one exists
|
||||
// and use it to make an elision scope.
|
||||
elision = Some(reg);
|
||||
} else {
|
||||
self.lifetime_uses.insert(def_id, LifetimeUseSet::Many);
|
||||
lifetimes.insert(name, reg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue