Skip to content

Commit

Permalink
Treat warnings like an error (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx authored Jul 18, 2023
1 parent 1c73e8d commit 03b8c93
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
- prevent-openssl
- rustfmt
runs-on: buildjet-4vcpu-ubuntu-2204
env:
RUSTFLAGS: -D warnings
strategy:
matrix:
include:
Expand Down
2 changes: 2 additions & 0 deletions bin/fuel-core-client/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

use clap::Parser;
use fuel_core_client::client::FuelClient;
use fuel_core_types::fuel_tx::{
Expand Down
1 change: 1 addition & 0 deletions bin/fuel-core/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

// Use Jemalloc for main binary
#[global_allocator]
Expand Down
1 change: 1 addition & 0 deletions crates/chain-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

pub mod config;
mod genesis;
Expand Down
2 changes: 1 addition & 1 deletion crates/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ impl FuelClient {
commit_block_id: Option<&BlockId>,
commit_block_height: Option<BlockHeight>,
) -> io::Result<Option<types::MessageProof>> {
let transaction_id: schema::TransactionId = (*transaction_id).into();
let transaction_id: TransactionId = (*transaction_id).into();
let message_id: schema::MessageId = (*message_id).into();
let commit_block_id: Option<schema::BlockId> =
commit_block_id.map(|commit_block_id| (*commit_block_id).into());
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]
pub mod client;
#[cfg(feature = "dap")]
pub mod schema;
1 change: 1 addition & 0 deletions crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#![deny(missing_docs)]
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

use fuel_core_storage::Error as StorageError;
use fuel_core_types::services::executor::Error as ExecutorError;
Expand Down
1 change: 1 addition & 0 deletions crates/fuel-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

#[doc(no_inline)]
pub use fuel_core_chain_config as chain_config;
Expand Down
5 changes: 2 additions & 3 deletions crates/fuel-core/src/service/adapters/block_importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ impl RelayerPort for MaybeRelayerAdapter {
async fn await_until_if_in_range(
&self,
da_height: &DaBlockHeight,
max_da_lag: &DaBlockHeight,
_max_da_lag: &DaBlockHeight,
) -> anyhow::Result<()> {
#[cfg(feature = "relayer")]
{
if let Some(sync) = self.relayer_synced.as_ref() {
let current_height = sync.get_finalized_da_height()?;
anyhow::ensure!(
da_height.saturating_sub(*current_height) <= **max_da_lag,
da_height.saturating_sub(*current_height) <= **_max_da_lag,
"Relayer is too far out of sync"
);
sync.await_at_least_synced(da_height).await?;
Expand All @@ -100,7 +100,6 @@ impl RelayerPort for MaybeRelayerAdapter {
}
#[cfg(not(feature = "relayer"))]
{
core::mem::drop(max_da_lag);
anyhow::ensure!(
**da_height == 0,
"Cannot have a da height above zero without a relayer"
Expand Down
1 change: 1 addition & 0 deletions crates/metrics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

pub mod core_metrics;
pub mod graphql_metrics;
Expand Down
1 change: 1 addition & 0 deletions crates/services/consensus_module/bft/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

pub mod config;
pub mod service;
Expand Down
1 change: 1 addition & 0 deletions crates/services/consensus_module/poa/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![deny(unused_crate_dependencies)]
#![deny(unused_must_use)]
#![deny(warnings)]

mod deadline_clock;
mod sync;
Expand Down
1 change: 1 addition & 0 deletions crates/services/consensus_module/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Common traits and logic for managing the lifecycle of services
#![deny(unused_crate_dependencies)]
#![deny(missing_docs)]
#![deny(warnings)]

extern crate core;

Expand Down
1 change: 1 addition & 0 deletions crates/services/executor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

mod config;

Expand Down
1 change: 1 addition & 0 deletions crates/services/importer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

pub mod config;
pub mod importer;
Expand Down
1 change: 1 addition & 0 deletions crates/services/producer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![deny(unused_crate_dependencies)]
#![deny(unused_must_use)]
#![deny(warnings)]

pub mod block_producer;
pub mod config;
Expand Down
1 change: 1 addition & 0 deletions crates/services/relayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![deny(unused_crate_dependencies)]
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![deny(warnings)]

pub(crate) mod abi;
pub(crate) mod config;
Expand Down
1 change: 1 addition & 0 deletions crates/services/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Common traits and logic for managing the lifecycle of services
#![deny(unused_crate_dependencies)]
#![deny(missing_docs)]
#![deny(warnings)]

mod service;
mod state;
Expand Down
1 change: 1 addition & 0 deletions crates/services/sync/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![deny(unused_crate_dependencies)]
#![deny(missing_docs)]
#![deny(warnings)]
//! # Sync Service
//! Responsible for syncing the blockchain from the network.

Expand Down
1 change: 1 addition & 0 deletions crates/services/txpool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

use fuel_core_types::{
services::txpool::{
Expand Down
1 change: 1 addition & 0 deletions crates/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#![deny(unused_crate_dependencies)]
#![deny(missing_docs)]
#![deny(warnings)]

use fuel_core_types::services::executor::Error as ExecutorError;
use std::io::ErrorKind;
Expand Down
1 change: 1 addition & 0 deletions crates/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#![deny(unused_crate_dependencies)]
#![deny(missing_docs)]
#![deny(warnings)]

#[doc(no_inline)]
pub use fuel_vm_private::{
Expand Down
1 change: 1 addition & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(unused_crate_dependencies)]
#![deny(warnings)]

use clap::Parser;
use commands::{
Expand Down

0 comments on commit 03b8c93

Please sign in to comment.