Skip to content

Commit 61bfaeb

Browse files
committed
Merge branch 'rustup'
2 parents 6d60b3d + c86a5cc commit 61bfaeb

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.36"
3+
version = "0.0.37"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",

src/bit_mask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc::lint::*;
22
use rustc::middle::const_eval::lookup_const_by_id;
3-
use rustc::middle::def::*;
3+
use rustc::middle::def::{Def, PathResolution};
44
use rustc_front::hir::*;
55
use rustc_front::util::is_comparison_binop;
66
use syntax::codemap::Span;
@@ -274,7 +274,7 @@ fn fetch_int_literal(cx: &LateContext, lit: &Expr) -> Option<u64> {
274274
// borrowing.
275275
let def_map = cx.tcx.def_map.borrow();
276276
match def_map.get(&lit.id) {
277-
Some(&PathResolution { base_def: DefConst(def_id), ..}) => Some(def_id),
277+
Some(&PathResolution { base_def: Def::Const(def_id), ..}) => Some(def_id),
278278
_ => None,
279279
}
280280
}

src/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use rustc::lint::LateContext;
44
use rustc::middle::const_eval::lookup_const_by_id;
55
use rustc::middle::def::PathResolution;
6-
use rustc::middle::def::Def::*;
6+
use rustc::middle::def::Def;
77
use rustc_front::hir::*;
88
use syntax::ptr::P;
99
use std::char;
@@ -481,7 +481,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
481481
fn fetch_path(&mut self, e: &Expr) -> Option<Constant> {
482482
if let Some(lcx) = self.lcx {
483483
let mut maybe_id = None;
484-
if let Some(&PathResolution { base_def: DefConst(id), ..}) = lcx.tcx.def_map.borrow().get(&e.id) {
484+
if let Some(&PathResolution { base_def: Def::Const(id), ..}) = lcx.tcx.def_map.borrow().get(&e.id) {
485485
maybe_id = Some(id);
486486
}
487487
// separate if lets to avoid double borrowing the def_map

src/escape.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc::lint::*;
2+
use rustc::front::map::Node::NodeStmt;
23
use rustc_front::hir::*;
34
use rustc_front::intravisit as visit;
4-
use rustc::front::map::Node;
55
use rustc::middle::ty;
66
use rustc::middle::ty::adjustment::AutoAdjustment;
77
use rustc::middle::expr_use_visitor::*;
@@ -91,7 +91,7 @@ impl<'a, 'tcx: 'a> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
9191
return;
9292
}
9393
if let Categorization::Rvalue(..) = cmt.cat {
94-
if let Some(Node::NodeStmt(st)) = self.cx
94+
if let Some(NodeStmt(st)) = self.cx
9595
.tcx
9696
.map
9797
.find(self.cx.tcx.map.get_parent_node(cmt.id)) {

src/lifetimes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use reexport::*;
33
use rustc::lint::*;
44
use syntax::codemap::Span;
55
use rustc_front::intravisit::{Visitor, walk_ty, walk_ty_param_bound, walk_fn_decl, walk_generics};
6-
use rustc::middle::def::Def::{DefTy, DefTrait, DefStruct};
6+
use rustc::middle::def::Def;
77
use std::collections::{HashSet, HashMap};
88

99
use utils::{in_external_macro, span_lint};
@@ -206,13 +206,13 @@ impl<'v, 't> RefVisitor<'v, 't> {
206206
if params.lifetimes.is_empty() {
207207
if let Some(def) = self.cx.tcx.def_map.borrow().get(&ty.id).map(|r| r.full_def()) {
208208
match def {
209-
DefTy(def_id, _) | DefStruct(def_id) => {
209+
Def::TyAlias(def_id) | Def::Struct(def_id) => {
210210
let type_scheme = self.cx.tcx.lookup_item_type(def_id);
211211
for _ in type_scheme.generics.regions.as_slice() {
212212
self.record(&None);
213213
}
214214
}
215-
DefTrait(def_id) => {
215+
Def::Trait(def_id) => {
216216
let trait_def = self.cx.tcx.trait_defs.borrow()[&def_id];
217217
for _ in &trait_def.generics.regions {
218218
self.record(&None);

src/loops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_front::hir::*;
33
use reexport::*;
44
use rustc_front::intravisit::{Visitor, walk_expr, walk_block, walk_decl};
55
use rustc::middle::ty;
6-
use rustc::middle::def::DefLocal;
6+
use rustc::middle::def::Def;
77
use consts::{constant_simple, Constant};
88
use rustc::front::map::Node::NodeBlock;
99
use std::borrow::Cow;
@@ -768,7 +768,7 @@ impl<'v, 't> Visitor<'v> for InitializeVisitor<'v, 't> {
768768

769769
fn var_def_id(cx: &LateContext, expr: &Expr) -> Option<NodeId> {
770770
if let Some(path_res) = cx.tcx.def_map.borrow().get(&expr.id) {
771-
if let DefLocal(_, node_id) = path_res.base_def {
771+
if let Def::Local(_, node_id) = path_res.base_def {
772772
return Some(node_id);
773773
}
774774
}

src/no_effect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
2-
use rustc::middle::def::{DefStruct, DefVariant};
2+
use rustc::middle::def::Def;
33
use rustc_front::hir::{Expr, ExprCall, ExprLit, ExprPath, ExprStruct};
44
use rustc_front::hir::{Stmt, StmtSemi};
55

@@ -36,8 +36,8 @@ fn has_no_effect(cx: &LateContext, expr: &Expr) -> bool {
3636
ExprCall(ref callee, ref args) => {
3737
let def = cx.tcx.def_map.borrow().get(&callee.id).map(|d| d.full_def());
3838
match def {
39-
Some(DefStruct(..)) |
40-
Some(DefVariant(..)) => args.iter().all(|arg| has_no_effect(cx, arg)),
39+
Some(Def::Struct(..)) |
40+
Some(Def::Variant(..)) => args.iter().all(|arg| has_no_effect(cx, arg)),
4141
_ => false,
4242
}
4343
}

src/ptr_arg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
use rustc::lint::*;
66
use rustc_front::hir::*;
7+
use rustc::front::map::NodeItem;
78
use rustc::middle::ty;
8-
use rustc::front::map::Node;
99

1010
use utils::{span_lint, match_type};
1111
use utils::{STRING_PATH, VEC_PATH};
@@ -42,7 +42,7 @@ impl LateLintPass for PtrArg {
4242

4343
fn check_impl_item(&mut self, cx: &LateContext, item: &ImplItem) {
4444
if let ImplItemKind::Method(ref sig, _) = item.node {
45-
if let Some(Node::NodeItem(it)) = cx.tcx.map.find(cx.tcx.map.get_parent(item.id)) {
45+
if let Some(NodeItem(it)) = cx.tcx.map.find(cx.tcx.map.get_parent(item.id)) {
4646
if let ItemImpl(_, _, _, Some(_), _, _) = it.node {
4747
return; // ignore trait impls
4848
}

src/shadow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use syntax::codemap::Span;
55
use rustc_front::intravisit::{Visitor, FnKind};
66

77
use rustc::lint::*;
8-
use rustc::middle::def::Def::{DefVariant, DefStruct};
8+
use rustc::middle::def::Def;
99

1010
use utils::{is_from_for_desugar, in_external_macro, snippet, span_lint, span_note_and_lint, DiagnosticWrapper};
1111

@@ -103,7 +103,7 @@ fn check_decl(cx: &LateContext, decl: &Decl, bindings: &mut Vec<(Name, Span)>) {
103103

104104
fn is_binding(cx: &LateContext, pat: &Pat) -> bool {
105105
match cx.tcx.def_map.borrow().get(&pat.id).map(|d| d.full_def()) {
106-
Some(DefVariant(..)) | Some(DefStruct(..)) => false,
106+
Some(Def::Variant(..)) | Some(Def::Struct(..)) => false,
107107
_ => true,
108108
}
109109
}

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub fn get_trait_def_id(cx: &LateContext, path: &[&str]) -> Option<DefId> {
238238
};
239239

240240
match def {
241-
cstore::DlDef(def::DefTrait(trait_id)) => Some(trait_id),
241+
cstore::DlDef(def::Def::Trait(trait_id)) => Some(trait_id),
242242
_ => None,
243243
}
244244
}

0 commit comments

Comments
 (0)