Skip to content

Commit

Permalink
Rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Feb 13, 2019
1 parent db13e6f commit 5a3cd31
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/cyclomatic_complexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl CyclomaticComplexity {
returns,
..
} = helper;
let ret_ty = cx.tables.node_id_to_type(expr.hir_id);
let ret_ty = cx.tables.node_type(expr.hir_id);
let ret_adjust = if match_type(cx, ret_ty, &paths::RESULT) {
returns
} else {
Expand Down Expand Up @@ -159,7 +159,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
},
ExprKind::Call(ref callee, _) => {
walk_expr(self, e);
let ty = self.cx.tables.node_id_to_type(callee.hir_id);
let ty = self.cx.tables.node_type(callee.hir_id);
match ty.sty {
ty::FnDef(..) | ty::FnPtr(_) => {
let sig = ty.fn_sig(self.cx.tcx);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/eta_reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn get_ufcs_type_name(
self_arg: &Expr,
) -> std::option::Option<String> {
let expected_type_of_self = &cx.tcx.fn_sig(method_def_id).inputs_and_output().skip_binder()[0].sty;
let actual_type_of_self = &cx.tables.node_id_to_type(self_arg.hir_id).sty;
let actual_type_of_self = &cx.tables.node_type(self_arg.hir_id).sty;

if let Some(trait_id) = cx.tcx.trait_of_item(method_def_id) {
//if the method expectes &self, ufcs requires explicit borrowing so closure can't be removed
Expand Down
1 change: 0 additions & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(slice_patterns)]
#![feature(stmt_expr_attributes)]
#![feature(range_contains)]
#![feature(str_escape)]
#![allow(clippy::missing_docs_in_private_items)]
#![recursion_limit = "256"]
#![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
if index_used_directly {
self.indexed_directly.insert(
seqvar.segments[0].ident.name,
(Some(extent), self.cx.tables.node_id_to_type(seqexpr.hir_id)),
(Some(extent), self.cx.tables.node_type(seqexpr.hir_id)),
);
}
return false; // no need to walk further *on the variable*
Expand All @@ -1793,7 +1793,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
if index_used_directly {
self.indexed_directly.insert(
seqvar.segments[0].ident.name,
(None, self.cx.tables.node_id_to_type(seqexpr.hir_id)),
(None, self.cx.tables.node_type(seqexpr.hir_id)),
);
}
return false; // no need to walk further *on the variable*
Expand Down Expand Up @@ -2418,7 +2418,7 @@ fn check_needless_collect<'a, 'tcx>(expr: &'tcx Expr, cx: &LateContext<'a, 'tcx>
if let Some(ref generic_args) = chain_method.args;
if let Some(GenericArg::Type(ref ty)) = generic_args.args.get(0);
then {
let ty = cx.tables.node_id_to_type(ty.hir_id);
let ty = cx.tables.node_type(ty.hir_id);
if match_type(cx, ty, &paths::VEC) ||
match_type(cx, ty, &paths::VEC_DEQUE) ||
match_type(cx, ty, &paths::BTREEMAP) ||
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn check_local<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, local: &'tcx Local, binding
}

fn is_binding(cx: &LateContext<'_, '_>, pat_id: HirId) -> bool {
let var_ty = cx.tables.node_id_to_type(pat_id);
let var_ty = cx.tables.node_type(pat_id);
match var_ty.sty {
ty::Adt(..) => false,
_ => true,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RefToMut {
if let TyKind::Ptr(MutTy { mutbl: Mutability::MutMutable, .. }) = t.node;
if let ExprKind::Cast(e, t) = &e.node;
if let TyKind::Ptr(MutTy { mutbl: Mutability::MutImmutable, .. }) = t.node;
if let ty::Ref(..) = cx.tables.node_id_to_type(e.hir_id).sty;
if let ty::Ref(..) = cx.tables.node_type(e.hir_id).sty;
then {
span_lint(
cx,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
}
match stmt.node {
hir::StmtKind::Local(ref local) => {
println!("local variable of type {}", cx.tables.node_id_to_type(local.hir_id));
println!("local variable of type {}", cx.tables.node_type(local.hir_id));
println!("pattern:");
print_pat(cx, &local.pat, 0);
if let Some(ref e) = local.init {
Expand Down

0 comments on commit 5a3cd31

Please sign in to comment.