Skip to content

Commit

Permalink
Allow lang and lib features to share names
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 25, 2019
1 parent 74e35d2 commit 0f6b148
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 0f6b148

Please sign in to comment.