about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-03-04 05:49:14 +0000
committerbors <bors@rust-lang.org>2022-03-04 05:49:14 +0000
commit65f6d33b775eddfc0128c04083bbf3beea360114 (patch)
treeb1a38a27de70d46108d6679f217dcb45176a7b6e /compiler/rustc_interface/src
parent8fa5d74a7cb01ceaf1a07aa6fcaf42137d8bda58 (diff)
parentc680d39b1ecf16d3ebd3338ea0193002dec611ac (diff)
downloadrust-65f6d33b775eddfc0128c04083bbf3beea360114.tar.gz
rust-65f6d33b775eddfc0128c04083bbf3beea360114.zip
Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr
Ensure stability directives are checked in all cases

Split off  #93017

Stability and deprecation were not checked in all cases, for instance if a type error happened.
This PR moves the check earlier in the pipeline to ensure the errors are emitted in all cases.

r? `@lcnr`
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 35688a65912..1aceb4e95e6 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -922,11 +922,17 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
                 });
             },
             {
+                sess.time("unused_lib_feature_checking", || {
+                    rustc_passes::stability::check_unused_or_stable_features(tcx)
+                });
+            },
+            {
                 // We force these querie to run,
                 // since they might not otherwise get called.
                 // This marks the corresponding crate-level attributes
                 // as used, and ensures that their values are valid.
                 tcx.ensure().limits(());
+                tcx.ensure().stability_index(());
             }
         );
     });
@@ -999,11 +1005,6 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
                             .par_for_each_module(|module| tcx.ensure().check_mod_deathness(module));
                     },
                     {
-                        sess.time("unused_lib_feature_checking", || {
-                            rustc_passes::stability::check_unused_or_stable_features(tcx)
-                        });
-                    },
-                    {
                         sess.time("lint_checking", || {
                             rustc_lint::check_crate(tcx, || {
                                 rustc_lint::BuiltinCombinedLateLintPass::new()