From 427523f28d9b1647f17cd3cb9da6294556c503fc Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Fri, 7 Jul 2023 09:15:02 +0000 Subject: [PATCH 1/3] Revert 5ea6640ef8502a55348df4cd5aa82ff38ddd9752 https://github.com/rust-lang/rust/pull/113318 was merged. --- .github/workflows/ci.yml | 4 ---- necessist/tests/ci.rs | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 221eecf57..c10251c1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,10 +53,6 @@ jobs: cargo install cargo-license || true cargo install cargo-modules || true cargo install cargo-sort || true - # smoelius: Pin Clippy to nightly-2023-06-28 until the following is resolved: - # https://github.com/rust-lang/rust/pull/112628#issuecomment-1616750719 - rustup toolchain install nightly-2023-06-28 - rustup +nightly-2023-06-28 component add clippy - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/necessist/tests/ci.rs b/necessist/tests/ci.rs index f21156d0f..d8e2d614c 100644 --- a/necessist/tests/ci.rs +++ b/necessist/tests/ci.rs @@ -279,16 +279,9 @@ fn update() { fn clippy_command(cargo_args: &[&str], rustc_args: &[&str]) -> Command { // smoelius: The next command should match what's in scripts/clippy.sh. - // smoelius: Pin Clippy to nightly-2023-06-28 until the following is resolved: - // https://github.com/rust-lang/rust/pull/112628#issuecomment-1616750719 let mut command = Command::new("cargo"); command - .args([ - "+nightly-2023-06-28", - "clippy", - "--all-features", - "--all-targets", - ]) + .args(["+nightly", "clippy", "--all-features", "--all-targets"]) .args(cargo_args) .args(["--"]) .args(rustc_args) From 2c56652e7ddfab7c61da8490332132e3b1e7d657 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Sun, 9 Jul 2023 15:47:44 +0000 Subject: [PATCH 2/3] Pin Dylint libraries to 120f750 By an unfortunate cooincidence, the Dylint libraries got upgraded to nightly-2023-06-29, which doesn't build `swc_ecma_ast`. --- Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 934a1f5c1..bfcba81c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,14 +8,14 @@ resolver = "2" [workspace.metadata.dylint] libraries = [ - { git = "https://github.com/trailofbits/dylint", pattern = "examples/general/*" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/supplementary/*" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/collapsible_unwrap" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/const_path_join" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/inconsistent_qualification" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/misleading_variable_name" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/general/*", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/supplementary/*", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/collapsible_unwrap", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/const_path_join", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/inconsistent_qualification", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/misleading_variable_name", rev = "120f750" }, # { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/missing_doc_comment_openai" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/question_mark_in_expression" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/ref_aware_redundant_closure_for_method_calls" }, - { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/suboptimal_pattern" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/question_mark_in_expression", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/ref_aware_redundant_closure_for_method_calls", rev = "120f750" }, + { git = "https://github.com/trailofbits/dylint", pattern = "examples/restriction/suboptimal_pattern", rev = "120f750" }, ] From ced5e28df190fb2fa5ddeee8c8ac4d0773b2e8fb Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Sun, 9 Jul 2023 16:47:15 +0000 Subject: [PATCH 3/3] Make Clippy happy --- frameworks/build.rs | 4 ++-- frameworks/src/foundry/visitor/visit.rs | 2 +- necessist/tests/trycmd.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/build.rs b/frameworks/build.rs index 4bf244b76..5a976e32a 100644 --- a/frameworks/build.rs +++ b/frameworks/build.rs @@ -179,7 +179,7 @@ where writeln!(file, " => {{")?; match fields { Fields::Named(fields) => { - for field in fields.named.iter() { + for field in &fields.named { writeln!( file, " {}.visit(visitor)?;", @@ -234,7 +234,7 @@ where match fields { Fields::Named(fields) => { - for field in fields.named.iter() { + for field in &fields.named { writeln!( file, " {}.{}.visit(visitor)?;", diff --git a/frameworks/src/foundry/visitor/visit.rs b/frameworks/src/foundry/visitor/visit.rs index 61e9bcd13..fae3a58b4 100644 --- a/frameworks/src/foundry/visitor/visit.rs +++ b/frameworks/src/foundry/visitor/visit.rs @@ -57,7 +57,7 @@ where where V: Visitor<'ast> + ?Sized, { - for item in self.iter() { + for item in self { item.visit(v)?; } Ok(()) diff --git a/necessist/tests/trycmd.rs b/necessist/tests/trycmd.rs index 4aceefa4f..b04422af8 100644 --- a/necessist/tests/trycmd.rs +++ b/necessist/tests/trycmd.rs @@ -41,7 +41,7 @@ fn trycmd() { #[test] fn check_stdout() { - let re = Regex::new(r#"\b[0-9]+\.[0-9]+s\b"#).unwrap(); + let re = Regex::new(r"\b[0-9]+\.[0-9]+s\b").unwrap(); let necessist_db_absent = read_dir("tests/necessist_db_absent").unwrap(); let necessist_db_present = read_dir("tests/necessist_db_present").unwrap();