]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_metadata/src/rmeta/decoder.rs
passes: improved partial stabilization diagnostic
[rust.git] / compiler / rustc_metadata / src / rmeta / decoder.rs
index f0ccf02c9fa5fda1f57bf7c1aecc90b7c870d876..aa5705d3fcdc3c368820455749c6d6906e893ee5 100644 (file)
@@ -21,7 +21,6 @@
 use rustc_middle::metadata::ModChild;
 use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
 use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
-use rustc_middle::thir;
 use rustc_middle::ty::codec::TyDecoder;
 use rustc_middle::ty::fast_reject::SimplifiedType;
 use rustc_middle::ty::GeneratorDiagnosticData;
@@ -638,7 +637,7 @@ fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Span {
     }
 }
 
-impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for &'tcx [thir::abstract_const::Node<'tcx>] {
+impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for &'tcx [ty::abstract_const::Node<'tcx>] {
     fn decode(d: &mut DecodeContext<'a, 'tcx>) -> Self {
         ty::codec::RefDecodable::decode(d)
     }
@@ -952,6 +951,13 @@ fn get_lib_features(self, tcx: TyCtxt<'tcx>) -> &'tcx [(Symbol, Option<Symbol>)]
         tcx.arena.alloc_from_iter(self.root.lib_features.decode(self))
     }
 
+    /// Iterates over the stability implications in the given crate (when a `#[unstable]` attribute
+    /// has an `implied_by` meta item, then the mapping from the implied feature to the actual
+    /// feature is a stability implication).
+    fn get_stability_implications(self, tcx: TyCtxt<'tcx>) -> &'tcx [(Symbol, Symbol)] {
+        tcx.arena.alloc_from_iter(self.root.stability_implications.decode(self))
+    }
+
     /// Iterates over the language items in the given crate.
     fn get_lang_items(self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, usize)] {
         tcx.arena.alloc_from_iter(
@@ -1475,14 +1481,14 @@ fn imported_source_files(self, sess: &Session) -> &'a [ImportedSourceFile] {
         // the `rust-src` component in `Src::run` in `src/bootstrap/dist.rs`.
         let virtual_rust_source_base_dir = [
             option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from),
-            sess.opts.debugging_opts.simulate_remapped_rust_src_base.clone(),
+            sess.opts.unstable_opts.simulate_remapped_rust_src_base.clone(),
         ]
         .into_iter()
         .filter(|_| {
             // Only spend time on further checks if we have what to translate *to*.
             sess.opts.real_rust_source_base_dir.is_some()
                 // Some tests need the translation to be always skipped.
-                && sess.opts.debugging_opts.translate_remapped_path_to_local_path
+                && sess.opts.unstable_opts.translate_remapped_path_to_local_path
         })
         .flatten()
         .filter(|virtual_dir| {
@@ -1584,7 +1590,7 @@ fn imported_source_files(self, sess: &Session) -> &'a [ImportedSourceFile] {
                     // `try_to_translate_virtual_to_real` don't have to worry about how the
                     // compiler is bootstrapped.
                     if let Some(virtual_dir) =
-                        &sess.opts.debugging_opts.simulate_remapped_rust_src_base
+                        &sess.opts.unstable_opts.simulate_remapped_rust_src_base
                     {
                         if let Some(real_dir) = &sess.opts.real_rust_source_base_dir {
                             if let rustc_span::FileName::Real(ref mut old_name) = name {