Skip to content

Commit 71fcb72

Browse files
authored
Rollup merge of #87769 - m-ou-se:alloc-features-cleanup, r=yaahc,dtolnay
Alloc features cleanup This sorts and categorizes the `#![features]` in `alloc` and removes unused ones. This is part of #87766 The following feature attributes were unnecessary and are removed: ```diff // Library features: -#![feature(cow_is_borrowed)] -#![feature(maybe_uninit_uninit_array)] -#![feature(slice_partition_dedup)] // Language features: -#![feature(arbitrary_self_types)] -#![feature(auto_traits)] -#![feature(box_patterns)] -#![feature(decl_macro)] -#![feature(nll)] ```
2 parents 3d95330 + 6fdcedc commit 71fcb72

File tree

1 file changed

+46
-43
lines changed

1 file changed

+46
-43
lines changed

Diff for: library/alloc/src/lib.rs

+46-43
Original file line numberDiff line numberDiff line change
@@ -80,87 +80,90 @@
8080
)]
8181
#![no_std]
8282
#![needs_allocator]
83+
//
84+
// Lints:
85+
#![deny(unsafe_op_in_unsafe_fn)]
8386
#![warn(deprecated_in_future)]
84-
#![warn(missing_docs)]
8587
#![warn(missing_debug_implementations)]
88+
#![warn(missing_docs)]
8689
#![allow(explicit_outlives_requirements)]
87-
#![deny(unsafe_op_in_unsafe_fn)]
88-
#![feature(rustc_allow_const_fn_unstable)]
89-
#![cfg_attr(not(test), feature(generator_trait))]
90-
#![cfg_attr(test, feature(test))]
91-
#![cfg_attr(test, feature(new_uninit))]
90+
//
91+
// Library features:
92+
#![feature(alloc_layout_extra)]
9293
#![feature(allocator_api)]
9394
#![feature(array_chunks)]
9495
#![feature(array_methods)]
9596
#![feature(array_windows)]
96-
#![feature(allow_internal_unstable)]
97-
#![feature(arbitrary_self_types)]
9897
#![feature(async_stream)]
99-
#![feature(box_patterns)]
100-
#![feature(box_syntax)]
101-
#![feature(cfg_sanitize)]
102-
#![feature(cfg_target_has_atomic)]
10398
#![feature(coerce_unsized)]
10499
#![cfg_attr(not(no_global_oom_handling), feature(const_btree_new))]
105-
#![feature(const_fn_trait_bound)]
106-
#![feature(cow_is_borrowed)]
107100
#![feature(const_cow_is_borrowed)]
108-
#![feature(const_trait_impl)]
109-
#![feature(destructuring_assignment)]
110-
#![feature(dispatch_from_dyn)]
111101
#![feature(core_intrinsics)]
112-
#![feature(dropck_eyepatch)]
102+
#![feature(dispatch_from_dyn)]
113103
#![feature(exact_size_is_empty)]
114-
#![feature(exclusive_range_pattern)]
115104
#![feature(extend_one)]
116105
#![feature(fmt_internals)]
117106
#![feature(fn_traits)]
118-
#![feature(fundamental)]
119107
#![feature(inplace_iteration)]
120-
// Technically, this is a bug in rustdoc: rustdoc sees the documentation on `#[lang = slice_alloc]`
121-
// blocks is for `&[T]`, which also has documentation using this feature in `core`, and gets mad
122-
// that the feature-gate isn't enabled. Ideally, it wouldn't check for the feature gate for docs
123-
// from other crates, but since this can only appear for lang items, it doesn't seem worth fixing.
124-
#![feature(intra_doc_pointers)]
125108
#![feature(iter_advance_by)]
126109
#![feature(iter_zip)]
127-
#![feature(lang_items)]
128110
#![feature(layout_for_ptr)]
129-
#![feature(negative_impls)]
130-
#![feature(never_type)]
131-
#![feature(nll)]
111+
#![feature(maybe_uninit_extra)]
112+
#![feature(maybe_uninit_slice)]
113+
#![cfg_attr(test, feature(new_uninit))]
132114
#![feature(nonnull_slice_from_raw_parts)]
133-
#![feature(auto_traits)]
134115
#![feature(option_result_unwrap_unchecked)]
135116
#![feature(pattern)]
136117
#![feature(ptr_internals)]
137-
#![feature(rustc_attrs)]
138118
#![feature(receiver_trait)]
139-
#![feature(min_specialization)]
140119
#![feature(set_ptr_value)]
120+
#![feature(slice_group_by)]
141121
#![feature(slice_ptr_get)]
142122
#![feature(slice_ptr_len)]
143123
#![feature(slice_range)]
144-
#![feature(staged_api)]
145124
#![feature(str_internals)]
146125
#![feature(trusted_len)]
147-
#![feature(unboxed_closures)]
126+
#![feature(trusted_random_access)]
127+
#![feature(try_trait_v2)]
148128
#![feature(unicode_internals)]
149129
#![feature(unsize)]
150-
#![feature(unsized_fn_params)]
130+
//
131+
// Language features:
151132
#![feature(allocator_internals)]
152-
#![feature(slice_partition_dedup)]
153-
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]
154-
#![feature(alloc_layout_extra)]
155-
#![feature(trusted_random_access)]
156-
#![feature(try_trait_v2)]
133+
#![feature(allow_internal_unstable)]
157134
#![feature(associated_type_bounds)]
158-
#![feature(slice_group_by)]
159-
#![feature(decl_macro)]
135+
#![feature(box_syntax)]
136+
#![feature(cfg_sanitize)]
137+
#![feature(cfg_target_has_atomic)]
138+
#![feature(const_fn_trait_bound)]
139+
#![feature(const_trait_impl)]
140+
#![feature(destructuring_assignment)]
141+
#![feature(dropck_eyepatch)]
142+
#![feature(exclusive_range_pattern)]
143+
#![feature(fundamental)]
144+
#![cfg_attr(not(test), feature(generator_trait))]
145+
#![feature(lang_items)]
146+
#![feature(min_specialization)]
147+
#![feature(negative_impls)]
148+
#![feature(never_type)]
149+
#![feature(nll)] // Not necessary, but here to test the `nll` feature.
150+
#![feature(rustc_allow_const_fn_unstable)]
151+
#![feature(rustc_attrs)]
152+
#![feature(staged_api)]
153+
#![cfg_attr(test, feature(test))]
154+
#![feature(unboxed_closures)]
155+
#![feature(unsized_fn_params)]
156+
//
157+
// Rustdoc features:
160158
#![feature(doc_cfg)]
161159
#![cfg_attr(not(bootstrap), feature(doc_cfg_hide))]
162-
// Allow testing this library
160+
// Technically, this is a bug in rustdoc: rustdoc sees the documentation on `#[lang = slice_alloc]`
161+
// blocks is for `&[T]`, which also has documentation using this feature in `core`, and gets mad
162+
// that the feature-gate isn't enabled. Ideally, it wouldn't check for the feature gate for docs
163+
// from other crates, but since this can only appear for lang items, it doesn't seem worth fixing.
164+
#![feature(intra_doc_pointers)]
163165

166+
// Allow testing this library
164167
#[cfg(test)]
165168
#[macro_use]
166169
extern crate std;

0 commit comments

Comments
 (0)