Skip to content

Commit 7922024

Browse files
committed
Categorize and sort unstable features in std.
1 parent e50ff9b commit 7922024

File tree

1 file changed

+74
-63
lines changed

1 file changed

+74
-63
lines changed

library/std/src/lib.rs

+74-63
Original file line numberDiff line numberDiff line change
@@ -218,111 +218,122 @@
218218
feature(slice_index_methods, coerce_unsized, sgx_platform)
219219
)]
220220
#![deny(rustc::existing_doc_keyword)]
221-
// std is implemented with unstable features, many of which are internal
222-
// compiler details that will never be stable
223-
// NB: the following list is sorted to minimize merge conflicts.
221+
//
222+
// Language features:
224223
#![feature(alloc_error_handler)]
225-
#![feature(alloc_layout_extra)]
226-
#![feature(allocator_api)]
227224
#![feature(allocator_internals)]
228225
#![feature(allow_internal_unsafe)]
229226
#![feature(allow_internal_unstable)]
230-
#![feature(array_error_internals)]
231-
#![feature(assert_matches)]
232227
#![feature(associated_type_bounds)]
233-
#![feature(async_iterator)]
234-
#![feature(atomic_mut_ptr)]
235-
#![feature(bench_black_box)]
236228
#![feature(box_syntax)]
237229
#![feature(c_unwind)]
238-
#![feature(c_variadic)]
239-
#![feature(cfg_accessible)]
240-
#![feature(cfg_eval)]
241230
#![feature(cfg_target_thread_local)]
242-
#![feature(char_error_internals)]
243-
#![feature(char_internals)]
244-
#![feature(concat_bytes)]
245231
#![feature(concat_idents)]
246232
#![cfg_attr(bootstrap, feature(const_fn_fn_ptr_basics))]
247233
#![cfg_attr(bootstrap, feature(const_fn_trait_bound))]
248-
#![feature(const_format_args)]
249-
#![feature(const_io_structs)]
250-
#![feature(const_ip)]
251-
#![feature(const_ipv4)]
252-
#![feature(const_ipv6)]
253234
#![feature(const_mut_refs)]
254-
#![feature(const_option)]
255-
#![feature(const_socketaddr)]
256235
#![feature(const_trait_impl)]
257-
#![feature(c_size_t)]
258-
#![feature(core_ffi_c)]
259-
#![feature(core_intrinsics)]
260-
#![feature(core_panic)]
261-
#![feature(custom_test_frameworks)]
262236
#![feature(decl_macro)]
237+
#![cfg_attr(not(bootstrap), feature(deprecated_suggestion))]
263238
#![feature(doc_cfg)]
264239
#![feature(doc_cfg_hide)]
265-
#![feature(rustdoc_internals)]
266-
#![cfg_attr(not(bootstrap), feature(deprecated_suggestion))]
267240
#![feature(doc_masked)]
268241
#![feature(doc_notable_trait)]
269242
#![feature(dropck_eyepatch)]
270-
#![feature(duration_checked_float)]
271-
#![feature(duration_constants)]
272-
#![feature(edition_panic)]
273-
#![feature(exact_size_is_empty)]
274243
#![feature(exhaustive_patterns)]
275-
#![feature(extend_one)]
276-
#![feature(float_minimum_maximum)]
277-
#![feature(format_args_nl)]
278-
#![feature(strict_provenance)]
279-
#![feature(get_mut_unchecked)]
280-
#![feature(hashmap_internals)]
281-
#![feature(int_error_internals)]
282244
#![feature(intra_doc_pointers)]
283245
#![feature(lang_items)]
284246
#![feature(linkage)]
285-
#![feature(log_syntax)]
286-
#![feature(map_try_insert)]
287-
#![feature(maybe_uninit_slice)]
288-
#![feature(maybe_uninit_write_slice)]
289247
#![feature(min_specialization)]
290-
#![feature(mixed_integer_ops)]
291248
#![feature(must_not_suspend)]
292249
#![feature(needs_panic_runtime)]
293250
#![feature(negative_impls)]
294251
#![feature(never_type)]
295-
#![feature(new_uninit)]
296252
#![feature(nll)]
253+
#![feature(platform_intrinsics)]
254+
#![feature(prelude_import)]
255+
#![feature(rustc_attrs)]
256+
#![feature(rustdoc_internals)]
257+
#![feature(staged_api)]
258+
#![feature(thread_local)]
259+
#![feature(try_blocks)]
260+
//
261+
// Library features (core):
262+
#![feature(array_error_internals)]
263+
#![feature(atomic_mut_ptr)]
264+
#![feature(char_error_internals)]
265+
#![feature(char_internals)]
266+
#![feature(core_intrinsics)]
267+
#![feature(duration_checked_float)]
268+
#![feature(duration_constants)]
269+
#![feature(exact_size_is_empty)]
270+
#![feature(extend_one)]
271+
#![feature(float_minimum_maximum)]
272+
#![feature(hashmap_internals)]
273+
#![feature(int_error_internals)]
274+
#![feature(maybe_uninit_slice)]
275+
#![feature(maybe_uninit_write_slice)]
276+
#![feature(mixed_integer_ops)]
297277
#![feature(nonnull_slice_from_raw_parts)]
298-
#![feature(once_cell)]
278+
#![feature(panic_can_unwind)]
299279
#![feature(panic_info_message)]
300280
#![feature(panic_internals)]
301-
#![feature(panic_can_unwind)]
302-
#![feature(panic_unwind)]
303-
#![feature(platform_intrinsics)]
304281
#![feature(portable_simd)]
305-
#![feature(prelude_import)]
306282
#![feature(ptr_as_uninit)]
307283
#![feature(raw_os_nonzero)]
308-
#![feature(rustc_attrs)]
309-
#![feature(saturating_int_impl)]
310284
#![feature(slice_internals)]
311285
#![feature(slice_ptr_get)]
312-
#![feature(staged_api)]
313286
#![feature(std_internals)]
314-
#![feature(stdsimd)]
315287
#![feature(str_internals)]
316-
#![feature(test)]
317-
#![feature(thread_local)]
318-
#![feature(thread_local_internals)]
319-
#![feature(toowned_clone_into)]
288+
#![feature(strict_provenance)]
320289
#![feature(total_cmp)]
321-
#![feature(trace_macros)]
322-
#![feature(try_blocks)]
290+
//
291+
// Library features (alloc):
292+
#![feature(alloc_layout_extra)]
293+
#![feature(allocator_api)]
294+
#![feature(get_mut_unchecked)]
295+
#![feature(map_try_insert)]
296+
#![feature(new_uninit)]
297+
#![feature(toowned_clone_into)]
323298
#![feature(try_reserve_kind)]
324299
#![feature(vec_into_raw_parts)]
325-
// NB: the above list is sorted to minimize merge conflicts.
300+
//
301+
// Library features (unwind):
302+
#![feature(panic_unwind)]
303+
//
304+
// Only for re-exporting:
305+
#![feature(assert_matches)]
306+
#![feature(async_iterator)]
307+
#![feature(c_size_t)]
308+
#![feature(c_variadic)]
309+
#![feature(cfg_accessible)]
310+
#![feature(cfg_eval)]
311+
#![feature(concat_bytes)]
312+
#![feature(const_format_args)]
313+
#![feature(core_ffi_c)]
314+
#![feature(core_panic)]
315+
#![feature(custom_test_frameworks)]
316+
#![feature(edition_panic)]
317+
#![feature(format_args_nl)]
318+
#![feature(log_syntax)]
319+
#![feature(once_cell)]
320+
#![feature(saturating_int_impl)]
321+
#![feature(stdsimd)]
322+
#![feature(test)]
323+
#![feature(trace_macros)]
324+
//
325+
// Only used in tests/benchmarks:
326+
#![feature(bench_black_box)]
327+
//
328+
// Only for const-ness:
329+
#![feature(const_io_structs)]
330+
#![feature(const_ip)]
331+
#![feature(const_ipv4)]
332+
#![feature(const_ipv6)]
333+
#![feature(const_option)]
334+
#![feature(const_socketaddr)]
335+
#![feature(thread_local_internals)]
336+
//
326337
#![default_lib_allocator]
327338

328339
// Explicitly import the prelude. The compiler uses this same unstable attribute

0 commit comments

Comments
 (0)