Skip to content

Commit bb8fe9a

Browse files
committed
Auto merge of #2028 - IsaacWoods:master, r=JohnTitor
Fix error when building rustc with a custom libc When pulling a custom `libc` into a `rustc` build (with the `rustc-dep-of-std` feature set), the following error occurs: ``` error: unused attribute --> /hdd/libc/src/lib.rs:29:1 | 29 | #![no_std] | ^^^^^^^^^^ | = note: `-D unused-attributes` implied by `-D warnings` error: crate-level attribute should be in the root module --> /hdd/libc/src/lib.rs:29:1 | 29 | #![no_std] | ^^^^^^^^^^ ``` I think this is because both the `no_std` and `no_core` attributes are specified, although the error message doesn't make this very clear. This PR changes this so `no_std` is only supplied when the `rustc-dep-of-std` feature is not.
2 parents 9cf7c6a + 48c4482 commit bb8fe9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Enable extra lints:
2626
#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
2727
#![deny(missing_copy_implementations, safe_packed_borrows)]
28-
#![no_std]
28+
#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
2929
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
3030
#![cfg_attr(
3131
any(feature = "rustc-dep-of-std", target_os = "redox"),

0 commit comments

Comments
 (0)