diff --git a/Cargo.toml b/Cargo.toml index a22658e8ee..fd5d2e3e30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,10 @@ members = [ ] [workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] } +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(nightly)', + 'cfg(rust_analyzer)', +] } rust_2018_idioms = "warn" async_fn_in_trait = "allow" refining_impl_trait = "allow" diff --git a/contrib/dyn_templates/src/engine/mod.rs b/contrib/dyn_templates/src/engine/mod.rs index b190a52bb9..7c78df511d 100644 --- a/contrib/dyn_templates/src/engine/mod.rs +++ b/contrib/dyn_templates/src/engine/mod.rs @@ -20,6 +20,8 @@ mod minijinja; #[cfg(feature = "minijinja")] use ::minijinja::Environment; +// false positive cause by the use of features +#[allow(unused)] pub(crate) trait Engine: Send + Sync + Sized + 'static { const EXT: &'static str; @@ -98,7 +100,11 @@ impl Engines { #[cfg(feature = "minijinja")] Environment::EXT, ]; + // false positive cause by the use of features + #[allow(unused_variables)] pub(crate) fn init(templates: &HashMap) -> Option { + // false positive cause by the use of features + #[allow(unused)] fn inner(templates: &HashMap) -> Option { let named_templates = templates.iter() .filter(|&(_, i)| i.engine_ext == E::EXT) @@ -127,6 +133,8 @@ impl Engines { }) } + // false positive cause by the use of features + #[allow(unused_variables)] pub(crate) fn render( &self, name: &str, diff --git a/core/http/src/uri/uri.rs b/core/http/src/uri/uri.rs index 14360e7bc1..03ba0297fe 100644 --- a/core/http/src/uri/uri.rs +++ b/core/http/src/uri/uri.rs @@ -79,7 +79,7 @@ impl<'a> Uri<'a> { /// // Invalid URIs fail to parse. /// Uri::parse::("foo bar").expect_err("invalid URI"); /// ``` - pub fn parse(string: &'a str) -> Result, Error<'_>> + pub fn parse(string: &'a str) -> Result, Error<'a>> where T: Into> + TryFrom<&'a str, Error = Error<'a>> { T::try_from(string).map(|v| v.into()) @@ -127,7 +127,7 @@ impl<'a> Uri<'a> { /// let uri: Origin = uri!("/a/b/c?query"); /// let uri: Reference = uri!("/a/b/c?query#fragment"); /// ``` - pub fn parse_any(string: &'a str) -> Result, Error<'_>> { + pub fn parse_any(string: &'a str) -> Result, Error<'a>> { crate::parse::uri::from_str(string) } diff --git a/core/lib/src/form/context.rs b/core/lib/src/form/context.rs index b733c83607..e91b281f8d 100644 --- a/core/lib/src/form/context.rs +++ b/core/lib/src/form/context.rs @@ -219,7 +219,7 @@ impl<'v> Context<'v> { /// let foo_bar = form.context.field_errors("foo.bar"); /// } /// ``` - pub fn field_errors<'a, N>(&'a self, name: N) -> impl Iterator> + '_ + pub fn field_errors<'a, N>(&'a self, name: N) -> impl Iterator> + 'a where N: AsRef + 'a { self.errors.values() @@ -267,7 +267,7 @@ impl<'v> Context<'v> { /// let foo_bar = form.context.exact_field_errors("foo.bar"); /// } /// ``` - pub fn exact_field_errors<'a, N>(&'a self, name: N) -> impl Iterator> + '_ + pub fn exact_field_errors<'a, N>(&'a self, name: N) -> impl Iterator> + 'a where N: AsRef + 'a { self.errors.values()