Skip to content

Commit 4855370

Browse files
committed
Auto merge of #58741 - varkor:lang-lib-feature-shared-name, r=alexreg
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.
2 parents f5b5f92 + 0f6b148 commit 4855370

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/librustc/middle/stability.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,14 @@ impl<'a, 'tcx> Index<'tcx> {
397397
active_features: Default::default(),
398398
};
399399

400-
let ref active_lib_features = tcx.features().declared_lib_features;
401-
402-
// Put the active features into a map for quick lookup
403-
index.active_features = active_lib_features.iter().map(|&(ref s, _)| s.clone()).collect();
400+
let active_lib_features = &tcx.features().declared_lib_features;
401+
let active_lang_features = &tcx.features().declared_lang_features;
402+
403+
// Put the active features into a map for quick lookup.
404+
index.active_features =
405+
active_lib_features.iter().map(|&(ref s, ..)| s.clone())
406+
.chain(active_lang_features.iter().map(|&(ref s, ..)| s.clone()))
407+
.collect();
404408

405409
{
406410
let krate = tcx.hir().krate();

0 commit comments

Comments
 (0)