Allow lang and lib features to share names

This commit is contained in:
varkor 2019-02-25 22:14:18 +00:00
parent 74e35d2700
commit 0f6b148db2

View file

@ -403,10 +403,14 @@ impl<'a, 'tcx> Index<'tcx> {
active_features: Default::default(),
};
let ref active_lib_features = tcx.features().declared_lib_features;
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()).collect();
// 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();