Skip to content

Commit d36db0d

Browse files
committed
Feed the features_query instead of grabbing it from the session lazily
1 parent fbe2d5a commit d36db0d

File tree

6 files changed

+5
-5
lines changed

6 files changed

+5
-5
lines changed

compiler/rustc_interface/src/passes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ pub fn create_global_ctxt<'tcx>(
834834
);
835835
feed.resolutions(tcx.arena.alloc(untracked_resolutions));
836836
feed.output_filenames(tcx.arena.alloc(std::sync::Arc::new(outputs)));
837+
feed.features_query(sess.features_untracked());
837838
let feed = tcx.feed_local_crate();
838839
feed.crate_name(crate_name);
839840
});

compiler/rustc_lint/src/expect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(crate) fn provide(providers: &mut Providers) {
1212
}
1313

1414
fn check_expectations(tcx: TyCtxt<'_>, tool_filter: Option<Symbol>) {
15-
if !tcx.sess.features_untracked().enabled(sym::lint_reasons) {
15+
if !tcx.features().enabled(sym::lint_reasons) {
1616
return;
1717
}
1818

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ rustc_queries! {
20412041
}
20422042

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

compiler/rustc_middle/src/ty/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
24022402

24032403
providers.extern_mod_stmt_cnum =
24042404
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
2405-
providers.features_query = |tcx, ()| tcx.sess.features_untracked();
24062405
providers.is_panic_runtime = |tcx, cnum| {
24072406
assert_eq!(cnum, LOCAL_CRATE);
24082407
tcx.sess.contains_name(tcx.hir().krate_attrs(), sym::panic_runtime)

src/librustdoc/doctest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ impl<'a, 'hir, 'tcx> HirCollector<'a, 'hir, 'tcx> {
12211221
) {
12221222
let ast_attrs = self.tcx.hir().attrs(hir_id);
12231223
if let Some(ref cfg) = ast_attrs.cfg(self.tcx, &FxHashSet::default()) {
1224-
if !cfg.matches(&self.sess.parse_sess, Some(self.sess.features_untracked())) {
1224+
if !cfg.matches(&self.sess.parse_sess, Some(self.tcx.features())) {
12251225
return;
12261226
}
12271227
}

src/tools/clippy/clippy_lints/src/attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_>, name: Symbol, items: &[NestedMe
472472

473473
fn check_lint_reason(cx: &LateContext<'_>, name: Symbol, items: &[NestedMetaItem], attr: &'_ Attribute) {
474474
// Check for the feature
475-
if !cx.tcx.sess.features_untracked().lint_reasons {
475+
if !cx.tcx.features().lint_reasons {
476476
return;
477477
}
478478

0 commit comments

Comments
 (0)