From 3bb40f2ea00ceac3e91986a01ef5b2ecc8070f29 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Tue, 19 Oct 2021 20:40:09 -0700 Subject: [PATCH 1/6] Make printed message match the code comment I think this code is getting L0, not L1 cache size, if I'm reading the Intel manual right. (I might not be.) Either way, the code comment and the printed message should match, whichever way is right. :) --- src/doc/unstable-book/src/library-features/asm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md index 5a2cef24870be..e70933b7bae10 100644 --- a/src/doc/unstable-book/src/library-features/asm.md +++ b/src/doc/unstable-book/src/library-features/asm.md @@ -257,7 +257,7 @@ unsafe { } println!( - "L1 Cache: {}", + "L0 Cache: {}", ((ebx >> 22) + 1) * (((ebx >> 12) & 0x3ff) + 1) * ((ebx & 0xfff) + 1) * (ecx + 1) ); ``` From 01e441f8e51a8276ccbc3bda6ac616eac13d01b4 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Wed, 27 Oct 2021 22:18:51 +0200 Subject: [PATCH 2/6] Document clippy on nightly-rustc --- src/bootstrap/builder.rs | 1 + src/bootstrap/doc.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index d5656f0f37e03..6ba1b1b6036ea 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -482,6 +482,7 @@ impl<'a> Builder<'a> { doc::RustByExample, doc::RustcBook, doc::CargoBook, + doc::Clippy, doc::EmbeddedBook, doc::EditionGuide, ), diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 6f2470b706a64..2804e7119fbc1 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -755,6 +755,7 @@ tool_doc!( "src/tools/rustfmt", ["rustfmt-nightly", "rustfmt-config_proc_macro"], ); +tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"]); #[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct ErrorIndex { From 597f889e45e3a76b1f5fc22f30ab499490e91862 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 1 Nov 2021 15:34:19 +0100 Subject: [PATCH 3/6] Clarify what to do with accepted feature gates The documentation only referenced `removed.rs`, but feature gates for accepted features move to `accepted.rs`. --- compiler/rustc_feature/src/active.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 2bbfb561ba594..7cf53d40ff693 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -103,7 +103,8 @@ impl Feature { // If you change this, please modify `src/doc/unstable-book` as well. // -// Don't ever remove anything from this list; move them to `removed.rs`. +// Don't ever remove anything from this list; move them to `accepted.rs` if +// accepted or `removed.rs` if removed. // // The version numbers here correspond to the version in which the current status // was set. This is most important for knowing when a particular feature became From 37476287bf099a8f8a21342fb5f371379b523cef Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Mon, 1 Nov 2021 17:03:07 +0100 Subject: [PATCH 4/6] Use apple-a14 as target CPU for aarch64-apple-darwin. After updating the minimum required LLVM version to 12 we can use apple-a14 as that is closer in features to the Apple M1 than the A12. Once the minimum required LLVM version is updated to 13 we can use apple-m1. --- compiler/rustc_target/src/spec/aarch64_apple_darwin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/aarch64_apple_darwin.rs b/compiler/rustc_target/src/spec/aarch64_apple_darwin.rs index 2c71fb8afeede..ca3550e9278d1 100644 --- a/compiler/rustc_target/src/spec/aarch64_apple_darwin.rs +++ b/compiler/rustc_target/src/spec/aarch64_apple_darwin.rs @@ -2,7 +2,7 @@ use crate::spec::{FramePointer, LinkerFlavor, SanitizerSet, Target, TargetOption pub fn target() -> Target { let mut base = super::apple_base::opts("macos"); - base.cpu = "apple-a12".to_string(); + base.cpu = "apple-a14".to_string(); base.max_atomic_width = Some(128); // FIXME: The leak sanitizer currently fails the tests, see #88132. From fd41336c4cb848225bd11cd2e4242b3099763493 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Tue, 2 Nov 2021 14:19:31 +0100 Subject: [PATCH 5/6] Update clippy dependencies * semver = "0.11" -> "1.0" * cargo_metadata = "0.12" -> "0.14" --- Cargo.lock | 8 ++++---- src/tools/clippy/Cargo.toml | 4 ++-- src/tools/clippy/clippy_lints/Cargo.toml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf19f5e0ae32f..92e6e6f04e09b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -576,7 +576,7 @@ dependencies = [ name = "clippy" version = "0.1.58" dependencies = [ - "cargo_metadata 0.12.0", + "cargo_metadata 0.14.0", "clippy_lints", "clippy_utils", "compiletest_rs", @@ -588,7 +588,7 @@ dependencies = [ "regex", "rustc-workspace-hack", "rustc_tools_util 0.2.0", - "semver 0.11.0", + "semver 1.0.3", "serde", "syn", "tempfile", @@ -613,7 +613,7 @@ dependencies = [ name = "clippy_lints" version = "0.1.58" dependencies = [ - "cargo_metadata 0.12.0", + "cargo_metadata 0.14.0", "clippy_utils", "if_chain", "itertools 0.10.1", @@ -621,7 +621,7 @@ dependencies = [ "quine-mc_cluskey", "regex-syntax", "rustc-semver", - "semver 0.11.0", + "semver 1.0.3", "serde", "serde_json", "toml", diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml index ed7fb1440139f..d475aaa3ee067 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml @@ -22,12 +22,12 @@ path = "src/driver.rs" [dependencies] clippy_lints = { version = "0.1", path = "clippy_lints" } -semver = "0.11" +semver = "1.0" rustc_tools_util = { version = "0.2", path = "rustc_tools_util" } tempfile = { version = "3.2", optional = true } [dev-dependencies] -cargo_metadata = "0.12" +cargo_metadata = "0.14" compiletest_rs = { version = "0.7", features = ["tmp"] } tester = "0.9" regex = "1.5" diff --git a/src/tools/clippy/clippy_lints/Cargo.toml b/src/tools/clippy/clippy_lints/Cargo.toml index aaf9ac83d4900..281480b8d9491 100644 --- a/src/tools/clippy/clippy_lints/Cargo.toml +++ b/src/tools/clippy/clippy_lints/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["clippy", "lint", "plugin"] edition = "2021" [dependencies] -cargo_metadata = "0.12" +cargo_metadata = "0.14" clippy_utils = { path = "../clippy_utils" } if_chain = "1.0" itertools = "0.10" @@ -21,7 +21,7 @@ serde_json = { version = "1.0", optional = true } toml = "0.5" unicode-normalization = "0.1" unicode-script = { version = "0.5", default-features = false } -semver = "0.11" +semver = "1.0" rustc-semver = "1.1" # NOTE: cargo requires serde feat in its url dep # see From eb23a7333ff540adac206c80f2416a69e25c924d Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 2 Nov 2021 15:30:28 +0100 Subject: [PATCH 6/6] Add link to documentation about feature gates --- compiler/rustc_feature/src/active.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 7cf53d40ff693..a55ea31481074 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -101,6 +101,9 @@ impl Feature { } } +// See https://rustc-dev-guide.rust-lang.org/feature-gates.html#feature-gates for more +// documentation about handling feature gates. +// // If you change this, please modify `src/doc/unstable-book` as well. // // Don't ever remove anything from this list; move them to `accepted.rs` if