Skip to content

Commit f91d7ba

Browse files
committed
Add special support for libc
1 parent 53add5d commit f91d7ba

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/librustc/middle/lib_features.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
6262
let mut features = vec![];
6363

6464
for attr in attrs {
65-
// FIXME(varkor): the stability attribute might be behind a `#[cfg]` attribute.
66-
6765
// Find a stability attribute (i.e. `#[stable (..)]`, `#[unstable (..)]`,
6866
// `#[rustc_const_unstable (..)]`).
6967
if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| {

src/librustc/middle/stability.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
813813
krate.visit_all_item_likes(&mut missing.as_deep_visitor());
814814
}
815815

816-
817816
let declared_lang_features = &tcx.features().declared_lang_features;
818817
let mut lang_features = FxHashSet();
819818
for &(feature, span, since) in declared_lang_features {
@@ -837,8 +836,9 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
837836
}
838837
remaining_lib_features.insert(feature, span.clone());
839838
}
840-
// FIXME(varkor): we don't properly handle lib features behind `cfg` attributes yet,
841-
// but it happens just to affect `libc`, so we're just going to hard-code it for now.
839+
// `stdbuild` has special handling for `libc`, so we need to
840+
// recognise the feature when building std.
841+
// FIXME: only remove `libc` when `stdbuild` is active.
842842
remaining_lib_features.remove(&Symbol::intern("libc"));
843843

844844
for (feature, stable) in tcx.lib_features().iter() {

src/libsyntax/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ declare_features! (
321321
// `extern "x86-interrupt" fn()`
322322
(active, abi_x86_interrupt, "1.17.0", Some(40180), None),
323323

324-
325324
// Allows the `catch {...}` expression
326325
(active, catch_expr, "1.17.0", Some(31436), Some(Edition::Edition2018)),
327326

0 commit comments

Comments
 (0)