Skip to content

Commit aa64776

Browse files
committed
Remove unused features in library doc and tests
1 parent 43ec4c2 commit aa64776

File tree

20 files changed

+34
-35
lines changed

20 files changed

+34
-35
lines changed

library/alloctests/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#![feature(allocator_api)]
1818
#![feature(array_into_iter_constructors)]
1919
#![feature(assert_matches)]
20-
#![feature(box_vec_non_null)]
2120
#![feature(char_internals)]
2221
#![feature(const_alloc_error)]
2322
#![feature(const_cmp)]
@@ -56,16 +55,12 @@
5655
//
5756
// Language features:
5857
// tidy-alphabetical-start
59-
#![feature(cfg_sanitize)]
6058
#![feature(const_trait_impl)]
6159
#![feature(dropck_eyepatch)]
62-
#![feature(lang_items)]
6360
#![feature(min_specialization)]
64-
#![feature(negative_impls)]
6561
#![feature(never_type)]
6662
#![feature(optimize_attribute)]
6763
#![feature(prelude_import)]
68-
#![feature(rustc_allow_const_fn_unstable)]
6964
#![feature(rustc_attrs)]
7065
#![feature(staged_api)]
7166
#![feature(test)]

library/alloctests/tests/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(deque_extend_front)]
55
#![feature(iter_array_chunks)]
66
#![feature(assert_matches)]
7-
#![feature(wtf8_internals)]
87
#![feature(cow_is_borrowed)]
98
#![feature(core_intrinsics)]
109
#![feature(downcast_unchecked)]
@@ -31,8 +30,6 @@
3130
#![feature(string_remove_matches)]
3231
#![feature(const_btree_len)]
3332
#![feature(const_trait_impl)]
34-
#![feature(panic_update_hook)]
35-
#![feature(pointer_is_aligned_to)]
3633
#![feature(test)]
3734
#![feature(thin_box)]
3835
#![feature(drain_keep_rest)]

library/core/src/ascii/ascii_char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ impl AsciiChar {
878878
/// # Examples
879879
///
880880
/// ```
881-
/// #![feature(ascii_char, ascii_char_variants, is_ascii_octdigit)]
881+
/// #![feature(ascii_char, ascii_char_variants)]
882882
///
883883
/// use std::ascii;
884884
///

library/core/src/cell.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ impl<T, const N: usize> Cell<[T; N]> {
750750
/// following is unsound:
751751
///
752752
/// ```rust
753-
/// #![feature(cell_get_cloned)]
754753
/// # use std::cell::Cell;
755754
///
756755
/// #[derive(Copy, Debug)]

library/core/src/convert/num.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ impl_float_from_bool!(
219219
f16;
220220
doctest_prefix:
221221
// rustdoc doesn't remove the conventional space after the `///`
222+
///# #![cfg_attr(
223+
///# not(all(target_arch = "x86_64", target_os = "linux")),
224+
///# allow(unused_features)
225+
///# )]
222226
///#![feature(f16)]
223227
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
224228
///
@@ -230,6 +234,10 @@ impl_float_from_bool!(f64);
230234
impl_float_from_bool!(
231235
f128;
232236
doctest_prefix:
237+
///# #![cfg_attr(
238+
///# not(all(target_arch = "x86_64", target_os = "linux")),
239+
///# allow(unused_features)
240+
///# )]
233241
///#![feature(f128)]
234242
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
235243
///

library/core/src/num/f128.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ pub mod consts {
148148
pub const LN_10: f128 = 2.30258509299404568401799145468436420760110148862877297603333_f128;
149149
}
150150

151-
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))]
151+
#[doc(test(attr(
152+
feature(cfg_target_has_reliable_f16_f128),
153+
allow(internal_features, unused_features)
154+
)))]
152155
impl f128 {
153156
/// The radix or base of the internal representation of `f128`.
154157
#[unstable(feature = "f128", issue = "116909")]
@@ -1470,7 +1473,11 @@ impl f128 {
14701473
// Functions in this module fall into `core_float_math`
14711474
// #[unstable(feature = "core_float_math", issue = "137578")]
14721475
#[cfg(not(test))]
1473-
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), expect(internal_features))))]
1476+
#[doc(test(attr(
1477+
feature(cfg_target_has_reliable_f16_f128),
1478+
expect(internal_features),
1479+
allow(unused_features)
1480+
)))]
14741481
impl f128 {
14751482
/// Returns the largest integer less than or equal to `self`.
14761483
///

library/core/src/num/f16.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,11 @@ impl f16 {
764764
/// This follows the IEEE 754-2019 semantics for `maximum`.
765765
///
766766
/// ```
767+
/// # #![cfg_attr(
768+
/// # not(target_has_reliable_f16),
769+
/// # allow(unused_features)
770+
/// # )]
767771
/// #![feature(f16)]
768-
/// #![feature(float_minimum_maximum)]
769772
/// # #[cfg(target_has_reliable_f16)] {
770773
///
771774
/// let x = 1.0f16;
@@ -797,7 +800,6 @@ impl f16 {
797800
///
798801
/// ```
799802
/// #![feature(f16)]
800-
/// #![feature(float_minimum_maximum)]
801803
/// # #[cfg(target_has_reliable_f16)] {
802804
///
803805
/// let x = 1.0f16;

library/core/src/num/f32.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,10 @@ pub mod math {
18211821
/// # Examples
18221822
///
18231823
/// ```
1824+
/// # #![cfg_attr(
1825+
/// # not(all(target_os = "windows", target_env = "gnu", not(target_abi = "llvm"))),
1826+
/// # allow(unused_features)
1827+
/// # )]
18241828
/// #![feature(core_float_math)]
18251829
///
18261830
/// # // FIXME(#140515): mingw has an incorrect fma

library/core/src/num/f64.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,10 @@ pub mod math {
18191819
/// # Examples
18201820
///
18211821
/// ```
1822+
/// # #![cfg_attr(
1823+
/// # not(all(target_os = "windows", target_env = "gnu", not(target_abi = "llvm"))),
1824+
/// # allow(unused_features)
1825+
/// # )]
18221826
/// #![feature(core_float_math)]
18231827
///
18241828
/// # // FIXME(#140515): mingw has an incorrect fma

library/core/src/num/uint_macros.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,7 +3072,6 @@ macro_rules! uint_impl {
30723072
/// implementing it for wider-than-native types.
30733073
///
30743074
/// ```
3075-
/// #![feature(const_unsigned_bigint_helpers)]
30763075
/// fn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {
30773076
/// let mut carry = 0;
30783077
/// for d in little_endian_digits.iter_mut() {
@@ -3097,7 +3096,6 @@ macro_rules! uint_impl {
30973096
/// except that it gives the value of the overflow instead of just whether one happened:
30983097
///
30993098
/// ```
3100-
/// #![feature(const_unsigned_bigint_helpers)]
31013099
/// let r = u8::carrying_mul(7, 13, 0);
31023100
/// assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
31033101
/// let r = u8::carrying_mul(13, 42, 0);
@@ -3109,7 +3107,6 @@ macro_rules! uint_impl {
31093107
/// [`wrapping_add`](Self::wrapping_add) methods:
31103108
///
31113109
/// ```
3112-
/// #![feature(const_unsigned_bigint_helpers)]
31133110
/// assert_eq!(
31143111
/// 789_u16.carrying_mul(456, 123).0,
31153112
/// 789_u16.wrapping_mul(456).wrapping_add(123),

0 commit comments

Comments
 (0)