mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Fix dogfood
This commit is contained in:
parent
579791178d
commit
67af127f24
6 changed files with 12 additions and 12 deletions
|
@ -51,7 +51,7 @@ fn unary_pattern(pat: &Pat<'_>) -> bool {
|
|||
false
|
||||
},
|
||||
PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
|
||||
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => !etc.as_opt_usize().is_some() && array_rec(a),
|
||||
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => etc.as_opt_usize().is_none() && array_rec(a),
|
||||
PatKind::Ref(x, _) | PatKind::Box(x) => unary_pattern(x),
|
||||
PatKind::Path(_) | PatKind::Lit(_) => true,
|
||||
}
|
||||
|
|
|
@ -461,7 +461,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
|
|||
sub_visitor.visit_fn_decl(decl);
|
||||
self.nested_elision_site_lts.append(&mut sub_visitor.all_lts());
|
||||
},
|
||||
TyKind::TraitObject(bounds, ref lt, _) => {
|
||||
TyKind::TraitObject(bounds, lt, _) => {
|
||||
if !lt.is_elided() {
|
||||
self.unelided_trait_object_lifetime = true;
|
||||
}
|
||||
|
|
|
@ -308,15 +308,15 @@ fn find_good_method_for_match<'a>(
|
|||
should_be_left: &'a str,
|
||||
should_be_right: &'a str,
|
||||
) -> Option<&'a str> {
|
||||
let pat_left = arms[0].pat;
|
||||
let pat_right = arms[1].pat;
|
||||
let first_pat = arms[0].pat;
|
||||
let second_pat = arms[1].pat;
|
||||
|
||||
let body_node_pair = if (is_pat_variant(cx, pat_left, path_left, expected_item_left))
|
||||
&& (is_pat_variant(cx, pat_right, path_right, expected_item_right))
|
||||
let body_node_pair = if (is_pat_variant(cx, first_pat, path_left, expected_item_left))
|
||||
&& (is_pat_variant(cx, second_pat, path_right, expected_item_right))
|
||||
{
|
||||
(&arms[0].body.kind, &arms[1].body.kind)
|
||||
} else if (is_pat_variant(cx, pat_left, path_left, expected_item_right))
|
||||
&& (is_pat_variant(cx, pat_right, path_right, expected_item_left))
|
||||
} else if (is_pat_variant(cx, first_pat, path_left, expected_item_right))
|
||||
&& (is_pat_variant(cx, second_pat, path_right, expected_item_left))
|
||||
{
|
||||
(&arms[1].body.kind, &arms[0].body.kind)
|
||||
} else {
|
||||
|
|
|
@ -669,7 +669,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args:
|
|||
}
|
||||
|
||||
fn get_rptr_lm<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Option<(&'tcx Lifetime, Mutability, Span)> {
|
||||
if let TyKind::Rptr(ref lt, ref m) = ty.kind {
|
||||
if let TyKind::Rptr(lt, ref m) = ty.kind {
|
||||
Some((lt, m.mutbl, ty.span))
|
||||
} else {
|
||||
None
|
||||
|
|
|
@ -537,7 +537,7 @@ impl Types {
|
|||
QPath::LangItem(..) => {},
|
||||
}
|
||||
},
|
||||
TyKind::Rptr(ref lt, ref mut_ty) => {
|
||||
TyKind::Rptr(lt, ref mut_ty) => {
|
||||
context.is_nested_call = true;
|
||||
if !borrowed_box::check(cx, hir_ty, lt, mut_ty) {
|
||||
self.check_ty(cx, mut_ty.ty, context);
|
||||
|
|
|
@ -962,7 +962,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
|
|||
mut_ty.mutbl.hash(&mut self.s);
|
||||
},
|
||||
TyKind::Rptr(lifetime, ref mut_ty) => {
|
||||
self.hash_lifetime(*lifetime);
|
||||
self.hash_lifetime(lifetime);
|
||||
self.hash_ty(mut_ty.ty);
|
||||
mut_ty.mutbl.hash(&mut self.s);
|
||||
},
|
||||
|
@ -992,7 +992,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
|
|||
in_trait.hash(&mut self.s);
|
||||
},
|
||||
TyKind::TraitObject(_, lifetime, _) => {
|
||||
self.hash_lifetime(*lifetime);
|
||||
self.hash_lifetime(lifetime);
|
||||
},
|
||||
TyKind::Typeof(anon_const) => {
|
||||
self.hash_body(anon_const.body);
|
||||
|
|
Loading…
Reference in a new issue