Skip to content

Allow lang and lib features to share names #58741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,14 @@ impl<'a, 'tcx> Index<'tcx> {
active_features: Default::default(),
};

let ref active_lib_features = tcx.features().declared_lib_features;

// Put the active features into a map for quick lookup
index.active_features = active_lib_features.iter().map(|&(ref s, _)| s.clone()).collect();
let active_lib_features = &tcx.features().declared_lib_features;
let active_lang_features = &tcx.features().declared_lang_features;

// Put the active features into a map for quick lookup.
index.active_features =
active_lib_features.iter().map(|&(ref s, ..)| s.clone())
.chain(active_lang_features.iter().map(|&(ref s, ..)| s.clone()))
.collect();

{
let krate = tcx.hir().krate();
Expand Down