Make rustc_attrs unstable feature optional

Summary: The usage of `rustc_attrs` is completely optional and only serves as a size optimization for the `Fd` type.

Reviewed By: rrnewton

Differential Revision: D41394376

fbshipit-source-id: 2f4898b872dc32c517df99e0b5f4a82fad5bda77
This commit is contained in:
Jason White 2022-11-21 11:07:23 -08:00 committed by Facebook GitHub Bot
parent 100dd3ec3a
commit 5ca441ea60
2 changed files with 6 additions and 3 deletions

View file

@ -32,8 +32,11 @@ use super::util;
#[derive(Debug)]
// From `std/src/sys/unix/fd.rs`. Mark `-1` as an invalid file descriptor so it
// can be reused to in `Option<Fd>`.
#[rustc_layout_scalar_valid_range_start(0)]
#[rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE)]
#[cfg_attr(feature = "nightly", rustc_layout_scalar_valid_range_start(0))]
#[cfg_attr(
feature = "nightly",
rustc_layout_scalar_valid_range_end(0xFF_FF_FF_FE)
)]
pub struct Fd(i32);
/// An asynchronous file descriptor. The file descriptor is guaranteed to be in

View file

@ -13,7 +13,7 @@
#![deny(rustdoc::broken_intra_doc_links)]
#![feature(internal_output_capture)]
#![feature(never_type)]
#![feature(rustc_attrs)]
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
mod builder;
mod child;