File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -258,12 +258,8 @@ mod interner {
258
258
///
259
259
/// This operation cannot fails since the only way to have a [Symbol] is to have
260
260
/// [interned](Interner::intern) the corresponding string first.
261
- pub ( crate ) fn lookup < ' slf > ( & ' slf self , sym : Symbol ) -> & ' slf str {
262
- // SAFETY: We are making the returned &str lifetime the same as our struct,
263
- // which is okay here since the InnerInterner uses a typed_arena which prevents
264
- // deallocations, so the reference will be valid while the InnerInterner exists,
265
- // hence while the struct exists.
266
- unsafe { std:: mem:: transmute :: < & ' _ str , & ' slf str > ( self . 0 . read ( ) . unwrap ( ) . lookup ( sym) ) }
261
+ pub ( crate ) fn lookup ( & self , sym : Symbol ) -> & ' a str {
262
+ self . 0 . read ( ) . unwrap ( ) . lookup ( sym)
267
263
}
268
264
}
269
265
@@ -315,7 +311,7 @@ mod interner {
315
311
///
316
312
/// This operation cannot fails since the only way to have a [Symbol]
317
313
/// is to have [interned](InnerInterner::intern) the corresponding string first.
318
- fn lookup < ' slf > ( & ' slf self , sym : Symbol ) -> & ' slf str {
314
+ fn lookup ( & self , sym : Symbol ) -> & ' a str {
319
315
self . vec [ sym. 0 as usize ]
320
316
}
321
317
}
You can’t perform that action at this time.
0 commit comments