Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(all): Update clippy_utils version
  • Loading branch information
jubnzv committed Aug 14, 2023
commit 3f99ce904a774ab30e615e715a15a5a5fc9ffc91
6 changes: 3 additions & 3 deletions linting/Cargo.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update ref of clippy_utils to 1d334696587ac22b3a9e651e7ac684ac9e0697b2 and bump dylint_linting & dylint_testing to 2.1.12

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to set channel to nightly-2023-08-10 in rust-toolchain.toml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

I updated clippy_utils version to 1d334696587ac22b3a9e651e7ac684ac9e0697b2 and set channel to nightly-2023-07-14 in rust-toolchain.toml. nightly-2023-07-14 is required, since this version is used in rust-clippy at commit 1d334696587ac22b3a9e651e7ac684ac9e0697b2.

How should we choose the clippy version for linting? Should we always take the latest version from the clippy master branch?

Copy link
Contributor

@SkymanOne SkymanOne Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by clippy here. If you are referring to clippy_utils, I've been following a template in dylint repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By clippy I mean the rust-clippy repository, which contains the clippy_utils crate. In this repo they set the toolchain version to nightly-2023-07-14 for all the crates. So we need to set the same version in our toolchain file to build clippy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we only have rust-toolchain.toml for the lining crate

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ include = ["Cargo.toml", "*.rs", "LICENSE"]
crate-type = ["cdylib"]

[dependencies]
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "1480cea393d0cee195e59949eabdfbcf1230f7f9" }
dylint_linting = "2.0.0"
clippy_utils = { path = "/home/georgiy/Sources/rust-clippy/clippy_utils" }
dylint_linting = "2.1.12"
if_chain = "1.0.2"
log = "0.4.14"
regex = "1.5.4"

[dev-dependencies]
dylint_testing = "2.0.0"
dylint_testing = "2.1.12"

# The following are ink! dependencies, they are only required for the `ui` tests.
ink_env = { path = "../crates/env", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion linting/rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# https://github.com/trailofbits/dylint/blob/ef7210cb08aac920c18d2141604efe210029f2a2/internal/template/rust-toolchain

[toolchain]
channel = "nightly-2023-01-27"
channel = "nightly-2023-07-14"
components = ["llvm-tools-preview", "rustc-dev"]
6 changes: 5 additions & 1 deletion linting/src/primitive_topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ declare_lint_pass!(PrimitiveTopic => [PRIMITIVE_TOPIC]);
/// struct. If that's the case, it returns the name of this struct.
fn is_ink_event_impl<'tcx>(cx: &LateContext<'tcx>, item: &'tcx Item<'_>) -> bool {
if let Some(trait_ref) = cx.tcx.impl_trait_ref(item.owner_id) {
match_def_path(cx, trait_ref.0.def_id, &["ink_env", "event", "Event"])
match_def_path(
cx,
trait_ref.skip_binder().def_id,
&["ink_env", "event", "Event"],
)
} else {
false
}
Expand Down