}
}
- pub fn serialize<'tcx, E>(
- &self,
- tcx: TyCtxt<'tcx, 'tcx>,
- encoder: &mut E,
- ) -> Result<(), E::Error>
+ pub fn serialize<'tcx, E>(&self, tcx: TyCtxt<'tcx>, encoder: &mut E) -> Result<(), E::Error>
where
E: ty_codec::TyEncoder,
{
return Ok(());
- fn sorted_cnums_including_local_crate(tcx: TyCtxt<'_, '_>) -> Vec<CrateNum> {
+ fn sorted_cnums_including_local_crate(tcx: TyCtxt<'_>) -> Vec<CrateNum> {
let mut cnums = vec![LOCAL_CRATE];
cnums.extend_from_slice(&tcx.crates()[..]);
cnums.sort_unstable();
/// Loads a diagnostic emitted during the previous compilation session.
pub fn load_diagnostics<'tcx>(
&self,
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
dep_node_index: SerializedDepNodeIndex,
) -> Vec<Diagnostic> {
let diagnostics: Option<EncodedDiagnostics> = self.load_indexed(
/// the given `SerializedDepNodeIndex`; otherwise returns `None`.
pub fn try_load_query_result<'tcx, T>(
&self,
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
dep_node_index: SerializedDepNodeIndex,
) -> Option<T>
where
fn load_indexed<'tcx, T>(
&self,
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
dep_node_index: SerializedDepNodeIndex,
index: &FxHashMap<SerializedDepNodeIndex, AbsoluteBytePos>,
debug_tag: &'static str,
// Session that don't occur in the current one. For these, the mapping
// maps to None.
fn compute_cnum_map(
- tcx: TyCtxt<'_, '_>,
+ tcx: TyCtxt<'_>,
prev_cnums: &[(u32, String, CrateDisambiguator)],
) -> IndexVec<CrateNum, Option<CrateNum>> {
tcx.dep_graph.with_ignore(|| {
/// we use for crate metadata decoding in that it can rebase spans and
/// eventually will also handle things that contain `Ty` instances.
struct CacheDecoder<'a, 'tcx> {
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
opaque: opaque::Decoder<'a>,
source_map: &'a SourceMap,
cnum_map: &'a IndexVec<CrateNum, Option<CrateNum>>,
// Decode something that was encoded with encode_tagged() and verify that the
// tag matches and the correct amount of bytes was read.
-fn decode_tagged<'a, 'tcx, D, T, V>(decoder: &mut D,
- expected_tag: T)
- -> Result<V, D::Error>
- where T: Decodable + Eq + ::std::fmt::Debug,
- V: Decodable,
- D: DecoderWithPosition,
- 'tcx: 'a,
+fn decode_tagged<D, T, V>(decoder: &mut D, expected_tag: T) -> Result<V, D::Error>
+where
+ T: Decodable + Eq + ::std::fmt::Debug,
+ V: Decodable,
+ D: DecoderWithPosition,
{
let start_pos = decoder.position();
impl<'a, 'tcx> ty_codec::TyDecoder<'tcx> for CacheDecoder<'a, 'tcx> {
#[inline]
- fn tcx(&self) -> TyCtxt<'tcx, 'tcx> {
+ fn tcx(&self) -> TyCtxt<'tcx> {
self.tcx
}
//- ENCODING -------------------------------------------------------------------
struct CacheEncoder<'a, 'tcx, E: ty_codec::TyEncoder> {
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
encoder: &'a mut E,
type_shorthands: FxHashMap<Ty<'tcx>, usize>,
predicate_shorthands: FxHashMap<ty::Predicate<'tcx>, usize>,
}
fn encode_query_results<'a, 'tcx, Q, E>(
- tcx: TyCtxt<'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx>,
encoder: &mut CacheEncoder<'a, 'tcx, E>,
query_result_index: &mut EncodedQueryResultIndex,
) -> Result<(), E::Error>