From 9893b44ad9a9c3a23067a083ed0e0a08c2e83886 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 3 Mar 2015 13:05:55 -0800 Subject: [PATCH] libc: Move features behind a cfg_attr gate This same source is being built in the Cargo ecosystem and hence needs to build on stable Rust as well. This commit places the `no_std` attribute along with the `no_std` feature behind a `cfg_attr` flag so they are not processed when compiled on crates.io --- src/liblibc/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 42143b06ca0..d650f935566 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -10,13 +10,10 @@ #![crate_name = "libc"] #![crate_type = "rlib"] -#![cfg_attr(not(feature = "cargo-build"), - unstable(feature = "libc"))] -#![cfg_attr(not(feature = "cargo-build"), feature(staged_api))] +#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc"))] +#![cfg_attr(not(feature = "cargo-build"), feature(staged_api, core, no_std))] #![cfg_attr(not(feature = "cargo-build"), staged_api)] -#![cfg_attr(not(feature = "cargo-build"), feature(core))] -#![feature(no_std)] -#![no_std] +#![cfg_attr(not(feature = "cargo-build"), no_std)] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/",