make tidy-alphabetical use a natural sort
This commit is contained in:
@@ -4064,9 +4064,9 @@ mod size_asserts {
|
|||||||
static_assert_size!(MetaItemLit, 40);
|
static_assert_size!(MetaItemLit, 40);
|
||||||
static_assert_size!(Param, 40);
|
static_assert_size!(Param, 40);
|
||||||
static_assert_size!(Pat, 72);
|
static_assert_size!(Pat, 72);
|
||||||
|
static_assert_size!(PatKind, 48);
|
||||||
static_assert_size!(Path, 24);
|
static_assert_size!(Path, 24);
|
||||||
static_assert_size!(PathSegment, 24);
|
static_assert_size!(PathSegment, 24);
|
||||||
static_assert_size!(PatKind, 48);
|
|
||||||
static_assert_size!(Stmt, 32);
|
static_assert_size!(Stmt, 32);
|
||||||
static_assert_size!(StmtKind, 16);
|
static_assert_size!(StmtKind, 16);
|
||||||
static_assert_size!(Ty, 64);
|
static_assert_size!(Ty, 64);
|
||||||
|
|||||||
@@ -878,9 +878,9 @@ mod size_asserts {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
static_assert_size!(Immediate, 48);
|
|
||||||
static_assert_size!(ImmTy<'_>, 64);
|
static_assert_size!(ImmTy<'_>, 64);
|
||||||
static_assert_size!(Operand, 56);
|
static_assert_size!(Immediate, 48);
|
||||||
static_assert_size!(OpTy<'_>, 72);
|
static_assert_size!(OpTy<'_>, 72);
|
||||||
|
static_assert_size!(Operand, 56);
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1056,9 +1056,9 @@ mod size_asserts {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
|
static_assert_size!(MPlaceTy<'_>, 64);
|
||||||
static_assert_size!(MemPlace, 48);
|
static_assert_size!(MemPlace, 48);
|
||||||
static_assert_size!(MemPlaceMeta, 24);
|
static_assert_size!(MemPlaceMeta, 24);
|
||||||
static_assert_size!(MPlaceTy<'_>, 64);
|
|
||||||
static_assert_size!(Place, 48);
|
static_assert_size!(Place, 48);
|
||||||
static_assert_size!(PlaceTy<'_>, 64);
|
static_assert_size!(PlaceTy<'_>, 64);
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
|
|||||||
@@ -4992,9 +4992,9 @@ mod size_asserts {
|
|||||||
static_assert_size!(LetStmt<'_>, 72);
|
static_assert_size!(LetStmt<'_>, 72);
|
||||||
static_assert_size!(Param<'_>, 32);
|
static_assert_size!(Param<'_>, 32);
|
||||||
static_assert_size!(Pat<'_>, 72);
|
static_assert_size!(Pat<'_>, 72);
|
||||||
|
static_assert_size!(PatKind<'_>, 48);
|
||||||
static_assert_size!(Path<'_>, 40);
|
static_assert_size!(Path<'_>, 40);
|
||||||
static_assert_size!(PathSegment<'_>, 48);
|
static_assert_size!(PathSegment<'_>, 48);
|
||||||
static_assert_size!(PatKind<'_>, 48);
|
|
||||||
static_assert_size!(QPath<'_>, 24);
|
static_assert_size!(QPath<'_>, 24);
|
||||||
static_assert_size!(Res, 12);
|
static_assert_size!(Res, 12);
|
||||||
static_assert_size!(Stmt<'_>, 32);
|
static_assert_size!(Stmt<'_>, 32);
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ declare_lint_pass! {
|
|||||||
UNUSED_IMPORTS,
|
UNUSED_IMPORTS,
|
||||||
UNUSED_LABELS,
|
UNUSED_LABELS,
|
||||||
UNUSED_LIFETIMES,
|
UNUSED_LIFETIMES,
|
||||||
UNUSED_MACRO_RULES,
|
|
||||||
UNUSED_MACROS,
|
UNUSED_MACROS,
|
||||||
|
UNUSED_MACRO_RULES,
|
||||||
UNUSED_MUT,
|
UNUSED_MUT,
|
||||||
UNUSED_QUALIFICATIONS,
|
UNUSED_QUALIFICATIONS,
|
||||||
UNUSED_UNSAFE,
|
UNUSED_UNSAFE,
|
||||||
|
|||||||
@@ -774,8 +774,8 @@ bidirectional_lang_item_map! {
|
|||||||
Future,
|
Future,
|
||||||
FutureOutput,
|
FutureOutput,
|
||||||
Iterator,
|
Iterator,
|
||||||
Metadata,
|
|
||||||
MetaSized,
|
MetaSized,
|
||||||
|
Metadata,
|
||||||
Option,
|
Option,
|
||||||
PointeeSized,
|
PointeeSized,
|
||||||
PointeeTrait,
|
PointeeTrait,
|
||||||
|
|||||||
@@ -230,9 +230,9 @@ TrivialLiftImpls! {
|
|||||||
usize,
|
usize,
|
||||||
u64,
|
u64,
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
|
crate::mir::Promoted,
|
||||||
crate::mir::interpret::AllocId,
|
crate::mir::interpret::AllocId,
|
||||||
crate::mir::interpret::Scalar,
|
crate::mir::interpret::Scalar,
|
||||||
crate::mir::Promoted,
|
|
||||||
rustc_abi::ExternAbi,
|
rustc_abi::ExternAbi,
|
||||||
rustc_abi::Size,
|
rustc_abi::Size,
|
||||||
rustc_hir::Safety,
|
rustc_hir::Safety,
|
||||||
@@ -267,9 +267,6 @@ TrivialTypeTraversalImpls! {
|
|||||||
crate::mir::SwitchTargets,
|
crate::mir::SwitchTargets,
|
||||||
crate::traits::IsConstable,
|
crate::traits::IsConstable,
|
||||||
crate::traits::OverflowError,
|
crate::traits::OverflowError,
|
||||||
crate::ty::abstract_const::NotConstEvaluatable,
|
|
||||||
crate::ty::adjustment::AutoBorrowMutability,
|
|
||||||
crate::ty::adjustment::PointerCoercion,
|
|
||||||
crate::ty::AdtKind,
|
crate::ty::AdtKind,
|
||||||
crate::ty::AssocItem,
|
crate::ty::AssocItem,
|
||||||
crate::ty::AssocKind,
|
crate::ty::AssocKind,
|
||||||
@@ -281,15 +278,18 @@ TrivialTypeTraversalImpls! {
|
|||||||
crate::ty::Placeholder<ty::BoundVar>,
|
crate::ty::Placeholder<ty::BoundVar>,
|
||||||
crate::ty::UserTypeAnnotationIndex,
|
crate::ty::UserTypeAnnotationIndex,
|
||||||
crate::ty::ValTree<'tcx>,
|
crate::ty::ValTree<'tcx>,
|
||||||
|
crate::ty::abstract_const::NotConstEvaluatable,
|
||||||
|
crate::ty::adjustment::AutoBorrowMutability,
|
||||||
|
crate::ty::adjustment::PointerCoercion,
|
||||||
rustc_abi::FieldIdx,
|
rustc_abi::FieldIdx,
|
||||||
rustc_abi::VariantIdx,
|
rustc_abi::VariantIdx,
|
||||||
rustc_ast::InlineAsmOptions,
|
rustc_ast::InlineAsmOptions,
|
||||||
rustc_ast::InlineAsmTemplatePiece,
|
rustc_ast::InlineAsmTemplatePiece,
|
||||||
rustc_hir::CoroutineKind,
|
rustc_hir::CoroutineKind,
|
||||||
rustc_hir::def_id::LocalDefId,
|
|
||||||
rustc_hir::HirId,
|
rustc_hir::HirId,
|
||||||
rustc_hir::MatchSource,
|
rustc_hir::MatchSource,
|
||||||
rustc_hir::RangeEnd,
|
rustc_hir::RangeEnd,
|
||||||
|
rustc_hir::def_id::LocalDefId,
|
||||||
rustc_span::Ident,
|
rustc_span::Ident,
|
||||||
rustc_span::Span,
|
rustc_span::Span,
|
||||||
rustc_span::Symbol,
|
rustc_span::Symbol,
|
||||||
@@ -303,9 +303,9 @@ TrivialTypeTraversalImpls! {
|
|||||||
// interners).
|
// interners).
|
||||||
TrivialTypeTraversalAndLiftImpls! {
|
TrivialTypeTraversalAndLiftImpls! {
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
crate::ty::instance::ReifyReason,
|
|
||||||
crate::ty::ParamConst,
|
crate::ty::ParamConst,
|
||||||
crate::ty::ParamTy,
|
crate::ty::ParamTy,
|
||||||
|
crate::ty::instance::ReifyReason,
|
||||||
rustc_hir::def_id::DefId,
|
rustc_hir::def_id::DefId,
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,9 +212,6 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("flagm2", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
("flagm2", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
||||||
// We forbid directly toggling just `fp-armv8`; it must be toggled with `neon`.
|
// We forbid directly toggling just `fp-armv8`; it must be toggled with `neon`.
|
||||||
("fp-armv8", Stability::Forbidden { reason: "Rust ties `fp-armv8` to `neon`" }, &[]),
|
("fp-armv8", Stability::Forbidden { reason: "Rust ties `fp-armv8` to `neon`" }, &[]),
|
||||||
// FEAT_FP16
|
|
||||||
// Rust ties FP and Neon: https://github.com/rust-lang/rust/pull/91608
|
|
||||||
("fp16", Stable, &["neon"]),
|
|
||||||
// FEAT_FP8
|
// FEAT_FP8
|
||||||
("fp8", Unstable(sym::aarch64_unstable_target_feature), &["faminmax", "lut", "bf16"]),
|
("fp8", Unstable(sym::aarch64_unstable_target_feature), &["faminmax", "lut", "bf16"]),
|
||||||
// FEAT_FP8DOT2
|
// FEAT_FP8DOT2
|
||||||
@@ -223,6 +220,9 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("fp8dot4", Unstable(sym::aarch64_unstable_target_feature), &["fp8fma"]),
|
("fp8dot4", Unstable(sym::aarch64_unstable_target_feature), &["fp8fma"]),
|
||||||
// FEAT_FP8FMA
|
// FEAT_FP8FMA
|
||||||
("fp8fma", Unstable(sym::aarch64_unstable_target_feature), &["fp8"]),
|
("fp8fma", Unstable(sym::aarch64_unstable_target_feature), &["fp8"]),
|
||||||
|
// FEAT_FP16
|
||||||
|
// Rust ties FP and Neon: https://github.com/rust-lang/rust/pull/91608
|
||||||
|
("fp16", Stable, &["neon"]),
|
||||||
// FEAT_FRINTTS
|
// FEAT_FRINTTS
|
||||||
("frintts", Stable, &[]),
|
("frintts", Stable, &[]),
|
||||||
// FEAT_HBC
|
// FEAT_HBC
|
||||||
@@ -236,10 +236,10 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("lor", Stable, &[]),
|
("lor", Stable, &[]),
|
||||||
// FEAT_LSE
|
// FEAT_LSE
|
||||||
("lse", Stable, &[]),
|
("lse", Stable, &[]),
|
||||||
// FEAT_LSE128
|
|
||||||
("lse128", Unstable(sym::aarch64_unstable_target_feature), &["lse"]),
|
|
||||||
// FEAT_LSE2
|
// FEAT_LSE2
|
||||||
("lse2", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
("lse2", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
||||||
|
// FEAT_LSE128
|
||||||
|
("lse128", Unstable(sym::aarch64_unstable_target_feature), &["lse"]),
|
||||||
// FEAT_LUT
|
// FEAT_LUT
|
||||||
("lut", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
("lut", Unstable(sym::aarch64_unstable_target_feature), &[]),
|
||||||
// FEAT_MOPS
|
// FEAT_MOPS
|
||||||
@@ -283,14 +283,14 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("sme", Unstable(sym::aarch64_unstable_target_feature), &["bf16"]),
|
("sme", Unstable(sym::aarch64_unstable_target_feature), &["bf16"]),
|
||||||
// FEAT_SME_B16B16
|
// FEAT_SME_B16B16
|
||||||
("sme-b16b16", Unstable(sym::aarch64_unstable_target_feature), &["bf16", "sme2", "sve-b16b16"]),
|
("sme-b16b16", Unstable(sym::aarch64_unstable_target_feature), &["bf16", "sme2", "sve-b16b16"]),
|
||||||
// FEAT_SME_F16F16
|
|
||||||
("sme-f16f16", Unstable(sym::aarch64_unstable_target_feature), &["sme2"]),
|
|
||||||
// FEAT_SME_F64F64
|
|
||||||
("sme-f64f64", Unstable(sym::aarch64_unstable_target_feature), &["sme"]),
|
|
||||||
// FEAT_SME_F8F16
|
// FEAT_SME_F8F16
|
||||||
("sme-f8f16", Unstable(sym::aarch64_unstable_target_feature), &["sme-f8f32"]),
|
("sme-f8f16", Unstable(sym::aarch64_unstable_target_feature), &["sme-f8f32"]),
|
||||||
// FEAT_SME_F8F32
|
// FEAT_SME_F8F32
|
||||||
("sme-f8f32", Unstable(sym::aarch64_unstable_target_feature), &["sme2", "fp8"]),
|
("sme-f8f32", Unstable(sym::aarch64_unstable_target_feature), &["sme2", "fp8"]),
|
||||||
|
// FEAT_SME_F16F16
|
||||||
|
("sme-f16f16", Unstable(sym::aarch64_unstable_target_feature), &["sme2"]),
|
||||||
|
// FEAT_SME_F64F64
|
||||||
|
("sme-f64f64", Unstable(sym::aarch64_unstable_target_feature), &["sme"]),
|
||||||
// FEAT_SME_FA64
|
// FEAT_SME_FA64
|
||||||
("sme-fa64", Unstable(sym::aarch64_unstable_target_feature), &["sme", "sve2"]),
|
("sme-fa64", Unstable(sym::aarch64_unstable_target_feature), &["sme", "sve2"]),
|
||||||
// FEAT_SME_I16I64
|
// FEAT_SME_I16I64
|
||||||
@@ -376,8 +376,8 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("amx-avx512", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-avx512", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
|
||||||
("amx-fp8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-fp8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
|
("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-movrs", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-movrs", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-tf32", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-tf32", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
@@ -385,6 +385,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("apxf", Unstable(sym::apx_target_feature), &[]),
|
("apxf", Unstable(sym::apx_target_feature), &[]),
|
||||||
("avx", Stable, &["sse4.2"]),
|
("avx", Stable, &["sse4.2"]),
|
||||||
|
("avx2", Stable, &["avx"]),
|
||||||
(
|
(
|
||||||
"avx10.1",
|
"avx10.1",
|
||||||
Unstable(sym::avx10_target_feature),
|
Unstable(sym::avx10_target_feature),
|
||||||
@@ -405,7 +406,6 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
("avx10.2", Unstable(sym::avx10_target_feature), &["avx10.1"]),
|
("avx10.2", Unstable(sym::avx10_target_feature), &["avx10.1"]),
|
||||||
("avx2", Stable, &["avx"]),
|
|
||||||
("avx512bf16", Stable, &["avx512bw"]),
|
("avx512bf16", Stable, &["avx512bw"]),
|
||||||
("avx512bitalg", Stable, &["avx512bw"]),
|
("avx512bitalg", Stable, &["avx512bw"]),
|
||||||
("avx512bw", Stable, &["avx512f"]),
|
("avx512bw", Stable, &["avx512f"]),
|
||||||
@@ -423,8 +423,8 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("avxifma", Stable, &["avx2"]),
|
("avxifma", Stable, &["avx2"]),
|
||||||
("avxneconvert", Stable, &["avx2"]),
|
("avxneconvert", Stable, &["avx2"]),
|
||||||
("avxvnni", Stable, &["avx2"]),
|
("avxvnni", Stable, &["avx2"]),
|
||||||
("avxvnniint16", Stable, &["avx2"]),
|
|
||||||
("avxvnniint8", Stable, &["avx2"]),
|
("avxvnniint8", Stable, &["avx2"]),
|
||||||
|
("avxvnniint16", Stable, &["avx2"]),
|
||||||
("bmi1", Stable, &[]),
|
("bmi1", Stable, &[]),
|
||||||
("bmi2", Stable, &[]),
|
("bmi2", Stable, &[]),
|
||||||
("cmpxchg16b", Stable, &[]),
|
("cmpxchg16b", Stable, &[]),
|
||||||
@@ -498,12 +498,12 @@ static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("altivec", Unstable(sym::powerpc_target_feature), &[]),
|
("altivec", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
("msync", Unstable(sym::powerpc_target_feature), &[]),
|
("msync", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
|
|
||||||
("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),
|
("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),
|
||||||
("power8-crypto", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
|
("power8-crypto", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
|
||||||
("power8-vector", Unstable(sym::powerpc_target_feature), &["vsx", "power8-altivec"]),
|
("power8-vector", Unstable(sym::powerpc_target_feature), &["vsx", "power8-altivec"]),
|
||||||
("power9-altivec", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
|
("power9-altivec", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
|
||||||
("power9-vector", Unstable(sym::powerpc_target_feature), &["power8-vector", "power9-altivec"]),
|
("power9-vector", Unstable(sym::powerpc_target_feature), &["power8-vector", "power9-altivec"]),
|
||||||
|
("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
|
||||||
("quadword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
("quadword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
("vsx", Unstable(sym::powerpc_target_feature), &["altivec"]),
|
("vsx", Unstable(sym::powerpc_target_feature), &["altivec"]),
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
@@ -535,8 +535,8 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]),
|
("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("unaligned-vector-mem", Unstable(sym::riscv_target_feature), &[]),
|
("unaligned-vector-mem", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("v", Unstable(sym::riscv_target_feature), &["zvl128b", "zve64d"]),
|
("v", Unstable(sym::riscv_target_feature), &["zvl128b", "zve64d"]),
|
||||||
("za128rs", Unstable(sym::riscv_target_feature), &[]),
|
|
||||||
("za64rs", Unstable(sym::riscv_target_feature), &["za128rs"]), // Za64rs ⊃ Za128rs
|
("za64rs", Unstable(sym::riscv_target_feature), &["za128rs"]), // Za64rs ⊃ Za128rs
|
||||||
|
("za128rs", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("zaamo", Unstable(sym::riscv_target_feature), &[]),
|
("zaamo", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("zabha", Unstable(sym::riscv_target_feature), &["zaamo"]),
|
("zabha", Unstable(sym::riscv_target_feature), &["zaamo"]),
|
||||||
("zacas", Unstable(sym::riscv_target_feature), &["zaamo"]),
|
("zacas", Unstable(sym::riscv_target_feature), &["zaamo"]),
|
||||||
@@ -613,18 +613,18 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("zvksg", Unstable(sym::riscv_target_feature), &["zvks", "zvkg"]),
|
("zvksg", Unstable(sym::riscv_target_feature), &["zvks", "zvkg"]),
|
||||||
("zvksh", Unstable(sym::riscv_target_feature), &["zve32x"]),
|
("zvksh", Unstable(sym::riscv_target_feature), &["zve32x"]),
|
||||||
("zvkt", Unstable(sym::riscv_target_feature), &[]),
|
("zvkt", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("zvl1024b", Unstable(sym::riscv_target_feature), &["zvl512b"]),
|
|
||||||
("zvl128b", Unstable(sym::riscv_target_feature), &["zvl64b"]),
|
|
||||||
("zvl16384b", Unstable(sym::riscv_target_feature), &["zvl8192b"]),
|
|
||||||
("zvl2048b", Unstable(sym::riscv_target_feature), &["zvl1024b"]),
|
|
||||||
("zvl256b", Unstable(sym::riscv_target_feature), &["zvl128b"]),
|
|
||||||
("zvl32768b", Unstable(sym::riscv_target_feature), &["zvl16384b"]),
|
|
||||||
("zvl32b", Unstable(sym::riscv_target_feature), &[]),
|
("zvl32b", Unstable(sym::riscv_target_feature), &[]),
|
||||||
("zvl4096b", Unstable(sym::riscv_target_feature), &["zvl2048b"]),
|
|
||||||
("zvl512b", Unstable(sym::riscv_target_feature), &["zvl256b"]),
|
|
||||||
("zvl64b", Unstable(sym::riscv_target_feature), &["zvl32b"]),
|
("zvl64b", Unstable(sym::riscv_target_feature), &["zvl32b"]),
|
||||||
("zvl65536b", Unstable(sym::riscv_target_feature), &["zvl32768b"]),
|
("zvl128b", Unstable(sym::riscv_target_feature), &["zvl64b"]),
|
||||||
|
("zvl256b", Unstable(sym::riscv_target_feature), &["zvl128b"]),
|
||||||
|
("zvl512b", Unstable(sym::riscv_target_feature), &["zvl256b"]),
|
||||||
|
("zvl1024b", Unstable(sym::riscv_target_feature), &["zvl512b"]),
|
||||||
|
("zvl2048b", Unstable(sym::riscv_target_feature), &["zvl1024b"]),
|
||||||
|
("zvl4096b", Unstable(sym::riscv_target_feature), &["zvl2048b"]),
|
||||||
("zvl8192b", Unstable(sym::riscv_target_feature), &["zvl4096b"]),
|
("zvl8192b", Unstable(sym::riscv_target_feature), &["zvl4096b"]),
|
||||||
|
("zvl16384b", Unstable(sym::riscv_target_feature), &["zvl8192b"]),
|
||||||
|
("zvl32768b", Unstable(sym::riscv_target_feature), &["zvl16384b"]),
|
||||||
|
("zvl65536b", Unstable(sym::riscv_target_feature), &["zvl32768b"]),
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -651,13 +651,13 @@ const BPF_FEATURES: &[(&str, Stability, ImpliedFeatures)] =
|
|||||||
|
|
||||||
static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("10e60", Unstable(sym::csky_target_feature), &["7e10"]),
|
|
||||||
("2e3", Unstable(sym::csky_target_feature), &["e2"]),
|
("2e3", Unstable(sym::csky_target_feature), &["e2"]),
|
||||||
("3e3r1", Unstable(sym::csky_target_feature), &[]),
|
("3e3r1", Unstable(sym::csky_target_feature), &[]),
|
||||||
("3e3r2", Unstable(sym::csky_target_feature), &["3e3r1", "doloop"]),
|
("3e3r2", Unstable(sym::csky_target_feature), &["3e3r1", "doloop"]),
|
||||||
("3e3r3", Unstable(sym::csky_target_feature), &["doloop"]),
|
("3e3r3", Unstable(sym::csky_target_feature), &["doloop"]),
|
||||||
("3e7", Unstable(sym::csky_target_feature), &["2e3"]),
|
("3e7", Unstable(sym::csky_target_feature), &["2e3"]),
|
||||||
("7e10", Unstable(sym::csky_target_feature), &["3e7"]),
|
("7e10", Unstable(sym::csky_target_feature), &["3e7"]),
|
||||||
|
("10e60", Unstable(sym::csky_target_feature), &["7e10"]),
|
||||||
("cache", Unstable(sym::csky_target_feature), &[]),
|
("cache", Unstable(sym::csky_target_feature), &[]),
|
||||||
("doloop", Unstable(sym::csky_target_feature), &[]),
|
("doloop", Unstable(sym::csky_target_feature), &[]),
|
||||||
("dsp1e2", Unstable(sym::csky_target_feature), &[]),
|
("dsp1e2", Unstable(sym::csky_target_feature), &[]),
|
||||||
@@ -726,12 +726,12 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
|||||||
("guarded-storage", Unstable(sym::s390x_target_feature), &[]),
|
("guarded-storage", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("high-word", Unstable(sym::s390x_target_feature), &[]),
|
("high-word", Unstable(sym::s390x_target_feature), &[]),
|
||||||
// LLVM does not define message-security-assist-extension versions 1, 2, 6, 10 and 11.
|
// LLVM does not define message-security-assist-extension versions 1, 2, 6, 10 and 11.
|
||||||
("message-security-assist-extension12", Unstable(sym::s390x_target_feature), &[]),
|
|
||||||
("message-security-assist-extension3", Unstable(sym::s390x_target_feature), &[]),
|
("message-security-assist-extension3", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("message-security-assist-extension4", Unstable(sym::s390x_target_feature), &[]),
|
("message-security-assist-extension4", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("message-security-assist-extension5", Unstable(sym::s390x_target_feature), &[]),
|
("message-security-assist-extension5", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("message-security-assist-extension8", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3"]),
|
("message-security-assist-extension8", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3"]),
|
||||||
("message-security-assist-extension9", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3", "message-security-assist-extension4"]),
|
("message-security-assist-extension9", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3", "message-security-assist-extension4"]),
|
||||||
|
("message-security-assist-extension12", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("miscellaneous-extensions-2", Unstable(sym::s390x_target_feature), &[]),
|
("miscellaneous-extensions-2", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
|
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
|
||||||
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
|
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ pub enum TraitSolverLangItem {
|
|||||||
Future,
|
Future,
|
||||||
FutureOutput,
|
FutureOutput,
|
||||||
Iterator,
|
Iterator,
|
||||||
Metadata,
|
|
||||||
MetaSized,
|
MetaSized,
|
||||||
|
Metadata,
|
||||||
Option,
|
Option,
|
||||||
PointeeSized,
|
PointeeSized,
|
||||||
PointeeTrait,
|
PointeeTrait,
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ TrivialTypeTraversalImpls! {
|
|||||||
crate::BoundConstness,
|
crate::BoundConstness,
|
||||||
crate::DebruijnIndex,
|
crate::DebruijnIndex,
|
||||||
crate::PredicatePolarity,
|
crate::PredicatePolarity,
|
||||||
|
crate::UniverseIndex,
|
||||||
|
crate::Variance,
|
||||||
crate::solve::BuiltinImplSource,
|
crate::solve::BuiltinImplSource,
|
||||||
crate::solve::Certainty,
|
crate::solve::Certainty,
|
||||||
crate::solve::GoalSource,
|
crate::solve::GoalSource,
|
||||||
crate::UniverseIndex,
|
|
||||||
crate::Variance,
|
|
||||||
rustc_ast_ir::Mutability,
|
rustc_ast_ir::Mutability,
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,8 +150,8 @@
|
|||||||
#![feature(doc_cfg_hide)]
|
#![feature(doc_cfg_hide)]
|
||||||
#![feature(doc_notable_trait)]
|
#![feature(doc_notable_trait)]
|
||||||
#![feature(extern_types)]
|
#![feature(extern_types)]
|
||||||
#![feature(f128)]
|
|
||||||
#![feature(f16)]
|
#![feature(f16)]
|
||||||
|
#![feature(f128)]
|
||||||
#![feature(freeze_impls)]
|
#![feature(freeze_impls)]
|
||||||
#![feature(fundamental)]
|
#![feature(fundamental)]
|
||||||
#![feature(if_let_guard)]
|
#![feature(if_let_guard)]
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
#![feature(exact_size_is_empty)]
|
#![feature(exact_size_is_empty)]
|
||||||
#![feature(extend_one)]
|
#![feature(extend_one)]
|
||||||
#![feature(extern_types)]
|
#![feature(extern_types)]
|
||||||
#![feature(f128)]
|
|
||||||
#![feature(f16)]
|
#![feature(f16)]
|
||||||
|
#![feature(f128)]
|
||||||
#![feature(float_algebraic)]
|
#![feature(float_algebraic)]
|
||||||
#![feature(float_gamma)]
|
#![feature(float_gamma)]
|
||||||
#![feature(float_minimum_maximum)]
|
#![feature(float_minimum_maximum)]
|
||||||
|
|||||||
@@ -462,8 +462,8 @@ impl ErrorKind {
|
|||||||
Deadlock => "deadlock",
|
Deadlock => "deadlock",
|
||||||
DirectoryNotEmpty => "directory not empty",
|
DirectoryNotEmpty => "directory not empty",
|
||||||
ExecutableFileBusy => "executable file busy",
|
ExecutableFileBusy => "executable file busy",
|
||||||
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
|
|
||||||
FileTooLarge => "file too large",
|
FileTooLarge => "file too large",
|
||||||
|
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
|
||||||
HostUnreachable => "host unreachable",
|
HostUnreachable => "host unreachable",
|
||||||
InProgress => "in progress",
|
InProgress => "in progress",
|
||||||
Interrupted => "operation interrupted",
|
Interrupted => "operation interrupted",
|
||||||
|
|||||||
@@ -290,8 +290,8 @@
|
|||||||
#![feature(doc_notable_trait)]
|
#![feature(doc_notable_trait)]
|
||||||
#![feature(dropck_eyepatch)]
|
#![feature(dropck_eyepatch)]
|
||||||
#![feature(extended_varargs_abi_support)]
|
#![feature(extended_varargs_abi_support)]
|
||||||
#![feature(f128)]
|
|
||||||
#![feature(f16)]
|
#![feature(f16)]
|
||||||
|
#![feature(f128)]
|
||||||
#![feature(ffi_const)]
|
#![feature(ffi_const)]
|
||||||
#![feature(formatting_options)]
|
#![feature(formatting_options)]
|
||||||
#![feature(if_let_guard)]
|
#![feature(if_let_guard)]
|
||||||
|
|||||||
@@ -271,20 +271,20 @@ impl WinError {
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
pub const ACCESS_DENIED: Self = Self::new(c::ERROR_ACCESS_DENIED);
|
pub const ACCESS_DENIED: Self = Self::new(c::ERROR_ACCESS_DENIED);
|
||||||
pub const ALREADY_EXISTS: Self = Self::new(c::ERROR_ALREADY_EXISTS);
|
pub const ALREADY_EXISTS: Self = Self::new(c::ERROR_ALREADY_EXISTS);
|
||||||
pub const BAD_NET_NAME: Self = Self::new(c::ERROR_BAD_NET_NAME);
|
|
||||||
pub const BAD_NETPATH: Self = Self::new(c::ERROR_BAD_NETPATH);
|
pub const BAD_NETPATH: Self = Self::new(c::ERROR_BAD_NETPATH);
|
||||||
|
pub const BAD_NET_NAME: Self = Self::new(c::ERROR_BAD_NET_NAME);
|
||||||
pub const CANT_ACCESS_FILE: Self = Self::new(c::ERROR_CANT_ACCESS_FILE);
|
pub const CANT_ACCESS_FILE: Self = Self::new(c::ERROR_CANT_ACCESS_FILE);
|
||||||
pub const DELETE_PENDING: Self = Self::new(c::ERROR_DELETE_PENDING);
|
pub const DELETE_PENDING: Self = Self::new(c::ERROR_DELETE_PENDING);
|
||||||
pub const DIR_NOT_EMPTY: Self = Self::new(c::ERROR_DIR_NOT_EMPTY);
|
|
||||||
pub const DIRECTORY: Self = Self::new(c::ERROR_DIRECTORY);
|
pub const DIRECTORY: Self = Self::new(c::ERROR_DIRECTORY);
|
||||||
|
pub const DIR_NOT_EMPTY: Self = Self::new(c::ERROR_DIR_NOT_EMPTY);
|
||||||
pub const FILE_NOT_FOUND: Self = Self::new(c::ERROR_FILE_NOT_FOUND);
|
pub const FILE_NOT_FOUND: Self = Self::new(c::ERROR_FILE_NOT_FOUND);
|
||||||
pub const INSUFFICIENT_BUFFER: Self = Self::new(c::ERROR_INSUFFICIENT_BUFFER);
|
pub const INSUFFICIENT_BUFFER: Self = Self::new(c::ERROR_INSUFFICIENT_BUFFER);
|
||||||
pub const INVALID_FUNCTION: Self = Self::new(c::ERROR_INVALID_FUNCTION);
|
pub const INVALID_FUNCTION: Self = Self::new(c::ERROR_INVALID_FUNCTION);
|
||||||
pub const INVALID_HANDLE: Self = Self::new(c::ERROR_INVALID_HANDLE);
|
pub const INVALID_HANDLE: Self = Self::new(c::ERROR_INVALID_HANDLE);
|
||||||
pub const INVALID_PARAMETER: Self = Self::new(c::ERROR_INVALID_PARAMETER);
|
pub const INVALID_PARAMETER: Self = Self::new(c::ERROR_INVALID_PARAMETER);
|
||||||
pub const NO_MORE_FILES: Self = Self::new(c::ERROR_NO_MORE_FILES);
|
|
||||||
pub const NOT_FOUND: Self = Self::new(c::ERROR_NOT_FOUND);
|
pub const NOT_FOUND: Self = Self::new(c::ERROR_NOT_FOUND);
|
||||||
pub const NOT_SUPPORTED: Self = Self::new(c::ERROR_NOT_SUPPORTED);
|
pub const NOT_SUPPORTED: Self = Self::new(c::ERROR_NOT_SUPPORTED);
|
||||||
|
pub const NO_MORE_FILES: Self = Self::new(c::ERROR_NO_MORE_FILES);
|
||||||
pub const OPERATION_ABORTED: Self = Self::new(c::ERROR_OPERATION_ABORTED);
|
pub const OPERATION_ABORTED: Self = Self::new(c::ERROR_OPERATION_ABORTED);
|
||||||
pub const PATH_NOT_FOUND: Self = Self::new(c::ERROR_PATH_NOT_FOUND);
|
pub const PATH_NOT_FOUND: Self = Self::new(c::ERROR_PATH_NOT_FOUND);
|
||||||
pub const SHARING_VIOLATION: Self = Self::new(c::ERROR_SHARING_VIOLATION);
|
pub const SHARING_VIOLATION: Self = Self::new(c::ERROR_SHARING_VIOLATION);
|
||||||
|
|||||||
@@ -57,18 +57,18 @@ fn aarch64_linux() {
|
|||||||
println!("fhm: {}", is_aarch64_feature_detected!("fhm"));
|
println!("fhm: {}", is_aarch64_feature_detected!("fhm"));
|
||||||
println!("flagm2: {}", is_aarch64_feature_detected!("flagm2"));
|
println!("flagm2: {}", is_aarch64_feature_detected!("flagm2"));
|
||||||
println!("flagm: {}", is_aarch64_feature_detected!("flagm"));
|
println!("flagm: {}", is_aarch64_feature_detected!("flagm"));
|
||||||
println!("fp16: {}", is_aarch64_feature_detected!("fp16"));
|
|
||||||
println!("fp8: {}", is_aarch64_feature_detected!("fp8"));
|
println!("fp8: {}", is_aarch64_feature_detected!("fp8"));
|
||||||
println!("fp8dot2: {}", is_aarch64_feature_detected!("fp8dot2"));
|
println!("fp8dot2: {}", is_aarch64_feature_detected!("fp8dot2"));
|
||||||
println!("fp8dot4: {}", is_aarch64_feature_detected!("fp8dot4"));
|
println!("fp8dot4: {}", is_aarch64_feature_detected!("fp8dot4"));
|
||||||
println!("fp8fma: {}", is_aarch64_feature_detected!("fp8fma"));
|
println!("fp8fma: {}", is_aarch64_feature_detected!("fp8fma"));
|
||||||
|
println!("fp16: {}", is_aarch64_feature_detected!("fp16"));
|
||||||
println!("fpmr: {}", is_aarch64_feature_detected!("fpmr"));
|
println!("fpmr: {}", is_aarch64_feature_detected!("fpmr"));
|
||||||
println!("frintts: {}", is_aarch64_feature_detected!("frintts"));
|
println!("frintts: {}", is_aarch64_feature_detected!("frintts"));
|
||||||
println!("hbc: {}", is_aarch64_feature_detected!("hbc"));
|
println!("hbc: {}", is_aarch64_feature_detected!("hbc"));
|
||||||
println!("i8mm: {}", is_aarch64_feature_detected!("i8mm"));
|
println!("i8mm: {}", is_aarch64_feature_detected!("i8mm"));
|
||||||
println!("jsconv: {}", is_aarch64_feature_detected!("jsconv"));
|
println!("jsconv: {}", is_aarch64_feature_detected!("jsconv"));
|
||||||
println!("lse128: {}", is_aarch64_feature_detected!("lse128"));
|
|
||||||
println!("lse2: {}", is_aarch64_feature_detected!("lse2"));
|
println!("lse2: {}", is_aarch64_feature_detected!("lse2"));
|
||||||
|
println!("lse128: {}", is_aarch64_feature_detected!("lse128"));
|
||||||
println!("lse: {}", is_aarch64_feature_detected!("lse"));
|
println!("lse: {}", is_aarch64_feature_detected!("lse"));
|
||||||
println!("lut: {}", is_aarch64_feature_detected!("lut"));
|
println!("lut: {}", is_aarch64_feature_detected!("lut"));
|
||||||
println!("mops: {}", is_aarch64_feature_detected!("mops"));
|
println!("mops: {}", is_aarch64_feature_detected!("mops"));
|
||||||
@@ -87,10 +87,10 @@ fn aarch64_linux() {
|
|||||||
println!("sha3: {}", is_aarch64_feature_detected!("sha3"));
|
println!("sha3: {}", is_aarch64_feature_detected!("sha3"));
|
||||||
println!("sm4: {}", is_aarch64_feature_detected!("sm4"));
|
println!("sm4: {}", is_aarch64_feature_detected!("sm4"));
|
||||||
println!("sme-b16b16: {}", is_aarch64_feature_detected!("sme-b16b16"));
|
println!("sme-b16b16: {}", is_aarch64_feature_detected!("sme-b16b16"));
|
||||||
println!("sme-f16f16: {}", is_aarch64_feature_detected!("sme-f16f16"));
|
|
||||||
println!("sme-f64f64: {}", is_aarch64_feature_detected!("sme-f64f64"));
|
|
||||||
println!("sme-f8f16: {}", is_aarch64_feature_detected!("sme-f8f16"));
|
println!("sme-f8f16: {}", is_aarch64_feature_detected!("sme-f8f16"));
|
||||||
println!("sme-f8f32: {}", is_aarch64_feature_detected!("sme-f8f32"));
|
println!("sme-f8f32: {}", is_aarch64_feature_detected!("sme-f8f32"));
|
||||||
|
println!("sme-f16f16: {}", is_aarch64_feature_detected!("sme-f16f16"));
|
||||||
|
println!("sme-f64f64: {}", is_aarch64_feature_detected!("sme-f64f64"));
|
||||||
println!("sme-fa64: {}", is_aarch64_feature_detected!("sme-fa64"));
|
println!("sme-fa64: {}", is_aarch64_feature_detected!("sme-fa64"));
|
||||||
println!("sme-i16i64: {}", is_aarch64_feature_detected!("sme-i16i64"));
|
println!("sme-i16i64: {}", is_aarch64_feature_detected!("sme-i16i64"));
|
||||||
println!("sme-lutv2: {}", is_aarch64_feature_detected!("sme-lutv2"));
|
println!("sme-lutv2: {}", is_aarch64_feature_detected!("sme-lutv2"));
|
||||||
|
|||||||
@@ -1036,18 +1036,18 @@ impl Step for PlainSourceTarball {
|
|||||||
let src_files = [
|
let src_files = [
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
".gitmodules",
|
".gitmodules",
|
||||||
"bootstrap.example.toml",
|
|
||||||
"Cargo.lock",
|
|
||||||
"Cargo.toml",
|
|
||||||
"configure",
|
|
||||||
"CONTRIBUTING.md",
|
"CONTRIBUTING.md",
|
||||||
"COPYRIGHT",
|
"COPYRIGHT",
|
||||||
|
"Cargo.lock",
|
||||||
|
"Cargo.toml",
|
||||||
"LICENSE-APACHE",
|
"LICENSE-APACHE",
|
||||||
"license-metadata.json",
|
|
||||||
"LICENSE-MIT",
|
"LICENSE-MIT",
|
||||||
"README.md",
|
"README.md",
|
||||||
"RELEASES.md",
|
"RELEASES.md",
|
||||||
"REUSE.toml",
|
"REUSE.toml",
|
||||||
|
"bootstrap.example.toml",
|
||||||
|
"configure",
|
||||||
|
"license-metadata.json",
|
||||||
"x",
|
"x",
|
||||||
"x.ps1",
|
"x.ps1",
|
||||||
"x.py",
|
"x.py",
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
//! If a line ends with an opening delimiter, we effectively join the following line to it before
|
//! If a line ends with an opening delimiter, we effectively join the following line to it before
|
||||||
//! checking it. E.g. `foo(\nbar)` is treated like `foo(bar)`.
|
//! checking it. E.g. `foo(\nbar)` is treated like `foo(bar)`.
|
||||||
|
|
||||||
|
use std::cmp::Ordering;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
use std::iter::Peekable;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::walk::{filter_dirs, walk};
|
use crate::walk::{filter_dirs, walk};
|
||||||
@@ -99,9 +101,9 @@ fn check_section<'a>(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let prev_line_trimmed_lowercase = prev_line.trim_start_matches(' ').to_lowercase();
|
let prev_line_trimmed_lowercase = prev_line.trim_start_matches(' ');
|
||||||
|
|
||||||
if trimmed_line.to_lowercase() < prev_line_trimmed_lowercase {
|
if version_sort(&trimmed_line, &prev_line_trimmed_lowercase).is_lt() {
|
||||||
tidy_error_ext!(err, bad, "{file}:{}: line not in alphabetical order", idx + 1);
|
tidy_error_ext!(err, bad, "{file}:{}: line not in alphabetical order", idx + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,3 +145,56 @@ pub fn check(path: &Path, bad: &mut bool) {
|
|||||||
check_lines(file, lines, &mut crate::tidy_error, bad)
|
check_lines(file, lines, &mut crate::tidy_error, bad)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn consume_numeric_prefix<I: Iterator<Item = char>>(it: &mut Peekable<I>) -> String {
|
||||||
|
let mut result = String::new();
|
||||||
|
|
||||||
|
while let Some(&c) = it.peek() {
|
||||||
|
if !c.is_numeric() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push(c);
|
||||||
|
it.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
// A sorting function that is case-sensitive, and sorts sequences of digits by their numeric value,
|
||||||
|
// so that `9` sorts before `12`.
|
||||||
|
fn version_sort(a: &str, b: &str) -> Ordering {
|
||||||
|
let mut it1 = a.chars().peekable();
|
||||||
|
let mut it2 = b.chars().peekable();
|
||||||
|
|
||||||
|
while let (Some(x), Some(y)) = (it1.peek(), it2.peek()) {
|
||||||
|
match (x.is_numeric(), y.is_numeric()) {
|
||||||
|
(true, true) => {
|
||||||
|
let num1: String = consume_numeric_prefix(it1.by_ref());
|
||||||
|
let num2: String = consume_numeric_prefix(it2.by_ref());
|
||||||
|
|
||||||
|
let int1: u64 = num1.parse().unwrap();
|
||||||
|
let int2: u64 = num2.parse().unwrap();
|
||||||
|
|
||||||
|
// Compare strings when the numeric value is equal to handle "00" versus "0".
|
||||||
|
match int1.cmp(&int2).then_with(|| num1.cmp(&num2)) {
|
||||||
|
Ordering::Equal => continue,
|
||||||
|
different => return different,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(false, false) => match x.cmp(y) {
|
||||||
|
Ordering::Equal => {
|
||||||
|
it1.next();
|
||||||
|
it2.next();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
different => return different,
|
||||||
|
},
|
||||||
|
(false, true) | (true, false) => {
|
||||||
|
return x.cmp(y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
it1.next().cmp(&it2.next())
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use std::str::from_utf8;
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[track_caller]
|
||||||
fn test(lines: &str, name: &str, expected_msg: &str, expected_bad: bool) {
|
fn test(lines: &str, name: &str, expected_msg: &str, expected_bad: bool) {
|
||||||
let mut actual_msg = Vec::new();
|
let mut actual_msg = Vec::new();
|
||||||
let mut actual_bad = false;
|
let mut actual_bad = false;
|
||||||
@@ -15,10 +16,12 @@ fn test(lines: &str, name: &str, expected_msg: &str, expected_bad: bool) {
|
|||||||
assert_eq!(expected_bad, actual_bad);
|
assert_eq!(expected_bad, actual_bad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[track_caller]
|
||||||
fn good(lines: &str) {
|
fn good(lines: &str) {
|
||||||
test(lines, "good", "", false);
|
test(lines, "good", "", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[track_caller]
|
||||||
fn bad(lines: &str, expected_msg: &str) {
|
fn bad(lines: &str, expected_msg: &str) {
|
||||||
test(lines, "bad", expected_msg, true);
|
test(lines, "bad", expected_msg, true);
|
||||||
}
|
}
|
||||||
@@ -187,3 +190,147 @@ fn test_double_end() {
|
|||||||
";
|
";
|
||||||
bad(lines, "bad:5 found `tidy-alphabetical-end` expecting `tidy-alphabetical-start`");
|
bad(lines, "bad:5 found `tidy-alphabetical-end` expecting `tidy-alphabetical-start`");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_numeric_good() {
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
rustc_ast = { path = \"../rustc_ast\" }
|
||||||
|
rustc_ast_lowering = { path = \"../rustc_ast_lowering\" }
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
fp-armv8
|
||||||
|
fp16
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
item1
|
||||||
|
item2
|
||||||
|
item10
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
foo
|
||||||
|
foo_
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
foo-bar
|
||||||
|
foo_bar
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
sme-lutv2
|
||||||
|
sme2
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
v5te
|
||||||
|
v6
|
||||||
|
v6k
|
||||||
|
v6t2
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
zve64d
|
||||||
|
zve64f
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
// Case is significant.
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
_ZYXW
|
||||||
|
_abcd
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
v0
|
||||||
|
v00
|
||||||
|
v000
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
w005s09t
|
||||||
|
w5s009t
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
|
good(
|
||||||
|
"\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
v0s
|
||||||
|
v00t
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_numeric_bad() {
|
||||||
|
let lines = "\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
item1
|
||||||
|
item10
|
||||||
|
item2
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
";
|
||||||
|
bad(lines, "bad:4: line not in alphabetical order");
|
||||||
|
|
||||||
|
let lines = "\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
zve64f
|
||||||
|
zve64d
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
";
|
||||||
|
bad(lines, "bad:3: line not in alphabetical order");
|
||||||
|
|
||||||
|
let lines = "\
|
||||||
|
# tidy-alphabetical-start
|
||||||
|
000
|
||||||
|
00
|
||||||
|
# tidy-alphabetical-end
|
||||||
|
";
|
||||||
|
bad(lines, "bad:3: line not in alphabetical order");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user