clarify lib.rs attribute structure
This commit is contained in:
parent
438e49c1cb
commit
fbcdf2a383
2 changed files with 17 additions and 15 deletions
|
@ -56,11 +56,6 @@
|
||||||
//! [`Rc`]: rc
|
//! [`Rc`]: rc
|
||||||
//! [`RefCell`]: core::cell
|
//! [`RefCell`]: core::cell
|
||||||
|
|
||||||
// To run liballoc tests without x.py without ending up with two copies of liballoc, Miri needs to be
|
|
||||||
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
|
|
||||||
// rustc itself never sets the feature, so this line has no affect there.
|
|
||||||
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
|
|
||||||
//
|
|
||||||
#![allow(unused_attributes)]
|
#![allow(unused_attributes)]
|
||||||
#![stable(feature = "alloc", since = "1.36.0")]
|
#![stable(feature = "alloc", since = "1.36.0")]
|
||||||
#![doc(
|
#![doc(
|
||||||
|
@ -78,6 +73,10 @@
|
||||||
))]
|
))]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![needs_allocator]
|
#![needs_allocator]
|
||||||
|
// To run liballoc tests without x.py without ending up with two copies of liballoc, Miri needs to be
|
||||||
|
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
|
||||||
|
// rustc itself never sets the feature, so this line has no affect there.
|
||||||
|
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
|
||||||
//
|
//
|
||||||
// Lints:
|
// Lints:
|
||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
|
@ -188,13 +188,6 @@
|
||||||
//! [array]: prim@array
|
//! [array]: prim@array
|
||||||
//! [slice]: prim@slice
|
//! [slice]: prim@slice
|
||||||
|
|
||||||
// To run libstd tests without x.py without ending up with two copies of libstd, Miri needs to be
|
|
||||||
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
|
|
||||||
// rustc itself never sets the feature, so this line has no affect there.
|
|
||||||
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
|
|
||||||
// miri-test-libstd also prefers to make std use the sysroot versions of the dependencies.
|
|
||||||
#![cfg_attr(feature = "miri-test-libstd", feature(rustc_private))]
|
|
||||||
//
|
|
||||||
#![cfg_attr(not(feature = "restricted-std"), stable(feature = "rust1", since = "1.0.0"))]
|
#![cfg_attr(not(feature = "restricted-std"), stable(feature = "rust1", since = "1.0.0"))]
|
||||||
#![cfg_attr(feature = "restricted-std", unstable(feature = "restricted_std", issue = "none"))]
|
#![cfg_attr(feature = "restricted-std", unstable(feature = "restricted_std", issue = "none"))]
|
||||||
#![doc(
|
#![doc(
|
||||||
|
@ -209,25 +202,35 @@
|
||||||
no_global_oom_handling,
|
no_global_oom_handling,
|
||||||
not(no_global_oom_handling)
|
not(no_global_oom_handling)
|
||||||
))]
|
))]
|
||||||
|
// To run libstd tests without x.py without ending up with two copies of libstd, Miri needs to be
|
||||||
|
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
|
||||||
|
// rustc itself never sets the feature, so this line has no affect there.
|
||||||
|
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
|
||||||
|
// miri-test-libstd also prefers to make std use the sysroot versions of the dependencies.
|
||||||
|
#![cfg_attr(feature = "miri-test-libstd", feature(rustc_private))]
|
||||||
// Don't link to std. We are std.
|
// Don't link to std. We are std.
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
// Tell the compiler to link to either panic_abort or panic_unwind
|
||||||
|
#![needs_panic_runtime]
|
||||||
|
//
|
||||||
|
// Lints:
|
||||||
#![warn(deprecated_in_future)]
|
#![warn(deprecated_in_future)]
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![warn(missing_debug_implementations)]
|
#![warn(missing_debug_implementations)]
|
||||||
#![allow(explicit_outlives_requirements)]
|
#![allow(explicit_outlives_requirements)]
|
||||||
#![allow(unused_lifetimes)]
|
#![allow(unused_lifetimes)]
|
||||||
// Tell the compiler to link to either panic_abort or panic_unwind
|
#![deny(rustc::existing_doc_keyword)]
|
||||||
#![needs_panic_runtime]
|
|
||||||
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
|
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
|
||||||
#![deny(ffi_unwind_calls)]
|
#![deny(ffi_unwind_calls)]
|
||||||
// std may use features in a platform-specific way
|
// std may use features in a platform-specific way
|
||||||
#![allow(unused_features)]
|
#![allow(unused_features)]
|
||||||
|
//
|
||||||
|
// Features:
|
||||||
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count, rt))]
|
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count, rt))]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
all(target_vendor = "fortanix", target_env = "sgx"),
|
all(target_vendor = "fortanix", target_env = "sgx"),
|
||||||
feature(slice_index_methods, coerce_unsized, sgx_platform)
|
feature(slice_index_methods, coerce_unsized, sgx_platform)
|
||||||
)]
|
)]
|
||||||
#![deny(rustc::existing_doc_keyword)]
|
|
||||||
//
|
//
|
||||||
// Language features:
|
// Language features:
|
||||||
#![feature(alloc_error_handler)]
|
#![feature(alloc_error_handler)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue