Skip to content

Rustup to *1.11.0-nightly (7d2f75a95 2016-06-09)* #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
All notable changes to this project will be documented in this file.

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

## 0.0.75 — 2016-06-08
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.75"
version = "0.0.76"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
Expand All @@ -25,7 +25,7 @@ test = false
[dependencies]
regex_macros = { version = "0.1.33", optional = true }
# begin automatic update
clippy_lints = { version = "0.0.75", path = "clippy_lints" }
clippy_lints = { version = "0.0.76", path = "clippy_lints" }
# end automatic update

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_lints"
# begin automatic update
version = "0.0.75"
version = "0.0.76"
# end automatic update
authors = [
"Manish Goregaokar <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/drop_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl LateLintPass for DropRefPass {
fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
if let ExprCall(ref path, ref args) = expr.node {
if let ExprPath(None, _) = path.node {
let def_id = cx.tcx.def_map.borrow()[&path.id].def_id();
let def_id = cx.tcx.expect_def(path.id).def_id();
if match_def_path(cx, def_id, &paths::DROP) {
if args.len() != 1 {
return;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/enum_glob_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ impl EnumGlobUse {
if let ItemUse(ref item_use) = item.node {
if let ViewPath_::ViewPathGlob(_) = item_use.node {
if let Some(def) = cx.tcx.def_map.borrow().get(&item.id) {
if let Some(node_id) = cx.tcx.map.as_local_node_id(def.def_id()) {
if let Some(node_id) = cx.tcx.map.as_local_node_id(def.full_def().def_id()) {
if let Some(NodeItem(it)) = cx.tcx.map.find(node_id) {
if let ItemEnum(..) = it.node {
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
}
}
} else {
let child = cx.sess().cstore.item_children(def.def_id());
let child = cx.sess().cstore.item_children(def.full_def().def_id());
if let Some(child) = child.first() {
if let DefLike::DlDef(Def::Variant(..)) = child.def {
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
Expand Down
12 changes: 6 additions & 6 deletions clippy_lints/src/let_if_seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ impl LateLintPass for LetIfSeq {
let Some(def) = cx.tcx.def_map.borrow().get(&decl.pat.id),
let hir::StmtExpr(ref if_, _) = expr.node,
let hir::ExprIf(ref cond, ref then, ref else_) = if_.node,
!used_in_expr(cx, def.def_id(), cond),
let Some(value) = check_assign(cx, def.def_id(), then),
!used_in_expr(cx, def.def_id(), value),
!used_in_expr(cx, def.full_def().def_id(), cond),
let Some(value) = check_assign(cx, def.full_def().def_id(), then),
!used_in_expr(cx, def.full_def().def_id(), value),
], {
let span = codemap::mk_sp(stmt.span.lo, if_.span.hi);

let (default_multi_stmts, default) = if let Some(ref else_) = *else_ {
if let hir::ExprBlock(ref else_) = else_.node {
if let Some(default) = check_assign(cx, def.def_id(), else_) {
if let Some(default) = check_assign(cx, def.full_def().def_id(), else_) {
(else_.stmts.len() > 1, default)
} else if let Some(ref default) = decl.init {
(true, &**default)
Expand Down Expand Up @@ -139,7 +139,7 @@ impl<'a, 'tcx, 'v> hir::intravisit::Visitor<'v> for UsedVisitor<'a, 'tcx> {
if_let_chain! {[
let hir::ExprPath(None, _) = expr.node,
let Some(def) = self.cx.tcx.def_map.borrow().get(&expr.id),
self.id == def.def_id(),
self.id == def.full_def().def_id(),
], {
self.used = true;
return;
Expand All @@ -156,7 +156,7 @@ fn check_assign<'e>(cx: &LateContext, decl: hir::def_id::DefId, block: &'e hir::
let hir::ExprAssign(ref var, ref value) = expr.node,
let hir::ExprPath(None, _) = var.node,
let Some(def) = cx.tcx.def_map.borrow().get(&var.id),
decl == def.def_id(),
decl == def.full_def().def_id(),
], {
let mut v = UsedVisitor {
cx: cx,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/mem_forget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl LateLintPass for MemForget {
fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
if let ExprCall(ref path_expr, ref args) = e.node {
if let ExprPath(None, _) = path_expr.node {
let def_id = cx.tcx.def_map.borrow()[&path_expr.id].def_id();
let def_id = cx.tcx.expect_def(path_expr.id).def_id();
if match_def_path(cx, def_id, &paths::MEM_FORGET) {
let forgot_ty = cx.tcx.expr_ty(&args[0]);

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/minmax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ enum MinMax {
fn min_max<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(MinMax, Constant, &'a Expr)> {
if let ExprCall(ref path, ref args) = expr.node {
if let ExprPath(None, _) = path.node {
let def_id = cx.tcx.def_map.borrow()[&path.id].def_id();
let def_id = cx.tcx.expect_def(path.id).def_id();

if match_def_path(cx, def_id, &paths::CMP_MIN) {
fetch_const(args, MinMax::Min)
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/needless_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ enum Expression {

fn fetch_bool_block(block: &Block) -> Expression {
match (&*block.stmts, block.expr.as_ref()) {
([], Some(e)) => fetch_bool_expr(&**e),
([ref e], None) => {
(&[], Some(e)) => fetch_bool_expr(&**e),
(&[ref e], None) => {
if let StmtSemi(ref e, _) = e.node {
if let ExprRet(_) = e.node {
fetch_bool_expr(&**e)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl LateLintPass for RegexPass {
args.len() == 1,
let Some(def) = cx.tcx.def_map.borrow().get(&fun.id),
], {
let def_id = def.def_id();
let def_id = def.full_def().def_id();
if match_def_path(cx, def_id, &paths::REGEX_NEW) ||
match_def_path(cx, def_id, &paths::REGEX_BUILDER_NEW) {
check_regex(cx, &args[0], true);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl LateLintPass for Transmute {
fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
if let ExprCall(ref path_expr, ref args) = e.node {
if let ExprPath(None, _) = path_expr.node {
let def_id = cx.tcx.def_map.borrow()[&path_expr.id].def_id();
let def_id = cx.tcx.expect_def(path_expr.id).def_id();

if match_def_path(cx, def_id, &paths::TRANSMUTE) {
let from_ty = cx.tcx.expr_ty(&args[0]);
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ impl LateLintPass for TypePass {
}
if let Some(did) = cx.tcx.def_map.borrow().get(&ast_ty.id) {
if let def::Def::Struct(..) = did.full_def() {
if Some(did.def_id()) == cx.tcx.lang_items.owned_box() {
if Some(did.full_def().def_id()) == cx.tcx.lang_items.owned_box() {
if_let_chain! {[
let TyPath(_, ref path) = ast_ty.node,
let Some(ref last) = path.segments.last(),
let PathParameters::AngleBracketedParameters(ref ag) = last.parameters,
let Some(ref vec) = ag.types.get(0),
let Some(did) = cx.tcx.def_map.borrow().get(&vec.id),
let def::Def::Struct(..) = did.full_def(),
match_def_path(cx, did.def_id(), &paths::VEC),
match_def_path(cx, did.full_def().def_id(), &paths::VEC),
], {
span_help_and_lint(cx,
BOX_VEC,
ast_ty.span,
"you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`",
"`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.");
}}
} else if match_def_path(cx, did.def_id(), &paths::LINKED_LIST) {
} else if match_def_path(cx, did.full_def().def_id(), &paths::LINKED_LIST) {
span_help_and_lint(cx,
LINKEDLIST,
ast_ty.span,
Expand Down