Skip to content

Commit 73c42c1

Browse files
committed
Remove or allow unused features in library doc and tests
1 parent a318a20 commit 73c42c1

File tree

20 files changed

+24
-32
lines changed

20 files changed

+24
-32
lines changed

library/alloctests/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// tidy-alphabetical-start
1717
#![feature(allocator_api)]
1818
#![feature(array_into_iter_constructors)]
19-
#![feature(box_vec_non_null)]
2019
#![feature(char_internals)]
2120
#![feature(const_alloc_error)]
2221
#![feature(const_cmp)]
@@ -55,16 +54,12 @@
5554
//
5655
// Language features:
5756
// tidy-alphabetical-start
58-
#![feature(cfg_sanitize)]
5957
#![feature(const_trait_impl)]
6058
#![feature(dropck_eyepatch)]
61-
#![feature(lang_items)]
6259
#![feature(min_specialization)]
63-
#![feature(negative_impls)]
6460
#![feature(never_type)]
6561
#![feature(optimize_attribute)]
6662
#![feature(prelude_import)]
67-
#![feature(rustc_allow_const_fn_unstable)]
6863
#![feature(rustc_attrs)]
6964
#![feature(staged_api)]
7065
#![feature(test)]

library/alloctests/tests/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(const_heap)]
44
#![feature(deque_extend_front)]
55
#![feature(iter_array_chunks)]
6-
#![feature(wtf8_internals)]
76
#![feature(cow_is_borrowed)]
87
#![feature(core_intrinsics)]
98
#![feature(downcast_unchecked)]
@@ -30,8 +29,6 @@
3029
#![feature(string_remove_matches)]
3130
#![feature(const_btree_len)]
3231
#![feature(const_trait_impl)]
33-
#![feature(panic_update_hook)]
34-
#![feature(pointer_is_aligned_to)]
3532
#![feature(test)]
3633
#![feature(thin_box)]
3734
#![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
@@ -774,7 +774,6 @@ impl<T, const N: usize> Cell<[T; N]> {
774774
/// following is unsound:
775775
///
776776
/// ```rust
777-
/// #![feature(cell_get_cloned)]
778777
/// # use std::cell::Cell;
779778
///
780779
/// #[derive(Copy, Debug)]

library/core/src/convert/num.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ impl_float_from_bool!(
219219
f16;
220220
doctest_prefix:
221221
// rustdoc doesn't remove the conventional space after the `///`
222+
///# #![allow(unused_features)]
222223
///#![feature(f16)]
223224
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
224225
///
@@ -230,6 +231,7 @@ impl_float_from_bool!(f64);
230231
impl_float_from_bool!(
231232
f128;
232233
doctest_prefix:
234+
///# #![allow(unused_features)]
233235
///#![feature(f128)]
234236
///# #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
235237
///

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ pub mod consts {
142142
pub const LN_10: f16 = 2.30258509299404568401799145468436421_f16;
143143
}
144144

145-
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))]
145+
#[doc(test(attr(
146+
feature(cfg_target_has_reliable_f16_f128),
147+
allow(internal_features, unused_features)
148+
)))]
146149
impl f16 {
147150
/// The radix or base of the internal representation of `f16`.
148151
#[unstable(feature = "f16", issue = "116909")]

library/core/src/num/f32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,7 @@ pub mod math {
18211821
/// # Examples
18221822
///
18231823
/// ```
1824+
/// # #![allow(unused_features)]
18241825
/// #![feature(core_float_math)]
18251826
///
18261827
/// # // FIXME(#140515): mingw has an incorrect fma

library/core/src/num/f64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,7 @@ pub mod math {
18191819
/// # Examples
18201820
///
18211821
/// ```
1822+
/// # #![allow(unused_features)]
18221823
/// #![feature(core_float_math)]
18231824
///
18241825
/// # // FIXME(#140515): mingw has an incorrect fma

library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 1 deletion
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,6 +3096,7 @@ macro_rules! uint_impl {
30973096
/// except that it gives the value of the overflow instead of just whether one happened:
30983097
///
30993098
/// ```
3099+
/// # #![allow(unused_features)]
31003100
/// #![feature(const_unsigned_bigint_helpers)]
31013101
/// let r = u8::carrying_mul(7, 13, 0);
31023102
/// assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
@@ -3109,6 +3109,7 @@ macro_rules! uint_impl {
31093109
/// [`wrapping_add`](Self::wrapping_add) methods:
31103110
///
31113111
/// ```
3112+
/// # #![allow(unused_features)]
31123113
/// #![feature(const_unsigned_bigint_helpers)]
31133114
/// assert_eq!(
31143115
/// 789_u16.carrying_mul(456, 123).0,

0 commit comments

Comments
 (0)