Skip to content

Commit

Permalink
Feed the features_query instead of grabbing it from the session lazily
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 12, 2023
1 parent fbe2d5a commit d36db0d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@ pub fn create_global_ctxt<'tcx>(
);
feed.resolutions(tcx.arena.alloc(untracked_resolutions));
feed.output_filenames(tcx.arena.alloc(std::sync::Arc::new(outputs)));
feed.features_query(sess.features_untracked());
let feed = tcx.feed_local_crate();
feed.crate_name(crate_name);
});
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) fn provide(providers: &mut Providers) {
}

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;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ rustc_queries! {
}

query features_query(_: ()) -> &'tcx rustc_feature::Features {
eval_always
feedable
desc { "looking up enabled feature gates" }
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2402,7 +2402,6 @@ pub fn provide(providers: &mut ty::query::Providers) {

providers.extern_mod_stmt_cnum =
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
providers.features_query = |tcx, ()| tcx.sess.features_untracked();
providers.is_panic_runtime = |tcx, cnum| {
assert_eq!(cnum, LOCAL_CRATE);
tcx.sess.contains_name(tcx.hir().krate_attrs(), sym::panic_runtime)
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ impl<'a, 'hir, 'tcx> HirCollector<'a, 'hir, 'tcx> {
) {
let ast_attrs = self.tcx.hir().attrs(hir_id);
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// Check for the feature
if !cx.tcx.sess.features_untracked().lint_reasons {
if !cx.tcx.features().lint_reasons {
return;
}

Expand Down

0 comments on commit d36db0d

Please sign in to comment.