about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/context.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-18 16:27:59 +0000
committerbors <bors@rust-lang.org>2025-07-18 16:27:59 +0000
commit8f08b3a32478b8d0507732800ecb548a76e0fd0c (patch)
treeabdd62e27dec75c21bc2569e90a650de0513fb2c /compiler/rustc_middle/src/ty/context.rs
parent82310651b93a594a3fd69015e1562186a080d94c (diff)
parent7662731d75ceb19f6242c61a6812c22809e6adc2 (diff)
downloadrust-8f08b3a32478b8d0507732800ecb548a76e0fd0c.tar.gz
rust-8f08b3a32478b8d0507732800ecb548a76e0fd0c.zip
Auto merge of #143845 - cjgillot:stability-query, r=jieyouxu
Split-up stability_index query

This PR aims to move deprecation and stability processing away from the monolithic `stability_index` query, and directly implement `lookup_{deprecation,stability,body_stability,const_stability}` queries.

The basic idea is to:
- move per-attribute sanity checks into `check_attr.rs`;
- move attribute compatibility checks into the `MissingStabilityAnnotations` visitor;
- progressively dismantle the `Annotator` visitor and the `stability_index` query.

The first commit contains functional change, and now warns when `#[automatically_derived]` is applied on a non-trait impl block. The other commits should not change visible behaviour.

Perf in https://github.com/rust-lang/rust/pull/143845#issuecomment-3066308630 shows small but consistent improvement, except for unused-warnings case. That case being a stress test, I'm leaning towards accepting the regression.

This PR changes `check_attr`, so has a high conflict rate on that file. This should not cause issues for review.
Diffstat (limited to 'compiler/rustc_middle/src/ty/context.rs')
-rw-r--r--compiler/rustc_middle/src/ty/context.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 81c13e55dd8..7e6bcfee025 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -65,7 +65,7 @@ use crate::infer::canonical::{CanonicalParamEnvCache, CanonicalVarKind, Canonica
 use crate::lint::lint_level;
 use crate::metadata::ModChild;
 use crate::middle::codegen_fn_attrs::{CodegenFnAttrs, TargetFeature};
-use crate::middle::{resolve_bound_vars, stability};
+use crate::middle::resolve_bound_vars;
 use crate::mir::interpret::{self, Allocation, ConstAllocation};
 use crate::mir::{Body, Local, Place, PlaceElem, ProjectionKind, Promoted};
 use crate::query::plumbing::QuerySystem;
@@ -1807,10 +1807,6 @@ impl<'tcx> TyCtxt<'tcx> {
         )
     }
 
-    pub fn stability(self) -> &'tcx stability::Index {
-        self.stability_index(())
-    }
-
     pub fn features(self) -> &'tcx rustc_feature::Features {
         self.features_query(())
     }