Merge Implicit and ImplicitMissing.
This commit is contained in:
parent
72dc29c260
commit
aa2450f41b
6 changed files with 19 additions and 36 deletions
|
@ -1952,7 +1952,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
|
|||
|
||||
crate fn report_elided_lifetime_in_ty(&self, lifetime_refs: &[&hir::Lifetime]) {
|
||||
let Some(missing_lifetime) = lifetime_refs.iter().find(|lt| {
|
||||
lt.name == hir::LifetimeName::ImplicitMissing
|
||||
lt.name == hir::LifetimeName::Implicit(true)
|
||||
}) else { return };
|
||||
|
||||
let mut spans: Vec<_> = lifetime_refs.iter().map(|lt| lt.span).collect();
|
||||
|
@ -2408,8 +2408,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
|
|||
);
|
||||
let is_allowed_lifetime = matches!(
|
||||
lifetime_ref.name,
|
||||
hir::LifetimeName::Implicit
|
||||
| hir::LifetimeName::ImplicitMissing
|
||||
hir::LifetimeName::Implicit(_)
|
||||
| hir::LifetimeName::Static
|
||||
| hir::LifetimeName::Underscore
|
||||
);
|
||||
|
|
|
@ -923,7 +923,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
|||
}
|
||||
});
|
||||
match lifetime.name {
|
||||
LifetimeName::Implicit | hir::LifetimeName::ImplicitMissing => {
|
||||
LifetimeName::Implicit(_) => {
|
||||
// For types like `dyn Foo`, we should
|
||||
// generate a special form of elided.
|
||||
span_bug!(ty.span, "object-lifetime-default expected, not implicit",);
|
||||
|
@ -3282,9 +3282,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
))
|
||||
.emit();
|
||||
}
|
||||
hir::LifetimeName::Param(_)
|
||||
| hir::LifetimeName::Implicit
|
||||
| hir::LifetimeName::ImplicitMissing => {
|
||||
hir::LifetimeName::Param(_) | hir::LifetimeName::Implicit(_) => {
|
||||
self.resolve_lifetime_ref(lt);
|
||||
}
|
||||
hir::LifetimeName::ImplicitObjectLifetimeDefault => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue