Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann

Remove unused features

Detected by https://github.com/rust-lang/rust/pull/152164.

~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
This commit is contained in:
Jonathan Brouwer 2026-02-13 13:34:58 +01:00 committed by GitHub
commit 65d982abd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 45 additions and 94 deletions

View file

@ -1,5 +1,5 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(all(feature = "nightly", bootstrap), feature(assert_matches))] #![cfg_attr(all(feature = "nightly", bootstrap, test), feature(assert_matches))]
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(feature = "nightly", feature(rustc_attrs))] #![cfg_attr(feature = "nightly", feature(rustc_attrs))]
#![cfg_attr(feature = "nightly", feature(step_trait))] #![cfg_attr(feature = "nightly", feature(step_trait))]

View file

@ -2,8 +2,8 @@
// Note: please avoid adding other feature gates where possible // Note: please avoid adding other feature gates where possible
#![feature(rustc_private)] #![feature(rustc_private)]
// Only used to define intrinsics in `compiler_builtins.rs`. // Only used to define intrinsics in `compiler_builtins.rs`.
#![feature(f16)] #![cfg_attr(feature = "jit", feature(f16))]
#![feature(f128)] #![cfg_attr(feature = "jit", feature(f128))]
// Note: please avoid adding other feature gates where possible // Note: please avoid adding other feature gates where possible
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]

View file

@ -12,6 +12,7 @@
#![allow(rustc::potential_query_instability)] #![allow(rustc::potential_query_instability)]
#![cfg_attr(bootstrap, feature(assert_matches))] #![cfg_attr(bootstrap, feature(assert_matches))]
#![cfg_attr(bootstrap, feature(cold_path))] #![cfg_attr(bootstrap, feature(cold_path))]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(ascii_char)] #![feature(ascii_char)]
@ -30,7 +31,6 @@
#![feature(ptr_alignment_type)] #![feature(ptr_alignment_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(sized_hierarchy)] #![feature(sized_hierarchy)]
#![feature(test)]
#![feature(thread_id_value)] #![feature(thread_id_value)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View file

@ -14,8 +14,6 @@
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(never_type)] #![feature(never_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(try_blocks)]
#![feature(yeet_expr)]
// tidy-alphabetical-end // tidy-alphabetical-end
extern crate self as rustc_errors; extern crate self as rustc_errors;

View file

@ -1,6 +1,7 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))] #![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
#![cfg_attr(feature = "nightly", feature(extend_one, step_trait, test))] #![cfg_attr(all(feature = "nightly", test), feature(test))]
#![cfg_attr(feature = "nightly", feature(extend_one, step_trait))]
#![cfg_attr(feature = "nightly", feature(new_range_api))] #![cfg_attr(feature = "nightly", feature(new_range_api))]
// tidy-alphabetical-end // tidy-alphabetical-end

View file

@ -1,6 +1,5 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(rustc::default_hash_types)] #![allow(rustc::default_hash_types)]
#![feature(if_let_guard)]
#![feature(never_type)] #![feature(never_type)]
#![feature(proc_macro_diagnostic)] #![feature(proc_macro_diagnostic)]
#![feature(proc_macro_tracked_env)] #![feature(proc_macro_tracked_env)]

View file

@ -1,6 +1,5 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(internal_features)] #![allow(internal_features)]
#![feature(decl_macro)]
#![feature(error_iter)] #![feature(error_iter)]
#![feature(file_buffered)] #![feature(file_buffered)]
#![feature(gen_blocks)] #![feature(gen_blocks)]

View file

@ -28,6 +28,7 @@
#![allow(internal_features)] #![allow(internal_features)]
#![allow(rustc::direct_use_of_rustc_type_ir)] #![allow(rustc::direct_use_of_rustc_type_ir)]
#![cfg_attr(bootstrap, feature(assert_matches))] #![cfg_attr(bootstrap, feature(assert_matches))]
#![cfg_attr(doc, feature(intra_doc_pointers))]
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
#![feature(box_as_ptr)] #![feature(box_as_ptr)]
@ -43,7 +44,6 @@
#![feature(file_buffered)] #![feature(file_buffered)]
#![feature(gen_blocks)] #![feature(gen_blocks)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(intra_doc_pointers)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(never_type)] #![feature(never_type)]
@ -56,7 +56,6 @@
#![feature(try_trait_v2_residual)] #![feature(try_trait_v2_residual)]
#![feature(try_trait_v2_yeet)] #![feature(try_trait_v2_yeet)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
#![feature(unwrap_infallible)]
#![feature(yeet_expr)] #![feature(yeet_expr)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
// tidy-alphabetical-end // tidy-alphabetical-end

View file

@ -2,12 +2,12 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(assert_matches))] #![cfg_attr(bootstrap, feature(assert_matches))]
#![cfg_attr(test, feature(iter_order_by))]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(debug_closure_helpers)] #![feature(debug_closure_helpers)]
#![feature(default_field_values)] #![feature(default_field_values)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![feature(iter_order_by)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
// tidy-alphabetical-end // tidy-alphabetical-end

View file

@ -4,11 +4,6 @@
//! //!
//! This API is completely unstable and subject to change. //! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![feature(if_let_guard)]
#![feature(map_try_insert)]
// tidy-alphabetical-end
use rustc_middle::query::Providers; use rustc_middle::query::Providers;
pub mod abi_test; pub mod abi_test;

View file

@ -4,7 +4,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(unused_crate_dependencies)] #![allow(unused_crate_dependencies)]
#![cfg_attr(feature = "rustc", feature(if_let_guard))]
// tidy-alphabetical-end // tidy-alphabetical-end
pub(crate) mod checks; pub(crate) mod checks;

View file

@ -14,7 +14,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(rustc::usage_of_ty_tykind)] #![allow(rustc::usage_of_ty_tykind)]
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))] #![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![feature(sized_hierarchy)]
#![feature(trait_alias)] #![feature(trait_alias)]
// tidy-alphabetical-end // tidy-alphabetical-end

View file

@ -15,7 +15,6 @@
#![feature(const_default)] #![feature(const_default)]
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(control_flow_into_value)] #![feature(control_flow_into_value)]
#![feature(decl_macro)]
#![feature(default_field_values)] #![feature(default_field_values)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]

View file

@ -3,7 +3,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(internal_features)] #![allow(internal_features)]
#![allow(rustc::internal)] #![allow(rustc::internal)]
#![cfg_attr(test, feature(test))]
#![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))] #![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -5,10 +5,7 @@
#![allow(rustc::usage_of_type_ir_inherent)] #![allow(rustc::usage_of_type_ir_inherent)]
#![allow(rustc::usage_of_type_ir_traits)] #![allow(rustc::usage_of_type_ir_traits)]
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr( #![cfg_attr(feature = "nightly", feature(associated_type_defaults, rustc_attrs, negative_impls))]
feature = "nightly",
feature(associated_type_defaults, never_type, rustc_attrs, negative_impls)
)]
// tidy-alphabetical-end // tidy-alphabetical-end
extern crate self as rustc_type_ir; extern crate self as rustc_type_ir;

View file

@ -1514,7 +1514,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
/// Recreate a `Box` which was previously converted to a `NonNull` pointer /// Recreate a `Box` which was previously converted to a `NonNull` pointer
/// using [`Box::into_non_null_with_allocator`]: /// using [`Box::into_non_null_with_allocator`]:
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -1524,7 +1524,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
/// ``` /// ```
/// Manually create a `Box` from scratch by using the system allocator: /// Manually create a `Box` from scratch by using the system allocator:
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null, slice_ptr_get)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::{Allocator, Layout, System}; /// use std::alloc::{Allocator, Layout, System};
/// ///
@ -1629,7 +1629,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
/// Converting the `NonNull` pointer back into a `Box` with /// Converting the `NonNull` pointer back into a `Box` with
/// [`Box::from_non_null_in`] for automatic cleanup: /// [`Box::from_non_null_in`] for automatic cleanup:
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -1640,7 +1640,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
/// Manual cleanup by explicitly running the destructor and deallocating /// Manual cleanup by explicitly running the destructor and deallocating
/// the memory: /// the memory:
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::{Allocator, Layout, System}; /// use std::alloc::{Allocator, Layout, System};
/// ///

View file

@ -56,6 +56,7 @@
//! [`Rc`]: rc //! [`Rc`]: rc
//! [`RefCell`]: core::cell //! [`RefCell`]: core::cell
#![allow(unused_features)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![allow(unused_attributes)] #![allow(unused_attributes)]
#![stable(feature = "alloc", since = "1.36.0")] #![stable(feature = "alloc", since = "1.36.0")]
@ -85,13 +86,11 @@
// //
// Library features: // Library features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(not(no_global_oom_handling), feature(string_replace_in_place))]
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(array_into_iter_constructors)] #![feature(array_into_iter_constructors)]
#![feature(ascii_char)] #![feature(ascii_char)]
#![feature(async_fn_traits)] #![feature(async_fn_traits)]
#![feature(async_iterator)] #![feature(async_iterator)]
#![feature(box_vec_non_null)]
#![feature(bstr)] #![feature(bstr)]
#![feature(bstr_internals)] #![feature(bstr_internals)]
#![feature(cast_maybe_uninit)] #![feature(cast_maybe_uninit)]
@ -148,7 +147,6 @@
#![feature(slice_ptr_get)] #![feature(slice_ptr_get)]
#![feature(slice_range)] #![feature(slice_range)]
#![feature(std_internals)] #![feature(std_internals)]
#![feature(str_internals)]
#![feature(temporary_niche_types)] #![feature(temporary_niche_types)]
#![feature(transmutability)] #![feature(transmutability)]
#![feature(trivial_clone)] #![feature(trivial_clone)]
@ -158,7 +156,6 @@
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(try_trait_v2)] #![feature(try_trait_v2)]
#![feature(try_trait_v2_residual)] #![feature(try_trait_v2_residual)]
#![feature(try_with_capacity)]
#![feature(tuple_trait)] #![feature(tuple_trait)]
#![feature(ub_checks)] #![feature(ub_checks)]
#![feature(unicode_internals)] #![feature(unicode_internals)]
@ -176,10 +173,8 @@
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(coroutine_trait)] #![feature(coroutine_trait)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(derive_const)]
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![feature(fundamental)] #![feature(fundamental)]
#![feature(hashmap_internals)]
#![feature(intrinsics)] #![feature(intrinsics)]
#![feature(lang_items)] #![feature(lang_items)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -1238,7 +1238,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -1265,7 +1265,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// Using memory that was allocated elsewhere: /// Using memory that was allocated elsewhere:
/// ///
/// ```rust /// ```rust
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::{AllocError, Allocator, Global, Layout}; /// use std::alloc::{AllocError, Allocator, Global, Layout};
/// ///
@ -1365,7 +1365,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, box_vec_non_null)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///

View file

@ -16,7 +16,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(array_into_iter_constructors)] #![feature(array_into_iter_constructors)]
#![feature(box_vec_non_null)]
#![feature(char_internals)] #![feature(char_internals)]
#![feature(const_alloc_error)] #![feature(const_alloc_error)]
#![feature(const_cmp)] #![feature(const_cmp)]
@ -55,16 +54,12 @@
// //
// Language features: // Language features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![feature(cfg_sanitize)]
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![feature(lang_items)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(negative_impls)]
#![feature(never_type)] #![feature(never_type)]
#![feature(optimize_attribute)] #![feature(optimize_attribute)]
#![feature(prelude_import)] #![feature(prelude_import)]
#![feature(rustc_allow_const_fn_unstable)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(test)] #![feature(test)]

View file

@ -3,7 +3,6 @@
#![feature(const_heap)] #![feature(const_heap)]
#![feature(deque_extend_front)] #![feature(deque_extend_front)]
#![feature(iter_array_chunks)] #![feature(iter_array_chunks)]
#![feature(wtf8_internals)]
#![feature(cow_is_borrowed)] #![feature(cow_is_borrowed)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(downcast_unchecked)] #![feature(downcast_unchecked)]
@ -30,8 +29,6 @@
#![feature(string_remove_matches)] #![feature(string_remove_matches)]
#![feature(const_btree_len)] #![feature(const_btree_len)]
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(panic_update_hook)]
#![feature(pointer_is_aligned_to)]
#![feature(test)] #![feature(test)]
#![feature(thin_box)] #![feature(thin_box)]
#![feature(drain_keep_rest)] #![feature(drain_keep_rest)]

View file

@ -878,7 +878,7 @@ impl AsciiChar {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(ascii_char, ascii_char_variants, is_ascii_octdigit)] /// #![feature(ascii_char, ascii_char_variants)]
/// ///
/// use std::ascii; /// use std::ascii;
/// ///

View file

@ -774,7 +774,6 @@ impl<T, const N: usize> Cell<[T; N]> {
/// following is unsound: /// following is unsound:
/// ///
/// ```rust /// ```rust
/// #![feature(cell_get_cloned)]
/// # use std::cell::Cell; /// # use std::cell::Cell;
/// ///
/// #[derive(Copy, Debug)] /// #[derive(Copy, Debug)]

View file

@ -219,6 +219,7 @@ impl_float_from_bool!(
f16; f16;
doctest_prefix: doctest_prefix:
// rustdoc doesn't remove the conventional space after the `///` // rustdoc doesn't remove the conventional space after the `///`
///# #![allow(unused_features)]
///#![feature(f16)] ///#![feature(f16)]
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { ///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///
@ -230,6 +231,7 @@ impl_float_from_bool!(f64);
impl_float_from_bool!( impl_float_from_bool!(
f128; f128;
doctest_prefix: doctest_prefix:
///# #![allow(unused_features)]
///#![feature(f128)] ///#![feature(f128)]
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { ///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///

View file

@ -87,6 +87,7 @@
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![warn(multiple_supertrait_upcastable)] #![warn(multiple_supertrait_upcastable)]
#![allow(internal_features)] #![allow(internal_features)]
#![allow(unused_features)]
#![deny(ffi_unwind_calls)] #![deny(ffi_unwind_calls)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]
// Do not check link redundancy on bootstrapping phase // Do not check link redundancy on bootstrapping phase
@ -95,9 +96,7 @@
// //
// Library features: // Library features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![feature(array_ptr_get)]
#![feature(asm_experimental_arch)] #![feature(asm_experimental_arch)]
#![feature(bstr)]
#![feature(bstr_internals)] #![feature(bstr_internals)]
#![feature(cfg_select)] #![feature(cfg_select)]
#![feature(cfg_target_has_reliable_f16_f128)] #![feature(cfg_target_has_reliable_f16_f128)]
@ -106,31 +105,15 @@
#![feature(const_destruct)] #![feature(const_destruct)]
#![feature(const_eval_select)] #![feature(const_eval_select)]
#![feature(const_select_unpredictable)] #![feature(const_select_unpredictable)]
#![feature(const_unsigned_bigint_helpers)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(coverage_attribute)] #![feature(coverage_attribute)]
#![feature(disjoint_bitor)] #![feature(disjoint_bitor)]
#![feature(internal_impls_macro)] #![feature(internal_impls_macro)]
#![feature(ip)]
#![feature(is_ascii_octdigit)]
#![feature(link_cfg)] #![feature(link_cfg)]
#![feature(offset_of_enum)] #![feature(offset_of_enum)]
#![feature(panic_internals)] #![feature(panic_internals)]
#![feature(pattern_type_macro)] #![feature(pattern_type_macro)]
#![feature(ptr_alignment_type)]
#![feature(ptr_metadata)]
#![feature(set_ptr_value)]
#![feature(signed_bigint_helpers)]
#![feature(slice_ptr_get)]
#![feature(str_internals)]
#![feature(str_split_inclusive_remainder)]
#![feature(str_split_remainder)]
#![feature(type_info)]
#![feature(ub_checks)] #![feature(ub_checks)]
#![feature(unsafe_pinned)]
#![feature(utf16_extra)]
#![feature(variant_count)]
#![feature(widening_mul)]
// tidy-alphabetical-end // tidy-alphabetical-end
// //
// Language features: // Language features:
@ -175,7 +158,6 @@
#![feature(optimize_attribute)] #![feature(optimize_attribute)]
#![feature(pattern_types)] #![feature(pattern_types)]
#![feature(prelude_import)] #![feature(prelude_import)]
#![feature(reborrow)]
#![feature(repr_simd)] #![feature(repr_simd)]
#![feature(rustc_allow_const_fn_unstable)] #![feature(rustc_allow_const_fn_unstable)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]

View file

@ -148,7 +148,10 @@ pub mod consts {
pub const LN_10: f128 = 2.30258509299404568401799145468436420760110148862877297603333_f128; pub const LN_10: f128 = 2.30258509299404568401799145468436420760110148862877297603333_f128;
} }
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))] #[doc(test(attr(
feature(cfg_target_has_reliable_f16_f128),
allow(internal_features, unused_features)
)))]
impl f128 { impl f128 {
/// The radix or base of the internal representation of `f128`. /// The radix or base of the internal representation of `f128`.
#[unstable(feature = "f128", issue = "116909")] #[unstable(feature = "f128", issue = "116909")]
@ -1470,7 +1473,11 @@ impl f128 {
// Functions in this module fall into `core_float_math` // Functions in this module fall into `core_float_math`
// #[unstable(feature = "core_float_math", issue = "137578")] // #[unstable(feature = "core_float_math", issue = "137578")]
#[cfg(not(test))] #[cfg(not(test))]
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), expect(internal_features))))] #[doc(test(attr(
feature(cfg_target_has_reliable_f16_f128),
expect(internal_features),
allow(unused_features)
)))]
impl f128 { impl f128 {
/// Returns the largest integer less than or equal to `self`. /// Returns the largest integer less than or equal to `self`.
/// ///

View file

@ -142,7 +142,10 @@ pub mod consts {
pub const LN_10: f16 = 2.30258509299404568401799145468436421_f16; pub const LN_10: f16 = 2.30258509299404568401799145468436421_f16;
} }
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))] #[doc(test(attr(
feature(cfg_target_has_reliable_f16_f128),
allow(internal_features, unused_features)
)))]
impl f16 { impl f16 {
/// The radix or base of the internal representation of `f16`. /// The radix or base of the internal representation of `f16`.
#[unstable(feature = "f16", issue = "116909")] #[unstable(feature = "f16", issue = "116909")]

View file

@ -1821,6 +1821,7 @@ pub mod math {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// # #![allow(unused_features)]
/// #![feature(core_float_math)] /// #![feature(core_float_math)]
/// ///
/// # // FIXME(#140515): mingw has an incorrect fma /// # // FIXME(#140515): mingw has an incorrect fma

View file

@ -1819,6 +1819,7 @@ pub mod math {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// # #![allow(unused_features)]
/// #![feature(core_float_math)] /// #![feature(core_float_math)]
/// ///
/// # // FIXME(#140515): mingw has an incorrect fma /// # // FIXME(#140515): mingw has an incorrect fma

View file

@ -3072,7 +3072,6 @@ macro_rules! uint_impl {
/// implementing it for wider-than-native types. /// implementing it for wider-than-native types.
/// ///
/// ``` /// ```
/// #![feature(const_unsigned_bigint_helpers)]
/// fn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) { /// fn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {
/// let mut carry = 0; /// let mut carry = 0;
/// for d in little_endian_digits.iter_mut() { /// for d in little_endian_digits.iter_mut() {
@ -3097,6 +3096,7 @@ macro_rules! uint_impl {
/// except that it gives the value of the overflow instead of just whether one happened: /// except that it gives the value of the overflow instead of just whether one happened:
/// ///
/// ``` /// ```
/// # #![allow(unused_features)]
/// #![feature(const_unsigned_bigint_helpers)] /// #![feature(const_unsigned_bigint_helpers)]
/// let r = u8::carrying_mul(7, 13, 0); /// let r = u8::carrying_mul(7, 13, 0);
/// assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13)); /// assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
@ -3109,6 +3109,7 @@ macro_rules! uint_impl {
/// [`wrapping_add`](Self::wrapping_add) methods: /// [`wrapping_add`](Self::wrapping_add) methods:
/// ///
/// ``` /// ```
/// # #![allow(unused_features)]
/// #![feature(const_unsigned_bigint_helpers)] /// #![feature(const_unsigned_bigint_helpers)]
/// assert_eq!( /// assert_eq!(
/// 789_u16.carrying_mul(456, 123).0, /// 789_u16.carrying_mul(456, 123).0,

View file

@ -112,7 +112,6 @@ impl Alignment {
/// ///
/// ``` /// ```
/// #![feature(ptr_alignment_type)] /// #![feature(ptr_alignment_type)]
/// #![feature(layout_for_ptr)]
/// use std::ptr::Alignment; /// use std::ptr::Alignment;
/// ///
/// assert_eq!(unsafe { Alignment::of_val_raw(&5i32) }.as_usize(), 4); /// assert_eq!(unsafe { Alignment::of_val_raw(&5i32) }.as_usize(), 4);

View file

@ -1800,7 +1800,6 @@ impl<T> *mut [T] {
/// ///
/// ``` /// ```
/// #![feature(raw_slice_split)] /// #![feature(raw_slice_split)]
/// #![feature(slice_ptr_get)]
/// ///
/// let mut v = [1, 0, 3, 0, 5, 6]; /// let mut v = [1, 0, 3, 0, 5, 6];
/// let ptr = &mut v as *mut [_]; /// let ptr = &mut v as *mut [_];

View file

@ -690,7 +690,6 @@ impl Duration {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(duration_constants)]
/// use std::time::Duration; /// use std::time::Duration;
/// ///
/// assert_eq!(Duration::new(0, 0).saturating_add(Duration::new(0, 1)), Duration::new(0, 1)); /// assert_eq!(Duration::new(0, 0).saturating_add(Duration::new(0, 1)), Duration::new(0, 1));
@ -801,7 +800,6 @@ impl Duration {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(duration_constants)]
/// use std::time::Duration; /// use std::time::Duration;
/// ///
/// assert_eq!(Duration::new(0, 500_000_001).saturating_mul(2), Duration::new(1, 2)); /// assert_eq!(Duration::new(0, 500_000_001).saturating_mul(2), Duration::new(1, 2));

View file

@ -13,7 +13,6 @@
#![feature(cfg_target_has_reliable_f16_f128)] #![feature(cfg_target_has_reliable_f16_f128)]
#![feature(char_internals)] #![feature(char_internals)]
#![feature(char_max_len)] #![feature(char_max_len)]
#![feature(clamp_magnitude)]
#![feature(clone_to_uninit)] #![feature(clone_to_uninit)]
#![feature(const_array)] #![feature(const_array)]
#![feature(const_bool)] #![feature(const_bool)]
@ -35,7 +34,6 @@
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(const_unsigned_bigint_helpers)] #![feature(const_unsigned_bigint_helpers)]
#![feature(control_flow_ok)] #![feature(control_flow_ok)]
#![feature(core_float_math)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(core_intrinsics_fallbacks)] #![feature(core_intrinsics_fallbacks)]
#![feature(core_io_borrowed_buf)] #![feature(core_io_borrowed_buf)]
@ -47,7 +45,6 @@
#![feature(drop_guard)] #![feature(drop_guard)]
#![feature(duration_constants)] #![feature(duration_constants)]
#![feature(duration_constructors)] #![feature(duration_constructors)]
#![feature(error_generic_member_access)]
#![feature(exact_div)] #![feature(exact_div)]
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![feature(extend_one)] #![feature(extend_one)]
@ -55,7 +52,6 @@
#![feature(f16)] #![feature(f16)]
#![feature(f128)] #![feature(f128)]
#![feature(float_algebraic)] #![feature(float_algebraic)]
#![feature(float_gamma)]
#![feature(float_minimum_maximum)] #![feature(float_minimum_maximum)]
#![feature(flt2dec)] #![feature(flt2dec)]
#![feature(fmt_internals)] #![feature(fmt_internals)]
@ -94,7 +90,6 @@
#![feature(nonzero_from_str_radix)] #![feature(nonzero_from_str_radix)]
#![feature(numfmt)] #![feature(numfmt)]
#![feature(one_sided_range)] #![feature(one_sided_range)]
#![feature(option_reduce)]
#![feature(pattern)] #![feature(pattern)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(portable_simd)] #![feature(portable_simd)]
@ -114,7 +109,6 @@
#![feature(step_trait)] #![feature(step_trait)]
#![feature(str_internals)] #![feature(str_internals)]
#![feature(strict_provenance_lints)] #![feature(strict_provenance_lints)]
#![feature(test)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(trusted_random_access)] #![feature(trusted_random_access)]
#![feature(try_blocks)] #![feature(try_blocks)]

View file

@ -17,7 +17,6 @@
#![feature(cfg_emscripten_wasm_eh)] #![feature(cfg_emscripten_wasm_eh)]
#![feature(cfg_select)] #![feature(cfg_select)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(lang_items)]
#![feature(panic_unwind)] #![feature(panic_unwind)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(std_internals)] #![feature(std_internals)]
@ -25,6 +24,7 @@
#![panic_runtime] #![panic_runtime]
#![feature(panic_runtime)] #![feature(panic_runtime)]
#![allow(internal_features)] #![allow(internal_features)]
#![allow(unused_features)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]

View file

@ -16,6 +16,7 @@ use crate::intrinsics;
use crate::sys::cmath; use crate::sys::cmath;
#[cfg(not(test))] #[cfg(not(test))]
#[doc(test(attr(allow(unused_features))))]
impl f128 { impl f128 {
/// Raises a number to a floating point power. /// Raises a number to a floating point power.
/// ///

View file

@ -916,7 +916,6 @@ impl f16 {
/// ///
/// ``` /// ```
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_gamma)]
/// # #[cfg(not(miri))] /// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] { /// # #[cfg(target_has_reliable_f16_math)] {
/// ///
@ -952,7 +951,6 @@ impl f16 {
/// ///
/// ``` /// ```
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_gamma)]
/// # #[cfg(not(miri))] /// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] { /// # #[cfg(target_has_reliable_f16_math)] {
/// ///
@ -988,7 +986,6 @@ impl f16 {
/// ///
/// ``` /// ```
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_erf)]
/// # #[cfg(not(miri))] /// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] { /// # #[cfg(target_has_reliable_f16_math)] {
/// /// The error function relates what percent of a normal distribution lies /// /// The error function relates what percent of a normal distribution lies
@ -1028,7 +1025,6 @@ impl f16 {
/// ///
/// ``` /// ```
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_erf)]
/// # #[cfg(not(miri))] /// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] { /// # #[cfg(target_has_reliable_f16_math)] {
/// let x: f16 = 0.123; /// let x: f16 = 0.123;

View file

@ -1,4 +1,4 @@
#![feature(f16, f128, float_gamma, float_minimum_maximum, cfg_target_has_reliable_f16_f128)] #![feature(f16, f128, float_gamma, cfg_target_has_reliable_f16_f128)]
#![expect(internal_features)] // for reliable_f16_f128 #![expect(internal_features)] // for reliable_f16_f128
use std::fmt; use std::fmt;

View file

@ -1,5 +1,4 @@
#![allow(stable_features)] #![allow(stable_features)]
#![feature(volatile)]
use std::ptr::{read_volatile, write_volatile}; use std::ptr::{read_volatile, write_volatile};

View file

@ -1,4 +1,4 @@
#![allow(internal_features)] #![allow(internal_features, unused_features)]
#![feature(stdarch_internal)] #![feature(stdarch_internal)]
#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))] #![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
#![cfg_attr( #![cfg_attr(

View file

@ -1,4 +1,4 @@
#![allow(internal_features)] #![allow(internal_features, unused_features)]
#![cfg_attr( #![cfg_attr(
any( any(
target_arch = "arm", target_arch = "arm",

View file

@ -24,7 +24,7 @@
#![feature(staged_api)] #![feature(staged_api)]
#![feature(process_exitcode_internals)] #![feature(process_exitcode_internals)]
#![feature(panic_can_unwind)] #![feature(panic_can_unwind)]
#![feature(test)] #![cfg_attr(test, feature(test))]
#![feature(thread_spawn_hook)] #![feature(thread_spawn_hook)]
#![allow(internal_features)] #![allow(internal_features)]
#![warn(rustdoc::unescaped_backticks)] #![warn(rustdoc::unescaped_backticks)]

View file

@ -4,12 +4,12 @@
#![feature(cfg_select)] #![feature(cfg_select)]
#![feature(link_cfg)] #![feature(link_cfg)]
#![feature(staged_api)] #![feature(staged_api)]
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
#![cfg_attr( #![cfg_attr(
all(target_family = "wasm", any(not(target_os = "emscripten"), emscripten_wasm_eh)), all(target_family = "wasm", any(not(target_os = "emscripten"), emscripten_wasm_eh)),
feature(link_llvm_intrinsics, simd_wasm64) feature(link_llvm_intrinsics, simd_wasm64)
)] )]
#![allow(internal_features)] #![allow(internal_features)]
#![allow(unused_features)]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]
// Force libc to be included even if unused. This is required by many platforms. // Force libc to be included even if unused. This is required by many platforms.

View file

@ -6,12 +6,10 @@
)] )]
#![feature(ascii_char)] #![feature(ascii_char)]
#![feature(ascii_char_variants)] #![feature(ascii_char_variants)]
#![feature(box_into_inner)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(file_buffered)] #![feature(file_buffered)]
#![feature(formatting_options)] #![feature(formatting_options)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_advance_by)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![feature(iter_order_by)] #![feature(iter_order_by)]
#![feature(rustc_private)] #![feature(rustc_private)]