]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/query/on_disk_cache.rs
Auto merge of #61765 - Keruspe:rustbuild-cxx, r=alexcrichton
[rust.git] / src / librustc / ty / query / on_disk_cache.rs
index bc28396a6f9f89601212977b50bcc2fc3b08d3af..982886f0f157397ef415e3816d703112ea98ab21 100644 (file)
@@ -156,11 +156,7 @@ pub fn new_empty(source_map: &'sess SourceMap) -> OnDiskCache<'sess> {
         }
     }
 
-    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,
     {
@@ -316,7 +312,7 @@ pub fn serialize<'tcx, E>(
 
             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();
@@ -330,7 +326,7 @@ fn sorted_cnums_including_local_crate(tcx: TyCtxt<'_, '_>) -> Vec<CrateNum> {
     /// 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(
@@ -359,7 +355,7 @@ pub fn store_diagnostics(&self,
     /// 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
@@ -389,7 +385,7 @@ pub fn store_diagnostics_for_anon_node(&self,
 
     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,
@@ -430,7 +426,7 @@ fn load_indexed<'tcx, T>(
     // 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(|| {
@@ -464,7 +460,7 @@ fn compute_cnum_map(
 /// 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>>,
@@ -509,13 +505,11 @@ fn position(&self) -> usize {
 
 // 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();
 
@@ -532,7 +526,7 @@ fn decode_tagged<'a, 'tcx, D, T, V>(decoder: &mut D,
 
 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
     }
 
@@ -751,7 +745,7 @@ fn specialized_decode(&mut self) -> Result<mir::ClearCrossCrate<T>, Self::Error>
 //- 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>,
@@ -1080,7 +1074,7 @@ fn specialized_decode(&mut self) -> Result<IntEncodedWithFixedSize, Self::Error>
 }
 
 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>