mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Fix false positives
This commit is contained in:
parent
b35c04f7dc
commit
e6fa163fad
2 changed files with 27 additions and 0 deletions
|
@ -565,6 +565,7 @@ fn report_extra_impl_lifetimes<'tcx>(cx: &LateContext<'tcx>, impl_: &'tcx Impl<'
|
||||||
.collect();
|
.collect();
|
||||||
let mut checker = LifetimeChecker::<mir_nested_filter::All>::new(cx, hs);
|
let mut checker = LifetimeChecker::<mir_nested_filter::All>::new(cx, hs);
|
||||||
|
|
||||||
|
walk_generics(&mut checker, &impl_.generics);
|
||||||
if let Some(ref trait_ref) = impl_.of_trait {
|
if let Some(ref trait_ref) = impl_.of_trait {
|
||||||
walk_trait_ref(&mut checker, trait_ref);
|
walk_trait_ref(&mut checker, trait_ref);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,30 @@ mod issue6437 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/rust-lang/rust-clippy/pull/8737#pullrequestreview-951268213
|
||||||
|
mod first_case {
|
||||||
|
use serde::de::Visitor;
|
||||||
|
pub trait Expected {
|
||||||
|
fn fmt(&self, formatter: &mut std::fmt::Formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'de, T> Expected for T
|
||||||
|
where
|
||||||
|
T: Visitor<'de>,
|
||||||
|
{
|
||||||
|
fn fmt(&self, formatter: &mut std::fmt::Formatter) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/rust-lang/rust-clippy/pull/8737#pullrequestreview-951268213
|
||||||
|
mod second_case {
|
||||||
|
pub trait Source {
|
||||||
|
fn hey();
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
|
||||||
|
fn hey() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Reference in a new issue