From 25d0c58e0a87ac5f38614a4ef31c73a1b9beb3a5 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Wed, 4 Aug 2021 17:54:07 +0200 Subject: [PATCH] Sort and categorize lint and feature attributes in core. --- library/core/src/lib.rs | 123 +++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 57 deletions(-) diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 1ab7227933b..8ed2f2e41ed 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -61,61 +61,82 @@ test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))) )] #![no_core] + +// Lints: +#![deny(rust_2021_incompatible_or_patterns)] +#![deny(unsafe_op_in_unsafe_fn)] #![warn(deprecated_in_future)] -#![warn(missing_docs)] #![warn(missing_debug_implementations)] +#![warn(missing_docs)] #![allow(explicit_outlives_requirements)] -#![feature(rustc_allow_const_fn_unstable)] -#![feature(allow_internal_unstable)] -#![feature(arbitrary_self_types)] -#![feature(asm)] + +// Library features: #![feature(bool_to_option)] -#![feature(cfg_target_has_atomic)] -#![feature(const_heap)] +#![feature(char_indices_offset)] +#![feature(const_align_of_val)] #![feature(const_alloc_layout)] #![feature(const_arguments_as_str)] #![feature(const_assert_type)] -#![feature(const_discriminant)] +#![feature(const_caller_location)] #![feature(const_cell_into_inner)] +#![feature(const_discriminant)] +#![feature(const_float_bits_conv)] +#![feature(const_float_classify)] +#![feature(const_heap)] +#![feature(const_inherent_unchecked_arith)] +#![feature(const_int_unchecked_arith)] #![feature(const_intrinsic_copy)] #![feature(const_intrinsic_forget)] -#![feature(const_float_classify)] -#![feature(const_float_bits_conv)] -#![feature(const_int_unchecked_arith)] -#![feature(const_inherent_unchecked_arith)] -#![feature(const_mut_refs)] -#![feature(const_refs_to_cell)] -#![feature(const_panic)] -#![feature(const_pin)] -#![cfg_attr(bootstrap, feature(const_fn_union))] -#![feature(const_impl_trait)] -#![feature(const_fn_floating_point_arithmetic)] -#![feature(const_fn_fn_ptr_basics)] -#![feature(const_fn_trait_bound)] +#![feature(const_likely)] +#![feature(const_maybe_uninit_as_ptr)] +#![feature(const_maybe_uninit_assume_init)] #![feature(const_option)] -#![feature(const_precise_live_drops)] +#![feature(const_pin)] #![feature(const_ptr_offset)] #![feature(const_ptr_offset_from)] #![feature(const_ptr_read)] #![feature(const_ptr_write)] #![feature(const_raw_ptr_comparison)] -#![feature(const_raw_ptr_deref)] +#![feature(const_size_of_val)] #![feature(const_slice_from_raw_parts)] #![feature(const_slice_ptr_len)] -#![feature(const_size_of_val)] #![feature(const_swap)] -#![feature(const_align_of_val)] #![feature(const_type_id)] #![feature(const_type_name)] -#![feature(const_likely)] #![feature(const_unreachable_unchecked)] -#![feature(const_maybe_uninit_assume_init)] -#![feature(const_maybe_uninit_as_ptr)] +#![feature(duration_consts_2)] +#![feature(pin_deref_mut)] +#![feature(ptr_metadata)] +#![feature(slice_ptr_get)] +#![feature(std_internals)] +#![feature(str_split_as_str)] +#![feature(str_split_inclusive_as_str)] +#![feature(variant_count)] + +// Language features: +#![feature(abi_unadjusted)] +#![feature(allow_internal_unstable)] +#![feature(arbitrary_self_types)] +#![feature(asm)] +#![feature(associated_type_bounds)] +#![feature(auto_traits)] +#![feature(cfg_target_has_atomic)] +#![feature(const_fn_floating_point_arithmetic)] +#![feature(const_fn_fn_ptr_basics)] +#![feature(const_fn_trait_bound)] +#![cfg_attr(bootstrap, feature(const_fn_transmute))] +#![cfg_attr(bootstrap, feature(const_fn_union))] +#![feature(const_impl_trait)] +#![feature(const_mut_refs)] +#![feature(const_panic)] +#![feature(const_precise_live_drops)] +#![feature(const_raw_ptr_deref)] +#![feature(const_refs_to_cell)] #![feature(custom_inner_attributes)] #![feature(decl_macro)] #![feature(doc_cfg)] #![feature(doc_notable_trait)] -#![feature(duration_consts_2)] +#![feature(exhaustive_patterns)] #![feature(extern_types)] #![feature(fundamental)] #![feature(intra_doc_pointers)] @@ -123,53 +144,41 @@ #![feature(lang_items)] #![feature(link_llvm_intrinsics)] #![feature(llvm_asm)] +#![feature(min_specialization)] #![feature(negative_impls)] #![feature(never_type)] #![feature(nll)] -#![feature(exhaustive_patterns)] #![feature(no_core)] -#![feature(auto_traits)] -#![feature(pin_deref_mut)] +#![feature(no_coverage)] // rust-lang/rust#84605 +#![feature(no_niche)] // rust-lang/rust#68303 +#![feature(platform_intrinsics)] #![feature(prelude_import)] -#![feature(ptr_metadata)] -#![feature(repr_simd, platform_intrinsics)] +#![feature(repr_simd)] +#![feature(rustc_allow_const_fn_unstable)] #![feature(rustc_attrs)] #![feature(simd_ffi)] -#![feature(min_specialization)] #![feature(staged_api)] -#![feature(std_internals)] #![feature(stmt_expr_attributes)] -#![feature(str_split_as_str)] -#![feature(str_split_inclusive_as_str)] -#![feature(char_indices_offset)] #![feature(trait_alias)] #![feature(transparent_unions)] #![feature(try_blocks)] #![feature(unboxed_closures)] #![feature(unsized_fn_params)] -#![feature(variant_count)] -#![feature(tbm_target_feature)] -#![feature(sse4a_target_feature)] -#![feature(arm_target_feature)] -#![feature(powerpc_target_feature)] -#![feature(mips_target_feature)] + +// Target features: #![feature(aarch64_target_feature)] -#![feature(wasm_target_feature)] +#![feature(adx_target_feature)] +#![feature(arm_target_feature)] #![feature(avx512_target_feature)] #![feature(cmpxchg16b_target_feature)] -#![feature(rtm_target_feature)] #![feature(f16c_target_feature)] #![feature(hexagon_target_feature)] -#![cfg_attr(bootstrap, feature(const_fn_transmute))] -#![feature(abi_unadjusted)] -#![feature(adx_target_feature)] -#![feature(associated_type_bounds)] -#![feature(const_caller_location)] -#![feature(slice_ptr_get)] -#![feature(no_niche)] // rust-lang/rust#68303 -#![feature(no_coverage)] // rust-lang/rust#84605 -#![deny(unsafe_op_in_unsafe_fn)] -#![deny(rust_2021_incompatible_or_patterns)] +#![feature(mips_target_feature)] +#![feature(powerpc_target_feature)] +#![feature(rtm_target_feature)] +#![feature(sse4a_target_feature)] +#![feature(tbm_target_feature)] +#![feature(wasm_target_feature)] // allow using `core::` in intra-doc links #[allow(unused_extern_crates)]