Skip to content

Commit 0e861cc

Browse files
authored
Rollup merge of #105624 - compiler-errors:cache-unsound, r=jyn514
Fix unsoundness in bootstrap cache code Discovered via #105575, which showed that rustc was failing to build during a perf run.
2 parents 6d3a93c + 675fa0b commit 0e861cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bootstrap/cache.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ impl<T: Internable + Hash> Hash for Interned<T> {
8989

9090
impl<T: Internable + Deref> Deref for Interned<T> {
9191
type Target = T::Target;
92-
fn deref(&self) -> &'static Self::Target {
92+
fn deref(&self) -> &Self::Target {
9393
let l = T::intern_cache().lock().unwrap();
94-
unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) }
94+
unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) }
9595
}
9696
}
9797

9898
impl<T: Internable + AsRef<U>, U: ?Sized> AsRef<U> for Interned<T> {
99-
fn as_ref(&self) -> &'static U {
99+
fn as_ref(&self) -> &U {
100100
let l = T::intern_cache().lock().unwrap();
101-
unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
101+
unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
102102
}
103103
}
104104

0 commit comments

Comments
 (0)