1
Fork 0

Feed the features_query instead of grabbing it from the session lazily

This commit is contained in:
Oli Scherer 2022-12-05 17:52:17 +00:00
parent fbe2d5aad2
commit d36db0d2a0
6 changed files with 5 additions and 5 deletions

View file

@ -834,6 +834,7 @@ pub fn create_global_ctxt<'tcx>(
); );
feed.resolutions(tcx.arena.alloc(untracked_resolutions)); feed.resolutions(tcx.arena.alloc(untracked_resolutions));
feed.output_filenames(tcx.arena.alloc(std::sync::Arc::new(outputs))); feed.output_filenames(tcx.arena.alloc(std::sync::Arc::new(outputs)));
feed.features_query(sess.features_untracked());
let feed = tcx.feed_local_crate(); let feed = tcx.feed_local_crate();
feed.crate_name(crate_name); feed.crate_name(crate_name);
}); });

View file

@ -12,7 +12,7 @@ pub(crate) fn provide(providers: &mut Providers) {
} }
fn check_expectations(tcx: TyCtxt<'_>, tool_filter: Option<Symbol>) { fn check_expectations(tcx: TyCtxt<'_>, tool_filter: Option<Symbol>) {
if !tcx.sess.features_untracked().enabled(sym::lint_reasons) { if !tcx.features().enabled(sym::lint_reasons) {
return; return;
} }

View file

@ -2041,7 +2041,7 @@ rustc_queries! {
} }
query features_query(_: ()) -> &'tcx rustc_feature::Features { query features_query(_: ()) -> &'tcx rustc_feature::Features {
eval_always feedable
desc { "looking up enabled feature gates" } desc { "looking up enabled feature gates" }
} }

View file

@ -2402,7 +2402,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
providers.extern_mod_stmt_cnum = providers.extern_mod_stmt_cnum =
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned(); |tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
providers.features_query = |tcx, ()| tcx.sess.features_untracked();
providers.is_panic_runtime = |tcx, cnum| { providers.is_panic_runtime = |tcx, cnum| {
assert_eq!(cnum, LOCAL_CRATE); assert_eq!(cnum, LOCAL_CRATE);
tcx.sess.contains_name(tcx.hir().krate_attrs(), sym::panic_runtime) tcx.sess.contains_name(tcx.hir().krate_attrs(), sym::panic_runtime)

View file

@ -1221,7 +1221,7 @@ impl<'a, 'hir, 'tcx> HirCollector<'a, 'hir, 'tcx> {
) { ) {
let ast_attrs = self.tcx.hir().attrs(hir_id); let ast_attrs = self.tcx.hir().attrs(hir_id);
if let Some(ref cfg) = ast_attrs.cfg(self.tcx, &FxHashSet::default()) { if let Some(ref cfg) = ast_attrs.cfg(self.tcx, &FxHashSet::default()) {
if !cfg.matches(&self.sess.parse_sess, Some(self.sess.features_untracked())) { if !cfg.matches(&self.sess.parse_sess, Some(self.tcx.features())) {
return; return;
} }
} }

View file

@ -472,7 +472,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_>, name: Symbol, items: &[NestedMe
fn check_lint_reason(cx: &LateContext<'_>, name: Symbol, items: &[NestedMetaItem], attr: &'_ Attribute) { fn check_lint_reason(cx: &LateContext<'_>, name: Symbol, items: &[NestedMetaItem], attr: &'_ Attribute) {
// Check for the feature // Check for the feature
if !cx.tcx.sess.features_untracked().lint_reasons { if !cx.tcx.features().lint_reasons {
return; return;
} }