diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /compiler/rustc_middle/src/middle/resolve_lifetime.rs | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_middle/src/middle/resolve_lifetime.rs')
-rw-r--r-- | compiler/rustc_middle/src/middle/resolve_lifetime.rs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/compiler/rustc_middle/src/middle/resolve_lifetime.rs b/compiler/rustc_middle/src/middle/resolve_lifetime.rs deleted file mode 100644 index c3bf1c717..000000000 --- a/compiler/rustc_middle/src/middle/resolve_lifetime.rs +++ /dev/null @@ -1,55 +0,0 @@ -//! Name resolution for lifetimes: type declarations. - -use crate::ty; - -use rustc_data_structures::fx::FxHashMap; -use rustc_hir::def_id::DefId; -use rustc_hir::{ItemLocalId, OwnerId}; -use rustc_macros::HashStable; - -#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, HashStable)] -pub enum Region { - Static, - EarlyBound(/* lifetime decl */ DefId), - LateBound(ty::DebruijnIndex, /* late-bound index */ u32, /* lifetime decl */ DefId), - Free(DefId, /* lifetime decl */ DefId), -} - -/// A set containing, at most, one known element. -/// If two distinct values are inserted into a set, then it -/// becomes `Many`, which can be used to detect ambiguities. -#[derive(Copy, Clone, PartialEq, Eq, TyEncodable, TyDecodable, Debug, HashStable)] -pub enum Set1<T> { - Empty, - One(T), - Many, -} - -impl<T: PartialEq> Set1<T> { - pub fn insert(&mut self, value: T) { - *self = match self { - Set1::Empty => Set1::One(value), - Set1::One(old) if *old == value => return, - _ => Set1::Many, - }; - } -} - -#[derive(Copy, Clone, Debug, HashStable, Encodable, Decodable)] -pub enum ObjectLifetimeDefault { - Empty, - Static, - Ambiguous, - Param(DefId), -} - -/// Maps the id of each lifetime reference to the lifetime decl -/// that it corresponds to. -#[derive(Default, HashStable, Debug)] -pub struct ResolveLifetimes { - /// Maps from every use of a named (not anonymous) lifetime to a - /// `Region` describing how that region is bound - pub defs: FxHashMap<OwnerId, FxHashMap<ItemLocalId, Region>>, - - pub late_bound_vars: FxHashMap<OwnerId, FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>>, -} |