Skip to content
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

rustup to rustc 1.19.0-nightly (258ae6dd9 2017-06-15) #1833

Merged
merged 2 commits into from
Jun 16, 2017
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
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// error-pattern:cargo-clippy

#![feature(box_syntax)]
#![feature(collections)]
#![feature(alloc)]
#![feature(custom_attribute)]
#![feature(i128_type)]
#![feature(i128)]
Expand All @@ -22,7 +22,7 @@ extern crate toml;

// 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;
Expand Down
26 changes: 13 additions & 13 deletions clippy_lints/src/utils/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -31,7 +31,7 @@ pub const IO_PRINT: [&'static str; 4] = ["std", "io", "stdio", "_print"];
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"];
Expand Down Expand Up @@ -67,12 +67,12 @@ pub const RESULT: [&'static str; 3] = ["core", "result", "Result"];
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", "<impl [T]>", "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", "<impl [T]>", "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"];
6 changes: 3 additions & 3 deletions clippy_tests/examples/dlist.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![feature(plugin, collections)]
#![feature(plugin, alloc)]
#![feature(associated_type_defaults)]
#![feature(associated_consts)]

#![plugin(clippy)]
#![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<u8>;
Expand Down
32 changes: 0 additions & 32 deletions clippy_tests/examples/range.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
error: Range::step_by(0) produces an infinite iterator. Consider using `std::iter::repeat()` instead
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this got removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@messense step_by is no longer a Range method due to rust-lang/rust#42310. These lines in clippy_lints/src/ranges.rs should be modified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess it's better to rewrite it to lint on Iterator::step_by(0)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, Iterator::step_by has assert!(step != 0);, it will panic if the given step is 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #95 no longer applies I'd vote for accepting the changeset and deprecating the lint later.

cc @llogiq

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

--> 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
|
Expand All @@ -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
|
Expand All @@ -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
|
Expand All @@ -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
|
Expand Down