Skip to content

Commit 2c15b50

Browse files
committed
WIP,DNC: Enable caching of legacy bang expansions
1 parent 6134b01 commit 2c15b50

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ rustc_queries! {
111111
}
112112

113113
query expand_legacy_bang(key: (LocalExpnId, LocalExpnId)) -> Result<(&'tcx TokenStream, usize), (Span, ErrorGuaranteed)> {
114-
eval_always
115114
no_hash
115+
// eval_always
116+
cache_on_disk_if { true }
116117
desc { "expand legacy bang" }
117118
}
118119

compiler/rustc_middle/src/query/on_disk_cache.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,13 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>>
790790
}
791791
}
792792

793+
impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx rustc_ast::tokenstream::TokenStream {
794+
#[inline]
795+
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Self {
796+
RefDecodable::decode(d)
797+
}
798+
}
799+
793800
macro_rules! impl_ref_decoder {
794801
(<$tcx:tt> $($ty:ty,)*) => {
795802
$(impl<'a, $tcx> Decodable<CacheDecoder<'a, $tcx>> for &$tcx [$ty] {

compiler/rustc_middle/src/ty/codec.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for ty::List<Ty
335335
}
336336
}
337337

338+
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D>
339+
for rustc_ast::tokenstream::TokenStream
340+
{
341+
fn decode(_decoder: &mut D) -> &'tcx Self {
342+
todo!("felix foobar next")
343+
}
344+
}
345+
338346
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D>
339347
for ty::List<ty::PolyExistentialPredicate<'tcx>>
340348
{

0 commit comments

Comments
 (0)