run rustfmt

This commit is contained in:
Matthias Krüger 2018-12-09 12:03:10 +01:00
parent a3c77f6ad1
commit 273dc82872
3 changed files with 10 additions and 5 deletions

View File

@ -1358,7 +1358,10 @@ fn lint_clone_on_copy(cx: &LateContext<'_, '_>, expr: &hir::Expr, arg: &hir::Exp
_ => {},
}
let deref_count = cx.tables.expr_adjustments(arg).iter()
let deref_count = cx
.tables
.expr_adjustments(arg)
.iter()
.filter(|adj| {
if let ty::adjustment::Adjust::Deref(_) = adj.kind {
true

View File

@ -30,7 +30,7 @@ use crate::utils::{
clip, comparisons, differing_macro_contexts, higher, in_constant, in_macro, int_bits, last_path_segment,
match_def_path, match_path, multispan_sugg, opt_def_id, same_tys, sext, snippet, snippet_opt,
snippet_with_applicability, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext,
AbsolutePathBuffer
AbsolutePathBuffer,
};
use if_chain::if_chain;
use std::borrow::Cow;
@ -1031,9 +1031,11 @@ fn is_c_void(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>) -> bool {
let mut apb = AbsolutePathBuffer { names: vec![] };
tcx.push_item_path(&mut apb, adt.did, false);
if apb.names.is_empty() { return false }
if apb.names.is_empty() {
return false;
}
if apb.names[0] == "libc" || apb.names[0] == "core" && *apb.names.last().unwrap() == "c_void" {
return true
return true;
}
}
false

View File

@ -28,8 +28,8 @@ use crate::syntax::ast::{self, LitKind};
use crate::syntax::attr;
use crate::syntax::errors::DiagnosticBuilder;
use crate::syntax::source_map::{Span, DUMMY_SP};
use crate::syntax::symbol::{keywords, Symbol};
use crate::syntax::symbol;
use crate::syntax::symbol::{keywords, Symbol};
use if_chain::if_chain;
use matches::matches;
use std::borrow::Cow;