X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_query_system%2Fsrc%2Fquery%2Fcaches.rs;h=9f875b4373173cac741bc7fdd5058627de025b0e;hb=d4598406336a1100786ff15708b48a51768ec235;hp=21c89cbc4f19da63e3e793815ef71d1e2922fc12;hpb=7c4e6edb056d00dd02ac7caa8acacb125d79dd28;p=rust.git diff --git a/compiler/rustc_query_system/src/query/caches.rs b/compiler/rustc_query_system/src/query/caches.rs index 21c89cbc4f1..9f875b43731 100644 --- a/compiler/rustc_query_system/src/query/caches.rs +++ b/compiler/rustc_query_system/src/query/caches.rs @@ -23,10 +23,6 @@ pub trait CacheSelector<'tcx, V> { pub trait QueryStorage { type Value: Debug; type Stored: Copy; - - /// Store a value without putting it in the cache. - /// This is meant to be used with cycle errors. - fn store_nocache(&self, value: Self::Value) -> Self::Stored; } pub trait QueryCache: QueryStorage + Sized { @@ -68,12 +64,6 @@ fn default() -> Self { impl QueryStorage for DefaultCache { type Value = V; type Stored = V; - - #[inline] - fn store_nocache(&self, value: Self::Value) -> Self::Stored { - // We have no dedicated storage - value - } } impl QueryCache for DefaultCache @@ -144,13 +134,6 @@ fn default() -> Self { impl<'tcx, K: Eq + Hash, V: Debug + 'tcx> QueryStorage for ArenaCache<'tcx, K, V> { type Value = V; type Stored = &'tcx V; - - #[inline] - fn store_nocache(&self, value: Self::Value) -> Self::Stored { - let value = self.arena.alloc((value, DepNodeIndex::INVALID)); - let value = unsafe { &*(&value.0 as *const _) }; - &value - } } impl<'tcx, K, V: 'tcx> QueryCache for ArenaCache<'tcx, K, V> @@ -231,12 +214,6 @@ fn default() -> Self { impl QueryStorage for VecCache { type Value = V; type Stored = V; - - #[inline] - fn store_nocache(&self, value: Self::Value) -> Self::Stored { - // We have no dedicated storage - value - } } impl QueryCache for VecCache @@ -309,13 +286,6 @@ fn default() -> Self { impl<'tcx, K: Eq + Idx, V: Debug + 'tcx> QueryStorage for VecArenaCache<'tcx, K, V> { type Value = V; type Stored = &'tcx V; - - #[inline] - fn store_nocache(&self, value: Self::Value) -> Self::Stored { - let value = self.arena.alloc((value, DepNodeIndex::INVALID)); - let value = unsafe { &*(&value.0 as *const _) }; - &value - } } impl<'tcx, K, V: 'tcx> QueryCache for VecArenaCache<'tcx, K, V>