From 43bcc71d074a10d9186e27f9bf21b9dafa815bf5 Mon Sep 17 00:00:00 2001 From: kxxt Date: Wed, 21 Sep 2022 20:51:03 +0800 Subject: [PATCH 01/13] refactor: use grep -E/-F instead of fgrep/egrep --- src/etc/cat-and-grep.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/etc/cat-and-grep.sh b/src/etc/cat-and-grep.sh index 77dc52a935070..08de25a77783a 100755 --- a/src/etc/cat-and-grep.sh +++ b/src/etc/cat-and-grep.sh @@ -26,7 +26,7 @@ Options: -i Case insensitive search. ' -GREPPER=fgrep +GREPPER=grep INVERT=0 GREPFLAGS='q' while getopts ':vieh' OPTION; do @@ -39,7 +39,7 @@ while getopts ':vieh' OPTION; do GREPFLAGS="i$GREPFLAGS" ;; e) - GREPPER=egrep + GREPFLAGS="E$GREPFLAGS" ;; h) echo "$USAGE" @@ -51,6 +51,15 @@ while getopts ':vieh' OPTION; do esac done +# an utility function to check if a string contains a substring +stringContain() { [ -z "$1" ] || { [ -z "${2##*$1*}" ] && [ -n "$2" ];};} + +if ! stringContain 'E' "$GREPFLAGS" +then + # use F flag if there is not an E flag + GREPFLAGS="F$GREPFLAGS" +fi + shift $((OPTIND - 1)) # use gnu version of tool if available (for bsd) From 6135aff27cedcf81ff863715685808829364f7cb Mon Sep 17 00:00:00 2001 From: kxxt Date: Mon, 26 Sep 2022 21:56:08 +0800 Subject: [PATCH 02/13] simplify --- src/etc/cat-and-grep.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/etc/cat-and-grep.sh b/src/etc/cat-and-grep.sh index 08de25a77783a..238f7f5b66027 100755 --- a/src/etc/cat-and-grep.sh +++ b/src/etc/cat-and-grep.sh @@ -51,10 +51,7 @@ while getopts ':vieh' OPTION; do esac done -# an utility function to check if a string contains a substring -stringContain() { [ -z "$1" ] || { [ -z "${2##*$1*}" ] && [ -n "$2" ];};} - -if ! stringContain 'E' "$GREPFLAGS" +if ! echo "$GREPFLAGS" | grep -q E then # use F flag if there is not an E flag GREPFLAGS="F$GREPFLAGS" From 4cf30c0022a434718799b66cdf8911ad8030d0e1 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Fri, 7 Oct 2022 15:42:05 +0300 Subject: [PATCH 03/13] Improved documentation for `std::io::Error` --- library/std/src/io/error.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index feb3fb989a7ac..2bbfbe38a24ae 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -481,6 +481,7 @@ impl Error { /// originate from the OS itself. The `error` argument is an arbitrary /// payload which will be contained in this [`Error`]. /// + /// Note that this function allocates memory on the heap. /// If no extra payload is required, use the `From` conversion from /// `ErrorKind`. /// @@ -495,7 +496,7 @@ impl Error { /// // errors can also be created from other errors /// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error); /// - /// // creating an error without payload + /// // creating an error without payload (also without memory allocation) /// let eof_error = Error::from(ErrorKind::UnexpectedEof); /// ``` #[stable(feature = "rust1", since = "1.0.0")] From dbb4271bb495bf3ac290b910a7ce1c48d73ad01c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 14 Oct 2022 08:40:55 +0200 Subject: [PATCH 04/13] checktools: fix comments --- src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh index cf00c285b0a63..3e1f39eaab5a4 100755 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh @@ -4,7 +4,7 @@ set -eu X_PY="$1" -# Try to test all the tools and store the build/test success in the TOOLSTATE_FILE +# Try to test the toolstate-tracked tools and store the build/test success in the TOOLSTATE_FILE. set +e python3 "$X_PY" test --stage 2 --no-fail-fast \ @@ -19,6 +19,8 @@ set -e # debugging: print out the saved toolstates cat /tmp/toolstate/toolstates.json + +# Test remaining tools that must pass. python3 "$X_PY" test --stage 2 check-tools python3 "$X_PY" test --stage 2 src/tools/clippy python3 "$X_PY" test --stage 2 src/tools/rustfmt From b8bb40664cc454c6f09235465a2e4faf66f160cc Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Fri, 14 Oct 2022 12:14:29 +0200 Subject: [PATCH 05/13] remove leading newlines from integer primitive doc examples --- library/core/src/num/int_macros.rs | 9 --------- library/core/src/num/uint_macros.rs | 2 -- 2 files changed, 11 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index ff3b7bc2c9047..b413a85fee340 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -652,7 +652,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(2), Some(1));")] #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);")] @@ -704,7 +703,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_neg(), Some(-5));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_neg(), None);")] /// ``` @@ -820,7 +818,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!((-5", stringify!($SelfT), ").checked_abs(), Some(5));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_abs(), None);")] /// ``` @@ -1026,7 +1023,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(10", stringify!($SelfT), ".saturating_mul(12), 120);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.saturating_mul(10), ", stringify!($SelfT), "::MAX);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($SelfT), "::MIN);")] @@ -1085,7 +1081,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!((-4", stringify!($SelfT), ").saturating_pow(3), -64);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(2), ", stringify!($SelfT), "::MAX);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(3), ", stringify!($SelfT), "::MIN);")] @@ -1498,7 +1493,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($SelfT), "::MIN, true));")] /// ``` @@ -1593,7 +1587,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_sub(2), (3, false));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($SelfT), "::MAX, true));")] /// ``` @@ -1703,7 +1696,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_div(2), (2, false));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_div(-1), (", stringify!($SelfT), "::MIN, true));")] /// ``` @@ -1766,7 +1758,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_rem(2), (1, false));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem(-1), (0, true));")] /// ``` diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index d921ff9ba1026..b177e5e390028 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1456,7 +1456,6 @@ macro_rules! uint_impl { /// Basic usage /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));")] /// ``` @@ -1551,7 +1550,6 @@ macro_rules! uint_impl { /// Basic usage /// /// ``` - /// #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_sub(2), (3, false));")] #[doc = concat!("assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT), "::MAX, true));")] /// ``` From 0313fbe5a942ed82b8216bab169a035bc4b639db Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 14 Oct 2022 12:43:42 +0200 Subject: [PATCH 06/13] Update browser-ui-test version to fix some flaky tests --- .../docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version index d61567cd134a3..7fd0b1e8e6ff6 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version @@ -1 +1 @@ -0.12.3 \ No newline at end of file +0.12.4 \ No newline at end of file From f95e8532222479c417fdf9fffc6ce1ab8cda3413 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 14 Oct 2022 12:17:07 +0100 Subject: [PATCH 07/13] Tweak grammar --- library/std/src/io/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index 2bbfbe38a24ae..837145bfaede6 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -496,7 +496,7 @@ impl Error { /// // errors can also be created from other errors /// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error); /// - /// // creating an error without payload (also without memory allocation) + /// // creating an error without payload (and without memory allocation) /// let eof_error = Error::from(ErrorKind::UnexpectedEof); /// ``` #[stable(feature = "rust1", since = "1.0.0")] From 9787321841d604b792be107e91bcca8ee1ecfd52 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 14 Oct 2022 14:55:11 +0200 Subject: [PATCH 08/13] Clean up rust-logo rustdoc GUI test --- src/test/rustdoc-gui/rust-logo.goml | 96 ++++++++--------------------- 1 file changed, 26 insertions(+), 70 deletions(-) diff --git a/src/test/rustdoc-gui/rust-logo.goml b/src/test/rustdoc-gui/rust-logo.goml index 80abdc50c14ff..6c8dc85941931 100644 --- a/src/test/rustdoc-gui/rust-logo.goml +++ b/src/test/rustdoc-gui/rust-logo.goml @@ -1,78 +1,34 @@ // This test ensures that the correct style is applied to the rust logo in the sidebar. goto: "file://" + |DOC_PATH| + "/test_docs/index.html" -// First we start with the dark theme. -local-storage: { - "rustdoc-theme": "dark", - "rustdoc-preferred-dark-theme": "dark", - "rustdoc-use-system-theme": "false", -} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, +define-function: ( + "check-logo", + (theme, filter), + [ + // Going to the doc page. + ("goto", "file://" + |DOC_PATH| + "/test_docs/index.html"), + // Changing theme. + ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), + ("reload"), + ("assert-css", (".rust-logo", {"filter": |filter|})), + // Going to the source code page. + ("goto", "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"), + // Changing theme (since it's local files, the local storage works by folder). + ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), + ("reload"), + ("assert-css", (".rust-logo", {"filter": |filter|})), + ], ) -// In the source view page now. -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" - -local-storage: { - "rustdoc-theme": "dark", - "rustdoc-preferred-dark-theme": "dark", - "rustdoc-use-system-theme": "false", -} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, +call-function: ( + "check-logo", + ("ayu", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"), ) - -// Then with the ayu theme. -local-storage: { - "rustdoc-theme": "ayu", - "rustdoc-preferred-dark-theme": "ayu", - "rustdoc-use-system-theme": "false", -} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, +call-function: ( + "check-logo", + ("dark", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"), ) - -// In the source view page now. -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" - -local-storage: { - "rustdoc-theme": "ayu", - "rustdoc-preferred-dark-theme": "ayu", - "rustdoc-use-system-theme": "false", -} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, -) - -// And finally with the light theme. -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "none"}, -) - -// In the source view page now. -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" - -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} -reload: - -assert-css: ( - ".rust-logo", - {"filter": "none"}, +call-function: ( + "check-logo", + ("light", "none"), ) From c9948f5c5f5cc49a74f04e33a1b0cf6ed6a22b93 Mon Sep 17 00:00:00 2001 From: beetrees Date: Fri, 14 Oct 2022 15:51:20 +0100 Subject: [PATCH 09/13] Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)` --- library/core/src/time.rs | 2 +- library/core/tests/lib.rs | 1 + library/core/tests/time.rs | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/library/core/src/time.rs b/library/core/src/time.rs index 1d0c51c3c8368..7cbb477d7a346 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -1279,7 +1279,7 @@ macro_rules! try_from_secs { const MANT_MASK: $bits_ty = (1 << $mant_bits) - 1; const EXP_MASK: $bits_ty = (1 << $exp_bits) - 1; - if $secs.is_sign_negative() { + if $secs < 0.0 { return Err(FromFloatSecsError { kind: FromFloatSecsErrorKind::Negative }); } diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index ca0c7a54b3e24..525a495903d53 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -101,6 +101,7 @@ #![feature(provide_any)] #![feature(utf8_chunks)] #![feature(is_ascii_octdigit)] +#![feature(duration_checked_float)] #![deny(unsafe_op_in_unsafe_fn)] extern crate test; diff --git a/library/core/tests/time.rs b/library/core/tests/time.rs index 697bf33a8b0da..a05128de471ab 100644 --- a/library/core/tests/time.rs +++ b/library/core/tests/time.rs @@ -467,3 +467,11 @@ fn duration_const() { const SATURATING_MUL: Duration = MAX.saturating_mul(2); assert_eq!(SATURATING_MUL, MAX); } + +#[test] +fn from_neg_zero() { + assert_eq!(Duration::try_from_secs_f32(-0.0), Ok(Duration::ZERO)); + assert_eq!(Duration::try_from_secs_f64(-0.0), Ok(Duration::ZERO)); + assert_eq!(Duration::from_secs_f32(-0.0), Duration::ZERO); + assert_eq!(Duration::from_secs_f64(-0.0), Duration::ZERO); +} From c46185bea01190e54ffc672d5b2b13c8df5d8068 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Thu, 13 Oct 2022 18:58:25 +0200 Subject: [PATCH 10/13] Bugfix: keep TLS data in sync --- library/std/src/sys/sgx/abi/tls/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/sys/sgx/abi/tls/mod.rs b/library/std/src/sys/sgx/abi/tls/mod.rs index 13d96e9a633d3..09c4ab3d3e901 100644 --- a/library/std/src/sys/sgx/abi/tls/mod.rs +++ b/library/std/src/sys/sgx/abi/tls/mod.rs @@ -111,6 +111,7 @@ impl Tls { rtabort!("TLS limit exceeded") }; TLS_DESTRUCTOR[index].store(dtor.map_or(0, |f| f as usize), Ordering::Relaxed); + unsafe { Self::current() }.data[index].set(ptr::null_mut()); Key::from_index(index) } From 3c0062641d02940a66bc74b182aa924d141060c1 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 14 Oct 2022 21:18:03 +0200 Subject: [PATCH 11/13] Add some tidy-alphabetical --- library/std/src/io/error.rs | 3 ++- src/librustdoc/clean/types.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index feb3fb989a7ac..1629c6a27906e 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -387,7 +387,7 @@ pub enum ErrorKind { impl ErrorKind { pub(crate) fn as_str(&self) -> &'static str { use ErrorKind::*; - // Strictly alphabetical, please. (Sadly rustfmt cannot do this yet.) + // tidy-alphabetical-start match *self { AddrInUse => "address in use", AddrNotAvailable => "address not available", @@ -431,6 +431,7 @@ impl ErrorKind { WouldBlock => "operation would block", WriteZero => "write zero", } + // tidy-alphabetical-end } } diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 7e0533800694e..4c130b2ffec75 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -2540,7 +2540,7 @@ impl SubstParam { mod size_asserts { use super::*; use rustc_data_structures::static_assert_size; - // These are in alphabetical order, which is easy to maintain. + // tidy-alphabetical-start static_assert_size!(Crate, 72); // frequently moved by-value static_assert_size!(DocFragment, 32); static_assert_size!(GenericArg, 48); @@ -2550,4 +2550,5 @@ mod size_asserts { static_assert_size!(ItemKind, 88); static_assert_size!(PathSegment, 40); static_assert_size!(Type, 48); + // tidy-alphabetical-end } From 1b8012fa1019dce7ecc66980a6bd810325b9c2da Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 14 Oct 2022 22:00:44 +0200 Subject: [PATCH 12/13] Also run alphabetical check in src and library --- src/tools/tidy/src/alphabetical.rs | 10 ++++------ src/tools/tidy/src/main.rs | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tools/tidy/src/alphabetical.rs b/src/tools/tidy/src/alphabetical.rs index c9f1dfb707f3f..f913f6cde3889 100644 --- a/src/tools/tidy/src/alphabetical.rs +++ b/src/tools/tidy/src/alphabetical.rs @@ -29,7 +29,8 @@ fn is_close_bracket(c: char) -> bool { matches!(c, ')' | ']' | '}') } -const START_COMMENT: &str = "// tidy-alphabetical-start"; +// Don't let tidy check this here :D +const START_COMMENT: &str = concat!("// tidy-alphabetical", "-start"); const END_COMMENT: &str = "// tidy-alphabetical-end"; fn check_section<'a>( @@ -47,7 +48,7 @@ fn check_section<'a>( if line.contains(START_COMMENT) { tidy_error!( bad, - "{file}:{} found `// tidy-alphabetical-start` expecting `// tidy-alphabetical-end`", + "{file}:{} found `{START_COMMENT}` expecting `{END_COMMENT}`", line_idx ) } @@ -102,10 +103,7 @@ pub fn check(path: &Path, bad: &mut bool) { if line.contains(START_COMMENT) { check_section(file, &mut lines, bad); if lines.peek().is_none() { - tidy_error!( - bad, - "{file}: reached end of file expecting `// tidy-alphabetical-end`" - ) + tidy_error!(bad, "{file}: reached end of file expecting `{END_COMMENT}`") } } } diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 8fe361c45a263..ca785042aaa6a 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -90,7 +90,9 @@ fn main() { check!(edition, &compiler_path); check!(edition, &library_path); + check!(alphabetical, &src_path); check!(alphabetical, &compiler_path); + check!(alphabetical, &library_path); let collected = { while handles.len() >= concurrency.get() { From b00cb04037a4ace1e34887ca35568e6f0c1e807d Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 14 Oct 2022 22:01:18 +0200 Subject: [PATCH 13/13] Sort target features alphabetically --- .../rustc_codegen_ssa/src/target_features.rs | 208 ++++++++++-------- library/std/tests/run-time-detect.rs | 86 ++++---- 2 files changed, 160 insertions(+), 134 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index 0e259bcd1a48d..83407ee8f9d32 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -13,17 +13,25 @@ pub const RUSTC_SPECIFIC_FEATURES: &[&str] = &["crt-static"]; // if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted const ARM_ALLOWED_FEATURES: &[(&str, Option)] = &[ + // tidy-alphabetical-start ("aclass", Some(sym::arm_target_feature)), - ("mclass", Some(sym::arm_target_feature)), - ("rclass", Some(sym::arm_target_feature)), - ("dsp", Some(sym::arm_target_feature)), - ("neon", Some(sym::arm_target_feature)), + ("aes", Some(sym::arm_target_feature)), ("crc", Some(sym::arm_target_feature)), ("crypto", Some(sym::arm_target_feature)), - ("aes", Some(sym::arm_target_feature)), - ("sha2", Some(sym::arm_target_feature)), - ("i8mm", Some(sym::arm_target_feature)), + ("d32", Some(sym::arm_target_feature)), ("dotprod", Some(sym::arm_target_feature)), + ("dsp", Some(sym::arm_target_feature)), + ("fp-armv8", Some(sym::arm_target_feature)), + ("i8mm", Some(sym::arm_target_feature)), + ("mclass", Some(sym::arm_target_feature)), + ("neon", Some(sym::arm_target_feature)), + ("rclass", Some(sym::arm_target_feature)), + ("sha2", Some(sym::arm_target_feature)), + // This is needed for inline assembly, but shouldn't be stabilized as-is + // since it should be enabled per-function using #[instruction_set], not + // #[target_feature]. + ("thumb-mode", Some(sym::arm_target_feature)), + ("thumb2", Some(sym::arm_target_feature)), ("v5te", Some(sym::arm_target_feature)), ("v6", Some(sym::arm_target_feature)), ("v6k", Some(sym::arm_target_feature)), @@ -33,104 +41,97 @@ const ARM_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("vfp2", Some(sym::arm_target_feature)), ("vfp3", Some(sym::arm_target_feature)), ("vfp4", Some(sym::arm_target_feature)), - ("fp-armv8", Some(sym::arm_target_feature)), - // This is needed for inline assembly, but shouldn't be stabilized as-is - // since it should be enabled per-function using #[instruction_set], not - // #[target_feature]. - ("thumb-mode", Some(sym::arm_target_feature)), - ("thumb2", Some(sym::arm_target_feature)), - ("d32", Some(sym::arm_target_feature)), + // tidy-alphabetical-end ]; const AARCH64_ALLOWED_FEATURES: &[(&str, Option)] = &[ - // FEAT_AdvSimd & FEAT_FP - ("neon", None), - // FEAT_FP16 - ("fp16", None), - // FEAT_SVE - ("sve", None), + // tidy-alphabetical-start + // FEAT_AES + ("aes", None), + // FEAT_BF16 + ("bf16", None), + // FEAT_BTI + ("bti", None), // FEAT_CRC ("crc", None), - // FEAT_RAS - ("ras", None), - // FEAT_LSE - ("lse", None), - // FEAT_RDM - ("rdm", None), - // FEAT_RCPC - ("rcpc", None), - // FEAT_RCPC2 - ("rcpc2", None), - // FEAT_DotProd - ("dotprod", None), - // FEAT_TME - ("tme", None), - // FEAT_FHM - ("fhm", None), // FEAT_DIT ("dit", None), - // FEAT_FLAGM - ("flagm", None), - // FEAT_SSBS - ("ssbs", None), - // FEAT_SB - ("sb", None), - // FEAT_PAUTH (address authentication) - ("paca", None), - // FEAT_PAUTH (generic authentication) - ("pacg", None), + // FEAT_DotProd + ("dotprod", None), // FEAT_DPB ("dpb", None), // FEAT_DPB2 ("dpb2", None), - // FEAT_SVE2 - ("sve2", None), - // FEAT_SVE2_AES - ("sve2-aes", None), - // FEAT_SVE2_SM4 - ("sve2-sm4", None), - // FEAT_SVE2_SHA3 - ("sve2-sha3", None), - // FEAT_SVE2_BitPerm - ("sve2-bitperm", None), - // FEAT_FRINTTS - ("frintts", None), - // FEAT_I8MM - ("i8mm", None), // FEAT_F32MM ("f32mm", None), // FEAT_F64MM ("f64mm", None), - // FEAT_BF16 - ("bf16", None), - // FEAT_RAND - ("rand", None), - // FEAT_BTI - ("bti", None), - // FEAT_MTE - ("mte", None), - // FEAT_JSCVT - ("jsconv", None), // FEAT_FCMA ("fcma", None), - // FEAT_AES - ("aes", None), + // FEAT_FHM + ("fhm", None), + // FEAT_FLAGM + ("flagm", None), + // FEAT_FP16 + ("fp16", None), + // FEAT_FRINTTS + ("frintts", None), + // FEAT_I8MM + ("i8mm", None), + // FEAT_JSCVT + ("jsconv", None), + // FEAT_LOR + ("lor", None), + // FEAT_LSE + ("lse", None), + // FEAT_MTE + ("mte", None), + // FEAT_AdvSimd & FEAT_FP + ("neon", None), + // FEAT_PAUTH (address authentication) + ("paca", None), + // FEAT_PAUTH (generic authentication) + ("pacg", None), + // FEAT_PAN + ("pan", None), + // FEAT_PMUv3 + ("pmuv3", None), + // FEAT_RAND + ("rand", None), + // FEAT_RAS + ("ras", None), + // FEAT_RCPC + ("rcpc", None), + // FEAT_RCPC2 + ("rcpc2", None), + // FEAT_RDM + ("rdm", None), + // FEAT_SB + ("sb", None), // FEAT_SHA1 & FEAT_SHA256 ("sha2", None), // FEAT_SHA512 & FEAT_SHA3 ("sha3", None), // FEAT_SM3 & FEAT_SM4 ("sm4", None), - // FEAT_PAN - ("pan", None), - // FEAT_LOR - ("lor", None), - // FEAT_VHE - ("vh", None), - // FEAT_PMUv3 - ("pmuv3", None), // FEAT_SPE ("spe", None), + // FEAT_SSBS + ("ssbs", None), + // FEAT_SVE + ("sve", None), + // FEAT_SVE2 + ("sve2", None), + // FEAT_SVE2_AES + ("sve2-aes", None), + // FEAT_SVE2_BitPerm + ("sve2-bitperm", None), + // FEAT_SVE2_SHA3 + ("sve2-sha3", None), + // FEAT_SVE2_SM4 + ("sve2-sm4", None), + // FEAT_TME + ("tme", None), ("v8.1a", Some(sym::aarch64_ver_target_feature)), ("v8.2a", Some(sym::aarch64_ver_target_feature)), ("v8.3a", Some(sym::aarch64_ver_target_feature)), @@ -138,6 +139,9 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("v8.5a", Some(sym::aarch64_ver_target_feature)), ("v8.6a", Some(sym::aarch64_ver_target_feature)), ("v8.7a", Some(sym::aarch64_ver_target_feature)), + // FEAT_VHE + ("vh", None), + // tidy-alphabetical-end ]; const AARCH64_TIED_FEATURES: &[&[&str]] = &[ @@ -145,6 +149,7 @@ const AARCH64_TIED_FEATURES: &[&[&str]] = &[ ]; const X86_ALLOWED_FEATURES: &[(&str, Option)] = &[ + // tidy-alphabetical-start ("adx", None), ("aes", None), ("avx", None), @@ -194,69 +199,80 @@ const X86_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("xsavec", None), ("xsaveopt", None), ("xsaves", None), + // tidy-alphabetical-end ]; const HEXAGON_ALLOWED_FEATURES: &[(&str, Option)] = &[ + // tidy-alphabetical-start ("hvx", Some(sym::hexagon_target_feature)), ("hvx-length128b", Some(sym::hexagon_target_feature)), + // tidy-alphabetical-end ]; const POWERPC_ALLOWED_FEATURES: &[(&str, Option)] = &[ + // tidy-alphabetical-start ("altivec", Some(sym::powerpc_target_feature)), ("power8-altivec", Some(sym::powerpc_target_feature)), - ("power9-altivec", Some(sym::powerpc_target_feature)), ("power8-vector", Some(sym::powerpc_target_feature)), + ("power9-altivec", Some(sym::powerpc_target_feature)), ("power9-vector", Some(sym::powerpc_target_feature)), ("vsx", Some(sym::powerpc_target_feature)), + // tidy-alphabetical-end ]; const MIPS_ALLOWED_FEATURES: &[(&str, Option)] = &[ + // tidy-alphabetical-start ("fp64", Some(sym::mips_target_feature)), ("msa", Some(sym::mips_target_feature)), ("virt", Some(sym::mips_target_feature)), + // tidy-alphabetical-end ]; const RISCV_ALLOWED_FEATURES: &[(&str, Option)] = &[ - ("m", Some(sym::riscv_target_feature)), + // tidy-alphabetical-start ("a", Some(sym::riscv_target_feature)), ("c", Some(sym::riscv_target_feature)), - ("f", Some(sym::riscv_target_feature)), ("d", Some(sym::riscv_target_feature)), ("e", Some(sym::riscv_target_feature)), + ("f", Some(sym::riscv_target_feature)), + ("m", Some(sym::riscv_target_feature)), ("v", Some(sym::riscv_target_feature)), - ("zfinx", Some(sym::riscv_target_feature)), - ("zdinx", Some(sym::riscv_target_feature)), - ("zhinx", Some(sym::riscv_target_feature)), - ("zhinxmin", Some(sym::riscv_target_feature)), - ("zfh", Some(sym::riscv_target_feature)), - ("zfhmin", Some(sym::riscv_target_feature)), ("zba", Some(sym::riscv_target_feature)), ("zbb", Some(sym::riscv_target_feature)), ("zbc", Some(sym::riscv_target_feature)), - ("zbs", Some(sym::riscv_target_feature)), ("zbkb", Some(sym::riscv_target_feature)), ("zbkc", Some(sym::riscv_target_feature)), ("zbkx", Some(sym::riscv_target_feature)), + ("zbs", Some(sym::riscv_target_feature)), + ("zdinx", Some(sym::riscv_target_feature)), + ("zfh", Some(sym::riscv_target_feature)), + ("zfhmin", Some(sym::riscv_target_feature)), + ("zfinx", Some(sym::riscv_target_feature)), + ("zhinx", Some(sym::riscv_target_feature)), + ("zhinxmin", Some(sym::riscv_target_feature)), + ("zk", Some(sym::riscv_target_feature)), + ("zkn", Some(sym::riscv_target_feature)), ("zknd", Some(sym::riscv_target_feature)), ("zkne", Some(sym::riscv_target_feature)), ("zknh", Some(sym::riscv_target_feature)), - ("zksed", Some(sym::riscv_target_feature)), - ("zksh", Some(sym::riscv_target_feature)), ("zkr", Some(sym::riscv_target_feature)), - ("zkn", Some(sym::riscv_target_feature)), ("zks", Some(sym::riscv_target_feature)), - ("zk", Some(sym::riscv_target_feature)), + ("zksed", Some(sym::riscv_target_feature)), + ("zksh", Some(sym::riscv_target_feature)), ("zkt", Some(sym::riscv_target_feature)), + // tidy-alphabetical-end ]; const WASM_ALLOWED_FEATURES: &[(&str, Option)] = &[ - ("simd128", None), + // tidy-alphabetical-start ("atomics", Some(sym::wasm_target_feature)), - ("nontrapping-fptoint", Some(sym::wasm_target_feature)), ("bulk-memory", Some(sym::wasm_target_feature)), ("mutable-globals", Some(sym::wasm_target_feature)), + ("nontrapping-fptoint", Some(sym::wasm_target_feature)), ("reference-types", Some(sym::wasm_target_feature)), ("sign-ext", Some(sym::wasm_target_feature)), + ("simd128", None), + // tidy-alphabetical-end ]; const BPF_ALLOWED_FEATURES: &[(&str, Option)] = &[("alu32", Some(sym::bpf_target_feature))]; diff --git a/library/std/tests/run-time-detect.rs b/library/std/tests/run-time-detect.rs index a57a52d9bb04e..02c076f1bb5f9 100644 --- a/library/std/tests/run-time-detect.rs +++ b/library/std/tests/run-time-detect.rs @@ -14,77 +14,85 @@ #[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))] fn arm_linux() { use std::arch::is_arm_feature_detected; + // tidy-alphabetical-start + println!("aes: {}", is_arm_feature_detected!("aes")); + println!("crc: {}", is_arm_feature_detected!("crc")); + println!("crypto: {}", is_arm_feature_detected!("crypto")); println!("neon: {}", is_arm_feature_detected!("neon")); println!("pmull: {}", is_arm_feature_detected!("pmull")); - println!("crypto: {}", is_arm_feature_detected!("crypto")); - println!("crc: {}", is_arm_feature_detected!("crc")); - println!("aes: {}", is_arm_feature_detected!("aes")); println!("sha2: {}", is_arm_feature_detected!("sha2")); + // tidy-alphabetical-end } #[test] #[cfg(all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")))] fn aarch64_linux() { use std::arch::is_aarch64_feature_detected; - println!("neon: {}", is_aarch64_feature_detected!("neon")); + // tidy-alphabetical-start + println!("aes: {}", is_aarch64_feature_detected!("aes")); println!("asimd: {}", is_aarch64_feature_detected!("asimd")); - println!("pmull: {}", is_aarch64_feature_detected!("pmull")); - println!("fp16: {}", is_aarch64_feature_detected!("fp16")); - println!("sve: {}", is_aarch64_feature_detected!("sve")); + println!("bf16: {}", is_aarch64_feature_detected!("bf16")); + println!("bti: {}", is_aarch64_feature_detected!("bti")); println!("crc: {}", is_aarch64_feature_detected!("crc")); - println!("lse: {}", is_aarch64_feature_detected!("lse")); - println!("lse2: {}", is_aarch64_feature_detected!("lse2")); - println!("rdm: {}", is_aarch64_feature_detected!("rdm")); - println!("rcpc: {}", is_aarch64_feature_detected!("rcpc")); - println!("rcpc2: {}", is_aarch64_feature_detected!("rcpc2")); + println!("dit: {}", is_aarch64_feature_detected!("dit")); println!("dotprod: {}", is_aarch64_feature_detected!("dotprod")); - println!("tme: {}", is_aarch64_feature_detected!("tme")); + println!("dpb2: {}", is_aarch64_feature_detected!("dpb2")); + println!("dpb: {}", is_aarch64_feature_detected!("dpb")); + println!("f32mm: {}", is_aarch64_feature_detected!("f32mm")); + println!("f64mm: {}", is_aarch64_feature_detected!("f64mm")); + println!("fcma: {}", is_aarch64_feature_detected!("fcma")); println!("fhm: {}", is_aarch64_feature_detected!("fhm")); - println!("dit: {}", is_aarch64_feature_detected!("dit")); println!("flagm: {}", is_aarch64_feature_detected!("flagm")); - println!("ssbs: {}", is_aarch64_feature_detected!("ssbs")); - println!("sb: {}", is_aarch64_feature_detected!("sb")); - println!("paca: {}", is_aarch64_feature_detected!("paca")); - println!("pacg: {}", is_aarch64_feature_detected!("pacg")); - println!("dpb: {}", is_aarch64_feature_detected!("dpb")); - println!("dpb2: {}", is_aarch64_feature_detected!("dpb2")); - println!("sve2: {}", is_aarch64_feature_detected!("sve2")); - println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes")); - println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4")); - println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3")); - println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm")); + println!("fp16: {}", is_aarch64_feature_detected!("fp16")); println!("frintts: {}", is_aarch64_feature_detected!("frintts")); println!("i8mm: {}", is_aarch64_feature_detected!("i8mm")); - println!("f32mm: {}", is_aarch64_feature_detected!("f32mm")); - println!("f64mm: {}", is_aarch64_feature_detected!("f64mm")); - println!("bf16: {}", is_aarch64_feature_detected!("bf16")); - println!("rand: {}", is_aarch64_feature_detected!("rand")); - println!("bti: {}", is_aarch64_feature_detected!("bti")); - println!("mte: {}", is_aarch64_feature_detected!("mte")); println!("jsconv: {}", is_aarch64_feature_detected!("jsconv")); - println!("fcma: {}", is_aarch64_feature_detected!("fcma")); - println!("aes: {}", is_aarch64_feature_detected!("aes")); + println!("lse2: {}", is_aarch64_feature_detected!("lse2")); + println!("lse: {}", is_aarch64_feature_detected!("lse")); + println!("mte: {}", is_aarch64_feature_detected!("mte")); + println!("neon: {}", is_aarch64_feature_detected!("neon")); + println!("paca: {}", is_aarch64_feature_detected!("paca")); + println!("pacg: {}", is_aarch64_feature_detected!("pacg")); + println!("pmull: {}", is_aarch64_feature_detected!("pmull")); + println!("rand: {}", is_aarch64_feature_detected!("rand")); + println!("rcpc2: {}", is_aarch64_feature_detected!("rcpc2")); + println!("rcpc: {}", is_aarch64_feature_detected!("rcpc")); + println!("rdm: {}", is_aarch64_feature_detected!("rdm")); + println!("sb: {}", is_aarch64_feature_detected!("sb")); println!("sha2: {}", is_aarch64_feature_detected!("sha2")); println!("sha3: {}", is_aarch64_feature_detected!("sha3")); println!("sm4: {}", is_aarch64_feature_detected!("sm4")); + println!("ssbs: {}", is_aarch64_feature_detected!("ssbs")); + println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes")); + println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm")); + println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3")); + println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4")); + println!("sve2: {}", is_aarch64_feature_detected!("sve2")); + println!("sve: {}", is_aarch64_feature_detected!("sve")); + println!("tme: {}", is_aarch64_feature_detected!("tme")); + // tidy-alphabetical-end } #[test] #[cfg(all(target_arch = "powerpc", target_os = "linux"))] fn powerpc_linux() { use std::arch::is_powerpc_feature_detected; + // tidy-alphabetical-start println!("altivec: {}", is_powerpc_feature_detected!("altivec")); - println!("vsx: {}", is_powerpc_feature_detected!("vsx")); println!("power8: {}", is_powerpc_feature_detected!("power8")); + println!("vsx: {}", is_powerpc_feature_detected!("vsx")); + // tidy-alphabetical-end } #[test] #[cfg(all(target_arch = "powerpc64", target_os = "linux"))] fn powerpc64_linux() { use std::arch::is_powerpc64_feature_detected; + // tidy-alphabetical-start println!("altivec: {}", is_powerpc64_feature_detected!("altivec")); - println!("vsx: {}", is_powerpc64_feature_detected!("vsx")); println!("power8: {}", is_powerpc64_feature_detected!("power8")); + println!("vsx: {}", is_powerpc64_feature_detected!("vsx")); + // tidy-alphabetical-end } #[test] @@ -102,9 +110,9 @@ fn x86_all() { // the below is in alphabetical order and matches // the order of X86_ALLOWED_FEATURES in rustc_codegen_ssa's target_features.rs + // tidy-alphabetical-start println!("adx: {:?}", is_x86_feature_detected!("adx")); println!("aes: {:?}", is_x86_feature_detected!("aes")); - println!("avx: {:?}", is_x86_feature_detected!("avx")); println!("avx2: {:?}", is_x86_feature_detected!("avx2")); println!("avx512bf16: {:?}", is_x86_feature_detected!("avx512bf16")); println!("avx512bitalg: {:?}", is_x86_feature_detected!("avx512bitalg")); @@ -117,13 +125,14 @@ fn x86_all() { println!("avx512ifma: {:?}", is_x86_feature_detected!("avx512ifma")); println!("avx512pf: {:?}", is_x86_feature_detected!("avx512pf")); println!("avx512vaes: {:?}", is_x86_feature_detected!("avx512vaes")); - println!("avx512vbmi: {:?}", is_x86_feature_detected!("avx512vbmi")); println!("avx512vbmi2: {:?}", is_x86_feature_detected!("avx512vbmi2")); + println!("avx512vbmi: {:?}", is_x86_feature_detected!("avx512vbmi")); println!("avx512vl: {:?}", is_x86_feature_detected!("avx512vl")); println!("avx512vnni: {:?}", is_x86_feature_detected!("avx512vnni")); println!("avx512vp2intersect: {:?}", is_x86_feature_detected!("avx512vp2intersect")); println!("avx512vpclmulqdq: {:?}", is_x86_feature_detected!("avx512vpclmulqdq")); println!("avx512vpopcntdq: {:?}", is_x86_feature_detected!("avx512vpopcntdq")); + println!("avx: {:?}", is_x86_feature_detected!("avx")); println!("bmi1: {:?}", is_x86_feature_detected!("bmi1")); println!("bmi2: {:?}", is_x86_feature_detected!("bmi2")); println!("cmpxchg16b: {:?}", is_x86_feature_detected!("cmpxchg16b")); @@ -138,16 +147,17 @@ fn x86_all() { println!("rdseed: {:?}", is_x86_feature_detected!("rdseed")); println!("rtm: {:?}", is_x86_feature_detected!("rtm")); println!("sha: {:?}", is_x86_feature_detected!("sha")); - println!("sse: {:?}", is_x86_feature_detected!("sse")); println!("sse2: {:?}", is_x86_feature_detected!("sse2")); println!("sse3: {:?}", is_x86_feature_detected!("sse3")); println!("sse4.1: {:?}", is_x86_feature_detected!("sse4.1")); println!("sse4.2: {:?}", is_x86_feature_detected!("sse4.2")); println!("sse4a: {:?}", is_x86_feature_detected!("sse4a")); + println!("sse: {:?}", is_x86_feature_detected!("sse")); println!("ssse3: {:?}", is_x86_feature_detected!("ssse3")); println!("tbm: {:?}", is_x86_feature_detected!("tbm")); println!("xsave: {:?}", is_x86_feature_detected!("xsave")); println!("xsavec: {:?}", is_x86_feature_detected!("xsavec")); println!("xsaveopt: {:?}", is_x86_feature_detected!("xsaveopt")); println!("xsaves: {:?}", is_x86_feature_detected!("xsaves")); + // tidy-alphabetical-end }