Skip to content

Commit

Permalink
Auto merge of #4013 - kraai:move-path_buf_push_overwrite-to-nursery, …
Browse files Browse the repository at this point in the history
…r=matthiaskrgr

Move path_buf_push_overwrite to nursery

See #4012.

changelog: move `path_buf_push_overwrite` to the nursery
  • Loading branch information
bors committed Apr 21, 2019
2 parents addac4a + 4171299 commit d420589
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
panic_unimplemented::PANIC_PARAMS,
partialeq_ne_impl::PARTIALEQ_NE_IMPL,
path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
precedence::PRECEDENCE,
ptr::CMP_NULL,
ptr::MUT_FROM_REF,
Expand Down Expand Up @@ -1075,7 +1074,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
open_options::NONSENSICAL_OPEN_OPTIONS,
path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
ptr::MUT_FROM_REF,
ranges::ITERATOR_STEP_BY_ZERO,
regex::INVALID_REGEX,
Expand Down Expand Up @@ -1125,6 +1123,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
missing_const_for_fn::MISSING_CONST_FOR_FN,
mutex_atomic::MUTEX_INTEGER,
needless_borrow::NEEDLESS_BORROW,
path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
redundant_clone::REDUNDANT_CLONE,
unwrap::PANICKING_UNWRAP,
unwrap::UNNECESSARY_UNWRAP,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/path_buf_push_overwrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ declare_clippy_lint! {
/// assert_eq!(x, PathBuf::from("/foo/bar"));
/// ```
pub PATH_BUF_PUSH_OVERWRITE,
correctness,
nursery,
"calling `push` with file system root on `PathBuf` can overwrite it"
}

Expand Down
1 change: 1 addition & 0 deletions tests/ui/path_buf_push_overwrite.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-rustfix
use std::path::PathBuf;

#[warn(clippy::all, clippy::path_buf_push_overwrite)]
fn main() {
let mut x = PathBuf::from("/foo");
x.push("bar");
Expand Down
1 change: 1 addition & 0 deletions tests/ui/path_buf_push_overwrite.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-rustfix
use std::path::PathBuf;

#[warn(clippy::all, clippy::path_buf_push_overwrite)]
fn main() {
let mut x = PathBuf::from("/foo");
x.push("/bar");
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/path_buf_push_overwrite.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Calling `push` with '/' or '/' (file system root) will overwrite the previous path definition
--> $DIR/path_buf_push_overwrite.rs:6:12
--> $DIR/path_buf_push_overwrite.rs:7:12
|
LL | x.push("/bar");
| ^^^^^^ help: try: `"bar"`
|
= note: #[deny(clippy::path_buf_push_overwrite)] on by default
= note: `-D clippy::path-buf-push-overwrite` implied by `-D warnings`

error: aborting due to previous error

0 comments on commit d420589

Please sign in to comment.