From 16a958b1036ec8a5658aceb6354a042de4ecd1d3 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 16 Jun 2017 11:30:55 +0800 Subject: [PATCH 1/2] rustup to rustc 1.19.0-nightly (258ae6dd9 2017-06-15) --- clippy_lints/src/lib.rs | 4 ++-- clippy_lints/src/utils/paths.rs | 26 +++++++++++++------------- clippy_tests/examples/dlist.rs | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index c91492c4c4b..6d25a642844 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1,7 +1,7 @@ // error-pattern:cargo-clippy #![feature(box_syntax)] -#![feature(collections)] +#![feature(alloc)] #![feature(custom_attribute)] #![feature(i128_type)] #![feature(i128)] @@ -22,7 +22,7 @@ // Only for the compile time checking of paths extern crate core; -extern crate collections; +extern crate alloc; // for unicode nfc normalization extern crate unicode_normalization; diff --git a/clippy_lints/src/utils/paths.rs b/clippy_lints/src/utils/paths.rs index eb997934394..f423274711a 100644 --- a/clippy_lints/src/utils/paths.rs +++ b/clippy_lints/src/utils/paths.rs @@ -3,18 +3,18 @@ pub const ASMUT_TRAIT: [&'static str; 3] = ["core", "convert", "AsMut"]; pub const ASREF_TRAIT: [&'static str; 3] = ["core", "convert", "AsRef"]; pub const BEGIN_PANIC: [&'static str; 3] = ["std", "panicking", "begin_panic"]; -pub const BINARY_HEAP: [&'static str; 3] = ["collections", "binary_heap", "BinaryHeap"]; +pub const BINARY_HEAP: [&'static str; 3] = ["alloc", "binary_heap", "BinaryHeap"]; pub const BORROW_TRAIT: [&'static str; 3] = ["core", "borrow", "Borrow"]; pub const BOX: [&'static str; 3] = ["std", "boxed", "Box"]; pub const BOX_NEW: [&'static str; 4] = ["std", "boxed", "Box", "new"]; -pub const BTREEMAP: [&'static str; 4] = ["collections", "btree", "map", "BTreeMap"]; -pub const BTREEMAP_ENTRY: [&'static str; 4] = ["collections", "btree", "map", "Entry"]; -pub const BTREESET: [&'static str; 4] = ["collections", "btree", "set", "BTreeSet"]; +pub const BTREEMAP: [&'static str; 4] = ["alloc", "btree", "map", "BTreeMap"]; +pub const BTREEMAP_ENTRY: [&'static str; 4] = ["alloc", "btree", "map", "Entry"]; +pub const BTREESET: [&'static str; 4] = ["alloc", "btree", "set", "BTreeSet"]; pub const CLONE: [&'static str; 4] = ["core", "clone", "Clone", "clone"]; pub const CLONE_TRAIT: [&'static str; 3] = ["core", "clone", "Clone"]; pub const CMP_MAX: [&'static str; 3] = ["core", "cmp", "max"]; pub const CMP_MIN: [&'static str; 3] = ["core", "cmp", "min"]; -pub const COW: [&'static str; 3] = ["collections", "borrow", "Cow"]; +pub const COW: [&'static str; 3] = ["alloc", "borrow", "Cow"]; pub const CSTRING_NEW: [&'static str; 5] = ["std", "ffi", "c_str", "CString", "new"]; pub const DEBUG_FMT_METHOD: [&'static str; 4] = ["core", "fmt", "Debug", "fmt"]; pub const DEFAULT_TRAIT: [&'static str; 3] = ["core", "default", "Default"]; @@ -31,7 +31,7 @@ pub const IO_READ: [&'static str; 3] = ["std", "io", "Read"]; pub const IO_WRITE: [&'static str; 3] = ["std", "io", "Write"]; pub const ITERATOR: [&'static str; 4] = ["core", "iter", "iterator", "Iterator"]; -pub const LINKED_LIST: [&'static str; 3] = ["collections", "linked_list", "LinkedList"]; +pub const LINKED_LIST: [&'static str; 3] = ["alloc", "linked_list", "LinkedList"]; pub const LINT: [&'static str; 3] = ["rustc", "lint", "Lint"]; pub const LINT_ARRAY: [&'static str; 3] = ["rustc", "lint", "LintArray"]; pub const MEM_FORGET: [&'static str; 3] = ["core", "mem", "forget"]; @@ -67,12 +67,12 @@ pub const RESULT_ERR: [&'static str; 4] = ["core", "result", "Result", "Err"]; pub const RESULT_OK: [&'static str; 4] = ["core", "result", "Result", "Ok"]; pub const SERDE_DE_VISITOR: [&'static str; 3] = ["serde", "de", "Visitor"]; -pub const SLICE_INTO_VEC: [&'static str; 4] = ["collections", "slice", "", "into_vec"]; -pub const STRING: [&'static str; 3] = ["collections", "string", "String"]; -pub const TO_OWNED: [&'static str; 3] = ["collections", "borrow", "ToOwned"]; -pub const TO_STRING: [&'static str; 3] = ["collections", "string", "ToString"]; +pub const SLICE_INTO_VEC: [&'static str; 4] = ["alloc", "slice", "", "into_vec"]; +pub const STRING: [&'static str; 3] = ["alloc", "string", "String"]; +pub const TO_OWNED: [&'static str; 3] = ["alloc", "borrow", "ToOwned"]; +pub const TO_STRING: [&'static str; 3] = ["alloc", "string", "ToString"]; pub const TRANSMUTE: [&'static str; 4] = ["core", "intrinsics", "", "transmute"]; pub const TRY_INTO_RESULT: [&'static str; 4] = ["std", "ops", "Try", "into_result"]; -pub const VEC: [&'static str; 3] = ["collections", "vec", "Vec"]; -pub const VEC_DEQUE: [&'static str; 3] = ["collections", "vec_deque", "VecDeque"]; -pub const VEC_FROM_ELEM: [&'static str; 3] = ["collections", "vec", "from_elem"]; +pub const VEC: [&'static str; 3] = ["alloc", "vec", "Vec"]; +pub const VEC_DEQUE: [&'static str; 3] = ["alloc", "vec_deque", "VecDeque"]; +pub const VEC_FROM_ELEM: [&'static str; 3] = ["alloc", "vec", "from_elem"]; diff --git a/clippy_tests/examples/dlist.rs b/clippy_tests/examples/dlist.rs index b23aeb70a63..eeeb9c01995 100644 --- a/clippy_tests/examples/dlist.rs +++ b/clippy_tests/examples/dlist.rs @@ -1,4 +1,4 @@ -#![feature(plugin, collections)] +#![feature(plugin, alloc)] #![feature(associated_type_defaults)] #![feature(associated_consts)] @@ -6,8 +6,8 @@ #![warn(clippy)] #![allow(dead_code, needless_pass_by_value)] -extern crate collections; -use collections::linked_list::LinkedList; +extern crate alloc; +use alloc::linked_list::LinkedList; trait Foo { type Baz = LinkedList; From faf7bf6a3e164b79c1d1fc940df80c3755d797d6 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 16 Jun 2017 11:41:41 +0800 Subject: [PATCH 2/2] Update ui tests --- clippy_tests/examples/range.stderr | 32 ------------------------------ 1 file changed, 32 deletions(-) diff --git a/clippy_tests/examples/range.stderr b/clippy_tests/examples/range.stderr index 2f3aa7971d0..7620908b084 100644 --- a/clippy_tests/examples/range.stderr +++ b/clippy_tests/examples/range.stderr @@ -1,11 +1,3 @@ -error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead - --> range.rs:13:5 - | -13 | (0..1).step_by(0); - | ^^^^^^^^^^^^^^^^^ - | - = note: `-D range-step-by-zero` implied by `-D warnings` - error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:13:12 | @@ -22,14 +14,6 @@ error: use of deprecated item: replaced by `Iterator::step_by` | = note: `-D deprecated` implied by `-D warnings` -error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead - --> range.rs:17:5 - | -17 | (1..).step_by(0); - | ^^^^^^^^^^^^^^^^ - | - = note: `-D range-step-by-zero` implied by `-D warnings` - error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:17:11 | @@ -38,14 +22,6 @@ error: use of deprecated item: replaced by `Iterator::step_by` | = note: `-D deprecated` implied by `-D warnings` -error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead - --> range.rs:18:5 - | -18 | (1...2).step_by(0); - | ^^^^^^^^^^^^^^^^^^ - | - = note: `-D range-step-by-zero` implied by `-D warnings` - error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:18:13 | @@ -54,14 +30,6 @@ error: use of deprecated item: replaced by `Iterator::step_by` | = note: `-D deprecated` implied by `-D warnings` -error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead - --> range.rs:21:5 - | -21 | x.step_by(0); - | ^^^^^^^^^^^^ - | - = note: `-D range-step-by-zero` implied by `-D warnings` - error: use of deprecated item: replaced by `Iterator::step_by` --> range.rs:21:7 |