@@ -9,7 +9,6 @@ use crate::durability::Durability;
9
9
use crate :: id:: { AsId , LookupId } ;
10
10
use crate :: ingredient:: { fmt_index, IngredientRequiresReset } ;
11
11
use crate :: key:: DependencyIndex ;
12
- use crate :: plumbing:: transmute_lifetime;
13
12
use crate :: runtime:: local_state:: QueryOrigin ;
14
13
use crate :: runtime:: Runtime ;
15
14
use crate :: { DatabaseKeyIndex , Id } ;
@@ -30,7 +29,7 @@ pub trait Configuration: Sized {
30
29
/// created or, if a struct is being reused, after we have updated its
31
30
/// fields (or confirmed it is green and no updates are required).
32
31
///
33
- /// # Unsafety
32
+ /// # Safety
34
33
///
35
34
/// Requires that `ptr` represents a "confirmed" value in this revision,
36
35
/// which means that it will remain valid and immutable for the remainder of this
@@ -40,7 +39,7 @@ pub trait Configuration: Sized {
40
39
/// Deref the struct to yield the underlying value struct.
41
40
/// Since we are still part of the `'db` lifetime in which the struct was created,
42
41
/// this deref is safe, and the value-struct fields are immutable and verified.
43
- fn deref_struct < ' db > ( s : Self :: Struct < ' db > ) -> & ' db ValueStruct < Self > ;
42
+ fn deref_struct ( s : Self :: Struct < ' _ > ) -> & ValueStruct < Self > ;
44
43
}
45
44
46
45
pub trait InternedData : Sized + Eq + Hash + Clone { }
@@ -152,7 +151,7 @@ where
152
151
}
153
152
}
154
153
155
- pub fn interned_value < ' db > ( & ' db self , id : Id ) -> C :: Struct < ' db > {
154
+ pub fn interned_value ( & self , id : Id ) -> C :: Struct < ' _ > {
156
155
let r = self . value_map . get ( & id) . unwrap ( ) ;
157
156
158
157
// SAFETY: Items are only removed from the `value_map` with an `&mut self` reference.
@@ -162,7 +161,7 @@ where
162
161
/// Lookup the data for an interned value based on its id.
163
162
/// Rarely used since end-users generally carry a struct with a pointer directly
164
163
/// to the interned item.
165
- pub fn data < ' db > ( & ' db self , id : Id ) -> & ' db C :: Data < ' db > {
164
+ pub fn data ( & self , id : Id ) -> & C :: Data < ' _ > {
166
165
C :: deref_struct ( self . interned_value ( id) ) . data ( )
167
166
}
168
167
@@ -284,7 +283,7 @@ impl<C> ValueStruct<C>
284
283
where
285
284
C : Configuration ,
286
285
{
287
- pub fn data < ' db > ( & ' db self ) -> & ' db C :: Data < ' db > {
286
+ pub fn data ( & self ) -> & C :: Data < ' _ > {
288
287
// SAFETY: The lifetime of `self` is tied to the interning ingredient;
289
288
// we never remove data without an `&mut self` access to the interning ingredient.
290
289
unsafe { self . to_self_ref ( & self . fields ) }
0 commit comments