Skip to content

Commit a55a960

Browse files
authored
Merge pull request #1004 from Manishearth/rustup
Rustup to *1.11.0-nightly (7d2f75a 2016-06-09)*
2 parents 91d922a + 17dd0da commit a55a960

12 files changed

+22
-21
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
All notable changes to this project will be documented in this file.
33

44
## 0.0.76 — TBD
5+
* Rustup to *rustc 1.11.0-nightly (7d2f75a95 2016-06-09)*
56
* `cargo clippy` now automatically defines the `clippy` feature
67

78
## 0.0.75 — 2016-06-08

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.75"
3+
version = "0.0.76"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",
@@ -25,7 +25,7 @@ test = false
2525
[dependencies]
2626
regex_macros = { version = "0.1.33", optional = true }
2727
# begin automatic update
28-
clippy_lints = { version = "0.0.75", path = "clippy_lints" }
28+
clippy_lints = { version = "0.0.76", path = "clippy_lints" }
2929
# end automatic update
3030

3131
[dev-dependencies]

clippy_lints/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.0.75"
4+
version = "0.0.76"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <[email protected]>",

clippy_lints/src/drop_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl LateLintPass for DropRefPass {
3535
fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
3636
if let ExprCall(ref path, ref args) = expr.node {
3737
if let ExprPath(None, _) = path.node {
38-
let def_id = cx.tcx.def_map.borrow()[&path.id].def_id();
38+
let def_id = cx.tcx.expect_def(path.id).def_id();
3939
if match_def_path(cx, def_id, &paths::DROP) {
4040
if args.len() != 1 {
4141
return;

clippy_lints/src/enum_glob_use.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ impl EnumGlobUse {
4444
if let ItemUse(ref item_use) = item.node {
4545
if let ViewPath_::ViewPathGlob(_) = item_use.node {
4646
if let Some(def) = cx.tcx.def_map.borrow().get(&item.id) {
47-
if let Some(node_id) = cx.tcx.map.as_local_node_id(def.def_id()) {
47+
if let Some(node_id) = cx.tcx.map.as_local_node_id(def.full_def().def_id()) {
4848
if let Some(NodeItem(it)) = cx.tcx.map.find(node_id) {
4949
if let ItemEnum(..) = it.node {
5050
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
5151
}
5252
}
5353
} else {
54-
let child = cx.sess().cstore.item_children(def.def_id());
54+
let child = cx.sess().cstore.item_children(def.full_def().def_id());
5555
if let Some(child) = child.first() {
5656
if let DefLike::DlDef(Def::Variant(..)) = child.def {
5757
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");

clippy_lints/src/let_if_seq.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ impl LateLintPass for LetIfSeq {
6969
let Some(def) = cx.tcx.def_map.borrow().get(&decl.pat.id),
7070
let hir::StmtExpr(ref if_, _) = expr.node,
7171
let hir::ExprIf(ref cond, ref then, ref else_) = if_.node,
72-
!used_in_expr(cx, def.def_id(), cond),
73-
let Some(value) = check_assign(cx, def.def_id(), then),
74-
!used_in_expr(cx, def.def_id(), value),
72+
!used_in_expr(cx, def.full_def().def_id(), cond),
73+
let Some(value) = check_assign(cx, def.full_def().def_id(), then),
74+
!used_in_expr(cx, def.full_def().def_id(), value),
7575
], {
7676
let span = codemap::mk_sp(stmt.span.lo, if_.span.hi);
7777

7878
let (default_multi_stmts, default) = if let Some(ref else_) = *else_ {
7979
if let hir::ExprBlock(ref else_) = else_.node {
80-
if let Some(default) = check_assign(cx, def.def_id(), else_) {
80+
if let Some(default) = check_assign(cx, def.full_def().def_id(), else_) {
8181
(else_.stmts.len() > 1, default)
8282
} else if let Some(ref default) = decl.init {
8383
(true, &**default)
@@ -139,7 +139,7 @@ impl<'a, 'tcx, 'v> hir::intravisit::Visitor<'v> for UsedVisitor<'a, 'tcx> {
139139
if_let_chain! {[
140140
let hir::ExprPath(None, _) = expr.node,
141141
let Some(def) = self.cx.tcx.def_map.borrow().get(&expr.id),
142-
self.id == def.def_id(),
142+
self.id == def.full_def().def_id(),
143143
], {
144144
self.used = true;
145145
return;
@@ -156,7 +156,7 @@ fn check_assign<'e>(cx: &LateContext, decl: hir::def_id::DefId, block: &'e hir::
156156
let hir::ExprAssign(ref var, ref value) = expr.node,
157157
let hir::ExprPath(None, _) = var.node,
158158
let Some(def) = cx.tcx.def_map.borrow().get(&var.id),
159-
decl == def.def_id(),
159+
decl == def.full_def().def_id(),
160160
], {
161161
let mut v = UsedVisitor {
162162
cx: cx,

clippy_lints/src/mem_forget.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl LateLintPass for MemForget {
2727
fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
2828
if let ExprCall(ref path_expr, ref args) = e.node {
2929
if let ExprPath(None, _) = path_expr.node {
30-
let def_id = cx.tcx.def_map.borrow()[&path_expr.id].def_id();
30+
let def_id = cx.tcx.expect_def(path_expr.id).def_id();
3131
if match_def_path(cx, def_id, &paths::MEM_FORGET) {
3232
let forgot_ty = cx.tcx.expr_ty(&args[0]);
3333

clippy_lints/src/minmax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ enum MinMax {
5555
fn min_max<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(MinMax, Constant, &'a Expr)> {
5656
if let ExprCall(ref path, ref args) = expr.node {
5757
if let ExprPath(None, _) = path.node {
58-
let def_id = cx.tcx.def_map.borrow()[&path.id].def_id();
58+
let def_id = cx.tcx.expect_def(path.id).def_id();
5959

6060
if match_def_path(cx, def_id, &paths::CMP_MIN) {
6161
fetch_const(args, MinMax::Min)

clippy_lints/src/needless_bool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ enum Expression {
155155

156156
fn fetch_bool_block(block: &Block) -> Expression {
157157
match (&*block.stmts, block.expr.as_ref()) {
158-
([], Some(e)) => fetch_bool_expr(&**e),
159-
([ref e], None) => {
158+
(&[], Some(e)) => fetch_bool_expr(&**e),
159+
(&[ref e], None) => {
160160
if let StmtSemi(ref e, _) = e.node {
161161
if let ExprRet(_) = e.node {
162162
fetch_bool_expr(&**e)

clippy_lints/src/regex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl LateLintPass for RegexPass {
103103
args.len() == 1,
104104
let Some(def) = cx.tcx.def_map.borrow().get(&fun.id),
105105
], {
106-
let def_id = def.def_id();
106+
let def_id = def.full_def().def_id();
107107
if match_def_path(cx, def_id, &paths::REGEX_NEW) ||
108108
match_def_path(cx, def_id, &paths::REGEX_BUILDER_NEW) {
109109
check_regex(cx, &args[0], true);

clippy_lints/src/transmute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl LateLintPass for Transmute {
6060
fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
6161
if let ExprCall(ref path_expr, ref args) = e.node {
6262
if let ExprPath(None, _) = path_expr.node {
63-
let def_id = cx.tcx.def_map.borrow()[&path_expr.id].def_id();
63+
let def_id = cx.tcx.expect_def(path_expr.id).def_id();
6464

6565
if match_def_path(cx, def_id, &paths::TRANSMUTE) {
6666
let from_ty = cx.tcx.expr_ty(&args[0]);

clippy_lints/src/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ impl LateLintPass for TypePass {
5656
}
5757
if let Some(did) = cx.tcx.def_map.borrow().get(&ast_ty.id) {
5858
if let def::Def::Struct(..) = did.full_def() {
59-
if Some(did.def_id()) == cx.tcx.lang_items.owned_box() {
59+
if Some(did.full_def().def_id()) == cx.tcx.lang_items.owned_box() {
6060
if_let_chain! {[
6161
let TyPath(_, ref path) = ast_ty.node,
6262
let Some(ref last) = path.segments.last(),
6363
let PathParameters::AngleBracketedParameters(ref ag) = last.parameters,
6464
let Some(ref vec) = ag.types.get(0),
6565
let Some(did) = cx.tcx.def_map.borrow().get(&vec.id),
6666
let def::Def::Struct(..) = did.full_def(),
67-
match_def_path(cx, did.def_id(), &paths::VEC),
67+
match_def_path(cx, did.full_def().def_id(), &paths::VEC),
6868
], {
6969
span_help_and_lint(cx,
7070
BOX_VEC,
7171
ast_ty.span,
7272
"you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`",
7373
"`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.");
7474
}}
75-
} else if match_def_path(cx, did.def_id(), &paths::LINKED_LIST) {
75+
} else if match_def_path(cx, did.full_def().def_id(), &paths::LINKED_LIST) {
7676
span_help_and_lint(cx,
7777
LINKEDLIST,
7878
ast_ty.span,

0 commit comments

Comments
 (0)