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 all 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
6 changes: 4 additions & 2 deletions frame/contracts/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern crate alloc;
use alloc::string::ToString;
use proc_macro2::TokenStream;
use quote::{quote, quote_spanned};
use syn::{parse_macro_input, spanned::Spanned, Data, DataStruct, DeriveInput, Fields, Ident};
use syn::{parse_macro_input, Data, DeriveInput, Ident};

/// This derives `Debug` for a struct where each field must be of some numeric type.
/// It interprets each field as its represents some weight and formats it as times so that
Expand Down Expand Up @@ -84,7 +84,9 @@ fn derive_debug(

/// This is only used then the `full` feature is activated.
#[cfg(feature = "full")]
fn iterate_fields(data: &DataStruct, fmt: impl Fn(&Ident) -> TokenStream) -> TokenStream {
fn iterate_fields(data: &syn::DataStruct, fmt: impl Fn(&Ident) -> TokenStream) -> TokenStream {
use syn::{spanned::Spanned, Fields};

match &data.fields {
Fields::Named(fields) => {
let recurse = fields.named.iter().filter_map(|f| {
Expand Down
4 changes: 2 additions & 2 deletions frame/nomination-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ use frame_support::{
Currency, Defensive, DefensiveOption, DefensiveResult, DefensiveSaturating,
ExistenceRequirement, Get,
},
CloneNoBound, DefaultNoBound, PartialEqNoBound, RuntimeDebugNoBound,
CloneNoBound, DefaultNoBound, RuntimeDebugNoBound,
};
use scale_info::TypeInfo;
use sp_core::U256;
Expand Down Expand Up @@ -398,7 +398,7 @@ enum AccountType {

/// A member in a pool.
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebugNoBound, CloneNoBound)]
#[cfg_attr(feature = "std", derive(PartialEqNoBound, DefaultNoBound))]
#[cfg_attr(feature = "std", derive(frame_support::PartialEqNoBound, DefaultNoBound))]
#[codec(mel_bound(T: Config))]
#[scale_info(skip_type_params(T))]
pub struct PoolMember<T: Config> {
Expand Down
2 changes: 1 addition & 1 deletion frame/ranked-collective/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ pub mod pallet {
MemberCount::<T, I>::insert(rank, index.checked_add(1).ok_or(Overflow)?);
IdToIndex::<T, I>::insert(rank, &who, index);
IndexToId::<T, I>::insert(rank, index, &who);
Members::<T, I>::insert(&who, MemberRecord { rank, ..record });
Members::<T, I>::insert(&who, MemberRecord { rank });
Self::deposit_event(Event::RankChanged { who, rank });

Ok(())
Expand Down
1 change: 0 additions & 1 deletion frame/try-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#![cfg_attr(not(feature = "std"), no_std)]

use frame_support::weights::Weight;
use sp_std::prelude::*;

sp_api::decl_runtime_apis! {
/// Runtime api for testing the execution of a runtime upgrade.
Expand Down
9 changes: 4 additions & 5 deletions primitives/block-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

use sp_inherents::{CheckInherentsResult, InherentData};
use sp_runtime::{
legacy::byte_sized_error::ApplyExtrinsicResult as ApplyExtrinsicResultBeforeV6,
traits::Block as BlockT, ApplyExtrinsicResult,
};
use sp_runtime::{traits::Block as BlockT, ApplyExtrinsicResult};

sp_api::decl_runtime_apis! {
/// The `BlockBuilder` api trait that provides the required functionality for building a block.
Expand All @@ -36,7 +33,9 @@ sp_api::decl_runtime_apis! {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult;

#[changed_in(6)]
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResultBeforeV6;
fn apply_extrinsic(
extrinsic: <Block as BlockT>::Extrinsic,
) -> sp_runtime::legacy::byte_sized_error::ApplyExtrinsicResult;

/// Finish the current block.
#[renamed("finalise_block", 3)]
Expand Down
6 changes: 3 additions & 3 deletions primitives/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,17 +1522,17 @@ mod tracing_setup {
fn new_span(&self, attrs: &Attributes<'_>) -> Id {
Id::from_u64(wasm_tracing::enter_span(Crossing(attrs.into())))
}
fn enter(&self, span: &Id) {
fn enter(&self, _: &Id) {
// Do nothing, we already entered the span previously
}
/// Not implemented! We do not support recording values later
/// Will panic when used.
fn record(&self, span: &Id, values: &Record<'_>) {
fn record(&self, _: &Id, _: &Record<'_>) {
unimplemented! {} // this usage is not supported
}
/// Not implemented! We do not support recording values later
/// Will panic when used.
fn record_follows_from(&self, span: &Id, follows: &Id) {
fn record_follows_from(&self, _: &Id, _: &Id) {
unimplemented! {} // this usage is not supported
}
fn event(&self, event: &Event<'_>) {
Expand Down
5 changes: 2 additions & 3 deletions primitives/state-machine/src/trie_backend_essence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ use sp_trie::{
child_delta_trie_root, delta_trie_root, empty_child_trie_root, read_child_trie_value,
read_trie_value,
trie_types::{TrieDB, TrieError},
DBValue, KeySpacedDB, LayoutV1 as Layout, PrefixedMemoryDB, Trie, TrieDBIterator,
TrieDBKeyIterator,
DBValue, KeySpacedDB, LayoutV1 as Layout, Trie, TrieDBIterator, TrieDBKeyIterator,
};
#[cfg(feature = "std")]
use std::collections::HashMap;
Expand Down Expand Up @@ -619,7 +618,7 @@ pub trait TrieBackendStorage<H: Hasher>: Send + Sync {
// This implementation is used by normal storage trie clients.
#[cfg(feature = "std")]
impl<H: Hasher> TrieBackendStorage<H> for Arc<dyn Storage<H>> {
type Overlay = PrefixedMemoryDB<H>;
type Overlay = sp_trie::PrefixedMemoryDB<H>;

fn get(&self, key: &H::Out, prefix: Prefix) -> Result<Option<DBValue>> {
Storage::<H>::get(std::ops::Deref::deref(self), key, prefix)
Expand Down
1 change: 1 addition & 0 deletions primitives/version/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ impl fmt::Display for RuntimeVersion {
}
}

#[cfg(feature = "std")]
fn has_api_with<P: Fn(u32) -> bool>(apis: &ApisVec, id: &ApiId, predicate: P) -> bool {
apis.iter().any(|(s, v)| s == id && predicate(*v))
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ test-linux-stable:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
script:
Expand Down Expand Up @@ -247,6 +248,7 @@ test-linux-stable-int:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
script:
Expand Down