From 066a3ee736354ea311355e36fb3063bbc85292c3 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Fri, 3 Jan 2020 15:18:53 -0800 Subject: [PATCH 1/4] show that CI is broken (no change) From cae30b06752f04d07ba6f423ad489b2f6d923390 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Fri, 3 Jan 2020 14:54:06 -0800 Subject: [PATCH 2/4] drop deny warnings and demote others to warn Denying _all_ warnings causes local tree development trouble. The intent can be better captured by RUSTFLAGS=-Dwarnings in CI. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c5a43699..b3989d41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,7 +158,7 @@ //! assert_eq!(uri.query(), None); //! ``` -#![deny(warnings, missing_docs, missing_debug_implementations)] +#![warn(missing_docs, missing_debug_implementations)] #[cfg(test)] #[macro_use] From 57fac61a76fb808b73490371850896b5fb20fd38 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Fri, 3 Jan 2020 15:39:37 -0800 Subject: [PATCH 3/4] silence StdError::description deprecation warnings for now This crate uses static strings for error messages throughout and in many cases Display or outer error are implemented by calling `description()`. We silence these kinds of warnings for now: warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string() --> src/header/name.rs:2006:14 | 2006 | self.description().fmt(f) | ^^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default by adding `#[allow(deprecated)]` where necessary. Once the ecosystem has had more time to transition away from `StdError::description`, this can be revisited, likely by pulling out description implementations here completely, possibly moving these static messages to const values. --- src/error.rs | 1 + src/header/name.rs | 1 + src/header/value.rs | 2 ++ src/method.rs | 1 + src/status.rs | 1 + src/uri/mod.rs | 2 ++ 6 files changed, 8 insertions(+) diff --git a/src/error.rs b/src/error.rs index 3b31a103..5d480272 100644 --- a/src/error.rs +++ b/src/error.rs @@ -66,6 +66,7 @@ impl Error { } impl error::Error for Error { + #[allow(deprecated)] fn description(&self) -> &str { use self::ErrorKind::*; diff --git a/src/header/name.rs b/src/header/name.rs index 8e871ecf..87b5a195 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -2002,6 +2002,7 @@ impl fmt::Debug for InvalidHeaderName { } impl fmt::Display for InvalidHeaderName { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.description().fmt(f) } diff --git a/src/header/value.rs b/src/header/value.rs index c3096a15..7b79224c 100644 --- a/src/header/value.rs +++ b/src/header/value.rs @@ -568,6 +568,7 @@ impl fmt::Debug for InvalidHeaderValue { } impl fmt::Display for InvalidHeaderValue { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.description().fmt(f) } @@ -580,6 +581,7 @@ impl Error for InvalidHeaderValue { } impl fmt::Display for ToStrError { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.description().fmt(f) } diff --git a/src/method.rs b/src/method.rs index 6a8ed142..67e51632 100644 --- a/src/method.rs +++ b/src/method.rs @@ -364,6 +364,7 @@ impl fmt::Debug for InvalidMethod { } impl fmt::Display for InvalidMethod { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.description()) } diff --git a/src/status.rs b/src/status.rs index 5b4c41f2..f6121444 100644 --- a/src/status.rs +++ b/src/status.rs @@ -514,6 +514,7 @@ impl fmt::Debug for InvalidStatusCode { } impl fmt::Display for InvalidStatusCode { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.description()) } diff --git a/src/uri/mod.rs b/src/uri/mod.rs index 066a966b..4319ad35 100644 --- a/src/uri/mod.rs +++ b/src/uri/mod.rs @@ -1026,6 +1026,7 @@ impl From for InvalidUriParts { } impl fmt::Display for InvalidUri { + #[allow(deprecated)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.description().fmt(f) } @@ -1056,6 +1057,7 @@ impl fmt::Display for InvalidUriParts { } impl Error for InvalidUriParts { + #[allow(deprecated)] fn description(&self) -> &str { self.0.description() } From ccd37015a09e19b089993c4a4ccb8f2ecbfdb286 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Fri, 3 Jan 2020 15:39:37 -0800 Subject: [PATCH 4/4] CI with -Dwarnings to deny warnings again --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index d32bf418..583403c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ sudo: false cache: cargo +env: # important! + global: RUSTFLAGS=-Dwarnings + matrix: include: - rust: stable