mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Remove unused cache.
This commit is contained in:
@@ -162,9 +162,6 @@ pub(super) struct DecodeContext<'a, 'tcx> {
|
||||
sess: Option<&'tcx Session>,
|
||||
tcx: Option<TyCtxt<'tcx>>,
|
||||
|
||||
// Cache the last used source_file for translating spans as an optimization.
|
||||
last_source_file_index: usize,
|
||||
|
||||
lazy_state: LazyState,
|
||||
|
||||
// Used for decoding interpret::AllocIds in a cached & thread-safe manner.
|
||||
@@ -193,7 +190,6 @@ fn decoder(self, pos: usize) -> DecodeContext<'a, 'tcx> {
|
||||
blob: self.blob(),
|
||||
sess: self.sess().or(tcx.map(|tcx| tcx.sess)),
|
||||
tcx,
|
||||
last_source_file_index: 0,
|
||||
lazy_state: LazyState::NoNode,
|
||||
alloc_decoding_session: self
|
||||
.cdata()
|
||||
@@ -582,12 +578,6 @@ fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Span {
|
||||
cnum
|
||||
);
|
||||
|
||||
// Decoding 'foreign' spans should be rare enough that it's
|
||||
// not worth it to maintain a per-CrateNum cache for `last_source_file_index`.
|
||||
// We just set it to 0, to ensure that we don't try to access something out
|
||||
// of bounds for our initial 'guess'
|
||||
decoder.last_source_file_index = 0;
|
||||
|
||||
let foreign_data = decoder.cdata().cstore.get_crate_data(cnum);
|
||||
foreign_data.imported_source_file(metadata_index, sess)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user