From 0f6b148db278dd14b11e009c60712f0303c05f79 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 25 Feb 2019 22:14:18 +0000 Subject: [PATCH] Allow lang and lib features to share names --- src/librustc/middle/stability.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 30a43c7a92595..b93164c1f6764 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -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();