From 9a66a378ad6bf292f327ad6ba8079f0aca1fdb76 Mon Sep 17 00:00:00 2001 From: o0Ignition0o Date: Thu, 28 Nov 2019 19:57:48 +0100 Subject: [PATCH] Put deny(warnings) behind a feature gate, which is enabled by default. --- neqo-client/Cargo.toml | 4 ++++ neqo-client/src/main.rs | 2 +- neqo-common/Cargo.toml | 4 ++++ neqo-common/src/lib.rs | 2 +- neqo-common/tests/log.rs | 2 +- neqo-crypto/Cargo.toml | 2 ++ neqo-crypto/build.rs | 2 +- neqo-crypto/src/lib.rs | 2 +- neqo-crypto/tests/aead.rs | 2 +- neqo-crypto/tests/agent.rs | 2 +- neqo-crypto/tests/ext.rs | 2 +- neqo-crypto/tests/hkdf.rs | 2 +- neqo-crypto/tests/hp.rs | 2 +- neqo-crypto/tests/init.rs | 2 +- neqo-crypto/tests/selfencrypt.rs | 2 +- neqo-http3-server/Cargo.toml | 4 ++++ neqo-http3-server/src/main.rs | 2 +- neqo-http3/Cargo.toml | 4 ++++ neqo-http3/src/lib.rs | 2 +- neqo-interop/Cargo.toml | 4 ++++ neqo-interop/src/main.rs | 2 +- neqo-qpack/Cargo.toml | 4 ++++ neqo-qpack/src/lib.rs | 2 +- neqo-server/Cargo.toml | 4 ++++ neqo-server/src/main.rs | 2 +- neqo-transport/Cargo.toml | 4 ++++ neqo-transport/src/lib.rs | 2 +- neqo-transport/tests/conn_vectors.rs | 2 +- neqo-transport/tests/connection.rs | 2 +- neqo-transport/tests/server.rs | 2 +- test-fixture/Cargo.toml | 4 ++++ test-fixture/src/lib.rs | 2 +- 32 files changed, 60 insertions(+), 22 deletions(-) diff --git a/neqo-client/Cargo.toml b/neqo-client/Cargo.toml index 5f7f7ff3b9..36c6e8eb04 100644 --- a/neqo-client/Cargo.toml +++ b/neqo-client/Cargo.toml @@ -14,3 +14,7 @@ neqo-common = { version="0.1", path="./../neqo-common" } neqo-http3 = { version = "0.1", path = "./../neqo-http3" } structopt = "0.2.15" url = "1.7.2" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-client/src/main.rs b/neqo-client/src/main.rs index ea0904f1b1..82aab6071b 100644 --- a/neqo-client/src/main.rs +++ b/neqo-client/src/main.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{matches, Datagram}; use neqo_crypto::{init, AuthenticationStatus}; use neqo_http3::{Header, Http3Client, Http3ClientEvent, Http3State, Output}; diff --git a/neqo-common/Cargo.toml b/neqo-common/Cargo.toml index c041bc79fa..b26332b51e 100644 --- a/neqo-common/Cargo.toml +++ b/neqo-common/Cargo.toml @@ -10,3 +10,7 @@ num-traits = "0.2" log = "0.4.0" env_logger = "0.6.1" lazy_static = "1.3.0" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-common/src/lib.rs b/neqo-common/src/lib.rs index a52472f1c2..6bf134699b 100644 --- a/neqo-common/src/lib.rs +++ b/neqo-common/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] mod codec; mod datagram; diff --git a/neqo-common/tests/log.rs b/neqo-common/tests/log.rs index 872f638907..2da23be273 100644 --- a/neqo-common/tests/log.rs +++ b/neqo-common/tests/log.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{qdebug, qerror, qinfo, qtrace, qwarn}; diff --git a/neqo-crypto/Cargo.toml b/neqo-crypto/Cargo.toml index 7dcd220e06..8d76d4df1e 100644 --- a/neqo-crypto/Cargo.toml +++ b/neqo-crypto/Cargo.toml @@ -20,4 +20,6 @@ toml = "0.4" test-fixture = { path = "../test-fixture" } [features] +default = ["deny-warnings"] +deny-warnings = [] gecko = [] diff --git a/neqo-crypto/build.rs b/neqo-crypto/build.rs index f1cc84aede..bdc63fa16c 100644 --- a/neqo-crypto/build.rs +++ b/neqo-crypto/build.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use bindgen::Builder; use serde_derive::Deserialize; diff --git a/neqo-crypto/src/lib.rs b/neqo-crypto/src/lib.rs index e33957b38f..6b37fd5623 100644 --- a/neqo-crypto/src/lib.rs +++ b/neqo-crypto/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] // Bindgen auto generated code // won't adhere to the clippy rules below #![allow(clippy::module_name_repetitions)] diff --git a/neqo-crypto/tests/aead.rs b/neqo-crypto/tests/aead.rs index 0a58681b33..65fca96d04 100644 --- a/neqo-crypto/tests/aead.rs +++ b/neqo-crypto/tests/aead.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::aead::Aead; use neqo_crypto::constants::*; diff --git a/neqo-crypto/tests/agent.rs b/neqo-crypto/tests/agent.rs index 8df1c43754..5171602839 100644 --- a/neqo-crypto/tests/agent.rs +++ b/neqo-crypto/tests/agent.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::*; diff --git a/neqo-crypto/tests/ext.rs b/neqo-crypto/tests/ext.rs index aac0021bd5..e775a8e821 100644 --- a/neqo-crypto/tests/ext.rs +++ b/neqo-crypto/tests/ext.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::*; use std::cell::RefCell; diff --git a/neqo-crypto/tests/hkdf.rs b/neqo-crypto/tests/hkdf.rs index 46b10d9f5a..364c694988 100644 --- a/neqo-crypto/tests/hkdf.rs +++ b/neqo-crypto/tests/hkdf.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::constants::*; use neqo_crypto::{hkdf, SymKey}; diff --git a/neqo-crypto/tests/hp.rs b/neqo-crypto/tests/hp.rs index 0dc1b0f4a1..0183c9da6b 100644 --- a/neqo-crypto/tests/hp.rs +++ b/neqo-crypto/tests/hp.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::constants::*; use neqo_crypto::hkdf; diff --git a/neqo-crypto/tests/init.rs b/neqo-crypto/tests/init.rs index 45280dc4a1..7b6ac80457 100644 --- a/neqo-crypto/tests/init.rs +++ b/neqo-crypto/tests/init.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] // This uses external interfaces to neqo_crypto rather than being a module // inside of lib.rs. Because all other code uses the test_fixture module, diff --git a/neqo-crypto/tests/selfencrypt.rs b/neqo-crypto/tests/selfencrypt.rs index 503d95862f..17460d6224 100644 --- a/neqo-crypto/tests/selfencrypt.rs +++ b/neqo-crypto/tests/selfencrypt.rs @@ -1,4 +1,4 @@ -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_crypto::constants::*; use neqo_crypto::{init, selfencrypt::SelfEncrypt, Error}; diff --git a/neqo-http3-server/Cargo.toml b/neqo-http3-server/Cargo.toml index c801f6a905..9ac77849b2 100644 --- a/neqo-http3-server/Cargo.toml +++ b/neqo-http3-server/Cargo.toml @@ -14,3 +14,7 @@ structopt = "0.2.15" mio = "0.6.17" mio-extras = "2.0.5" log = "0.4.0" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-http3-server/src/main.rs b/neqo-http3-server/src/main.rs index f473bc4973..c26140103f 100644 --- a/neqo-http3-server/src/main.rs +++ b/neqo-http3-server/src/main.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{qdebug, qinfo, Datagram}; use neqo_crypto::{init_db, AntiReplay}; diff --git a/neqo-http3/Cargo.toml b/neqo-http3/Cargo.toml index dac6f5922f..74a36fea56 100644 --- a/neqo-http3/Cargo.toml +++ b/neqo-http3/Cargo.toml @@ -16,3 +16,7 @@ smallvec = "1.0.0" [dev-dependencies] test-fixture = { path = "../test-fixture" } + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-http3/src/lib.rs b/neqo-http3/src/lib.rs index d080cc2c04..b8cd002530 100644 --- a/neqo-http3/src/lib.rs +++ b/neqo-http3/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] mod client_events; mod connection; diff --git a/neqo-interop/Cargo.toml b/neqo-interop/Cargo.toml index 9b8634f51c..14762be1d6 100644 --- a/neqo-interop/Cargo.toml +++ b/neqo-interop/Cargo.toml @@ -12,3 +12,7 @@ neqo-common = { version="0.1", path="./../neqo-common" } neqo-http3 = { version = "0.1", path = "./../neqo-http3" } structopt = "0.2.15" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-interop/src/main.rs b/neqo-interop/src/main.rs index a11f266440..97da491ee1 100644 --- a/neqo-interop/src/main.rs +++ b/neqo-interop/src/main.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{matches, Datagram}; use neqo_crypto::{init, AuthenticationStatus}; diff --git a/neqo-qpack/Cargo.toml b/neqo-qpack/Cargo.toml index e1020af351..1d02ad9f43 100644 --- a/neqo-qpack/Cargo.toml +++ b/neqo-qpack/Cargo.toml @@ -13,3 +13,7 @@ log = "0.4.0" [dev-dependencies] test-fixture = { path = "../test-fixture" } + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-qpack/src/lib.rs b/neqo-qpack/src/lib.rs index 1a72a77e14..d96ad49820 100644 --- a/neqo-qpack/src/lib.rs +++ b/neqo-qpack/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] pub mod decoder; pub mod encoder; diff --git a/neqo-server/Cargo.toml b/neqo-server/Cargo.toml index 275580bc70..61a6bd5378 100644 --- a/neqo-server/Cargo.toml +++ b/neqo-server/Cargo.toml @@ -11,3 +11,7 @@ neqo-transport = { path = "./../neqo-transport" } neqo-common = { path="./../neqo-common" } structopt = "0.2.15" regex = "1" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-server/src/main.rs b/neqo-server/src/main.rs index 4a3a4e4d64..6a7b31b68b 100644 --- a/neqo-server/src/main.rs +++ b/neqo-server/src/main.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::Datagram; use neqo_crypto::{init_db, AntiReplay}; diff --git a/neqo-transport/Cargo.toml b/neqo-transport/Cargo.toml index 6067d25ca8..8761958b78 100644 --- a/neqo-transport/Cargo.toml +++ b/neqo-transport/Cargo.toml @@ -15,3 +15,7 @@ smallvec = "1.0.0" [dev-dependencies] test-fixture = { path = "../test-fixture" } + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/neqo-transport/src/lib.rs b/neqo-transport/src/lib.rs index 175afd9940..3ada8da0b5 100644 --- a/neqo-transport/src/lib.rs +++ b/neqo-transport/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::qinfo; use neqo_crypto; diff --git a/neqo-transport/tests/conn_vectors.rs b/neqo-transport/tests/conn_vectors.rs index a1ef1d8e71..3a01fd623e 100644 --- a/neqo-transport/tests/conn_vectors.rs +++ b/neqo-transport/tests/conn_vectors.rs @@ -5,7 +5,7 @@ // except according to those terms. // Tests with the test vectors from the spec. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{Datagram, Encoder}; use neqo_transport::State; use test_fixture::*; diff --git a/neqo-transport/tests/connection.rs b/neqo-transport/tests/connection.rs index 8b67d43f8e..d2cd48900c 100644 --- a/neqo-transport/tests/connection.rs +++ b/neqo-transport/tests/connection.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::Datagram; use neqo_transport::State; diff --git a/neqo-transport/tests/server.rs b/neqo-transport/tests/server.rs index 87aeb3c3e5..fc4136fe8c 100644 --- a/neqo-transport/tests/server.rs +++ b/neqo-transport/tests/server.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::{hex, qdebug, qtrace, Datagram, Decoder, Encoder}; use neqo_crypto::{ diff --git a/test-fixture/Cargo.toml b/test-fixture/Cargo.toml index 9d6ee7edc3..5a8fb75fcb 100644 --- a/test-fixture/Cargo.toml +++ b/test-fixture/Cargo.toml @@ -11,3 +11,7 @@ neqo-crypto = { path = "../neqo-crypto" } neqo-http3 = { path = "../neqo-http3" } neqo-transport = { path = "../neqo-transport" } log = "0.4.0" + +[features] +default = ["deny-warnings"] +deny-warnings = [] diff --git a/test-fixture/src/lib.rs b/test-fixture/src/lib.rs index a4955f9573..8691ca616e 100644 --- a/test-fixture/src/lib.rs +++ b/test-fixture/src/lib.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use neqo_common::matches; use neqo_common::once::OnceResult;