Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add -D warnings for cargo-check-each-crate job to fail on warnings #2670

Merged
merged 14 commits into from
Dec 12, 2023
1 change: 1 addition & 0 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ cargo-check-each-crate:
- .run-immediately
# - .collect-artifacts
variables:
RUSTFLAGS: "-D warnings"
# $CI_JOB_NAME is set manually so that cache could be shared for all jobs
# "cargo-check-each-crate I/N" jobs
CI_JOB_NAME: cargo-check-each-crate
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/network/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use parking_lot::Mutex;
use sp_runtime::traits::Block as BlockT;
use std::{collections::HashSet, sync::Arc, time::Duration};

pub use crate::request_responses::{InboundFailure, OutboundFailure, RequestId, ResponseFailure};
pub use crate::request_responses::{InboundFailure, OutboundFailure, ResponseFailure};

/// General behaviour of the network. Combines all protocols together.
#[derive(NetworkBehaviour)]
Expand Down
4 changes: 0 additions & 4 deletions substrate/client/network/src/protocol/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
//! Network packet message types. These get serialized and put into the lower level protocol
//! payload.

pub use self::generic::{
RemoteCallRequest, RemoteChangesRequest, RemoteChangesResponse, RemoteHeaderRequest,
RemoteHeaderResponse, RemoteReadChildRequest, RemoteReadRequest,
};
use codec::{Decode, Encode};
use sc_client_api::StorageProof;
use sc_network_common::message::RequestId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#[cfg(test)]
pub(crate) use self::notifications::{
NotificationsInOpen, NotificationsInSubstreamHandshake, NotificationsOutOpen,
};
pub use self::{
collec::UpgradeCollec,
notifications::{
NotificationsHandshakeError, NotificationsIn, NotificationsInOpen,
NotificationsInSubstream, NotificationsInSubstreamHandshake, NotificationsOut,
NotificationsOutError, NotificationsOutOpen, NotificationsOutSubstream,
NotificationsIn, NotificationsInSubstream, NotificationsOut, NotificationsOutSubstream,
},
};

Expand Down
1 change: 0 additions & 1 deletion substrate/client/offchain/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use sp_core::{
},
OpaquePeerId,
};
pub use sp_offchain::STORAGE_PREFIX;

mod http;

Expand Down
5 changes: 1 addition & 4 deletions substrate/client/transaction-pool/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ pub mod watcher;

pub use self::{
base_pool::Transaction,
pool::{
BlockHash, ChainApi, EventStream, ExtrinsicFor, ExtrinsicHash, NumberFor, Options, Pool,
TransactionFor,
},
pool::{BlockHash, ChainApi, ExtrinsicFor, ExtrinsicHash, NumberFor, Options, Pool},
};
pub use validated_pool::{IsValidator, ValidatedTransaction};
2 changes: 1 addition & 1 deletion substrate/frame/contracts/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn derive_debug(input: TokenStream, fmt: impl Fn(&Ident) -> TokenStream2) -> Tok
#[cfg(not(feature = "full"))]
let fields = {
drop(fmt);
drop(data);
let _ = data;
TokenStream2::new()
};

Expand Down
3 changes: 2 additions & 1 deletion substrate/primitives/api/proc-macro/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::common::API_VERSION_ATTRIBUTE;
use inflector::Inflector;
use proc_macro2::{Span, TokenStream};
use proc_macro_crate::{crate_name, FoundCrate};
use quote::{format_ident, quote, ToTokens};
use quote::{format_ident, quote};
use syn::{
parse_quote, spanned::Spanned, token::And, Attribute, Error, FnArg, GenericArgument, Ident,
ImplItem, ItemImpl, Pat, Path, PathArguments, Result, ReturnType, Signature, Type, TypePath,
Expand Down Expand Up @@ -261,6 +261,7 @@ pub fn versioned_trait_name(trait_ident: &Ident, version: u64) -> Ident {
/// Extract the documentation from the provided attributes.
#[cfg(feature = "frame-metadata")]
pub fn get_doc_literals(attrs: &[syn::Attribute]) -> Vec<syn::Lit> {
use quote::ToTokens;
attrs
.iter()
.filter_map(|attr| {
Expand Down
1 change: 0 additions & 1 deletion substrate/primitives/state-machine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ pub use crate::{
mod std_reexport {
pub use crate::{
basic::BasicExternalities,
error::{Error, ExecutionError},
in_memory_backend::new_in_mem,
read_only::{InspectState, ReadOnlyExternalities},
testing::TestExternalities,
Expand Down