Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 20 commits
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
14 changes: 14 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# An auto defined `clippy` feature was introduced,
# but it was found to clash with user defined features,
# so was renamed to `cargo-clippy`.
#
# If you want standard clippy run:
# RUSTFLAGS= cargo clippy
[target.'cfg(feature = "cargo-clippy")']
rustflags = [
"-Aclippy::all",
"-Dclippy::correctness",
"-Aclippy::if-same-then-else",
"-Aclippy::clone-double-ref"
]
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ rls*.log
.local
**/hfuzz_target/
**/hfuzz_workspace/
.cargo/
.cargo-remote.toml
*.bin
*.iml
10 changes: 9 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ cargo-deny:
when: always
paths:
- deny.log
# FIXME: Temorarily allow to fail.
# FIXME: Temporarily allow to fail.
allow_failure: true

cargo-fmt:
Expand All @@ -321,6 +321,14 @@ cargo-fmt:
script:
- cargo +nightly fmt --all -- --check

cargo-clippy:
stage: test
<<: *docker-env
<<: *test-refs
script:
- SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo +nightly clippy
allow_failure: false

cargo-check-benches:
stage: test
<<: *docker-env
Expand Down
2 changes: 1 addition & 1 deletion client/executor/src/wasm_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub fn create_wasm_runtime_with_code(
//
// We drop the cache_path here to silence warnings that cache_path is not used if
// compiling without the `wasmtime` flag.
drop(cache_path);
let _ = cache_path;

sc_executor_wasmi::create_runtime(
blob,
Expand Down
1 change: 1 addition & 0 deletions client/executor/wasmtime/src/instance_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ impl InstanceWrapper {
/// See `[memory_as_slice]`. In addition to those requirements, since a mutable reference is
/// returned it must be ensured that only one mutable and no shared references to memory exists
/// at the same time.
#[allow(clippy::mut_from_ref)]
unsafe fn memory_as_slice_mut(&self) -> &mut [u8] {
let ptr = self.memory.data_ptr();
let len = self.memory.data_size();
Expand Down
3 changes: 2 additions & 1 deletion client/network/src/block_request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ struct SeenRequestsKey<B: BlockT> {
support_multiple_justifications: bool,
}

#[allow(clippy::derive_hash_xor_eq)]
impl<B: BlockT> Hash for SeenRequestsKey<B> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.peer.hash(state);
self.max_blocks.hash(state);
self.direction.hash(state);
self.attributes.hash(state);

self.support_multiple_justifications.hash(state);
match self.from {
BlockId::Hash(h) => h.hash(state),
BlockId::Number(n) => n.hash(state),
Expand Down
1 change: 1 addition & 0 deletions client/network/src/state_request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct SeenRequestsKey<B: BlockT> {
start: Vec<u8>,
}

#[allow(clippy::derive_hash_xor_eq)]
impl<B: BlockT> Hash for SeenRequestsKey<B> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.peer.hash(state);
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
rev = "4a07484cf0e49047f82d83fd119acffbad3b235f";
});
nixpkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
rust-nightly = with nixpkgs; ((rustChannelOf { date = "2021-07-06"; channel = "nightly"; }).rust.override {
rust-nightly = with nixpkgs; ((rustChannelOf { date = "2021-07-10"; channel = "nightly"; }).rust.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
});
Expand Down