Skip to content

Commit

Permalink
Auto merge of #58741 - varkor:lang-lib-feature-shared-name, r=alexreg
Browse files Browse the repository at this point in the history
Allow lang and lib features to share names

Fixes #58715.

I didn't add a test, because there's currently no standard lang test feature and I felt apprehensive about adding a permanently unstable feature. Instead, a shared lang/lib feature will be used in #57760 and will essentially provide an immediately test.
  • Loading branch information
bors committed Feb 27, 2019
2 parents f5b5f92 + 0f6b148 commit 4855370
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 @@ -397,10 +397,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 4855370

Please sign in to comment.