Skip to content

Commit 871d9fc

Browse files
committed
Make ptr_arg lint warn by default
1 parent cf1e83b commit 871d9fc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ name
4848
[nonsensical_open_options](https://github.com/Manishearth/rust-clippy/wiki#nonsensical_open_options) | warn | nonsensical combination of options for opening a file
4949
[option_unwrap_used](https://github.com/Manishearth/rust-clippy/wiki#option_unwrap_used) | allow | using `Option.unwrap()`, which should at least get a better message using `expect()`
5050
[precedence](https://github.com/Manishearth/rust-clippy/wiki#precedence) | warn | catches operations where precedence may be unclear. See the wiki for a list of cases caught
51-
[ptr_arg](https://github.com/Manishearth/rust-clippy/wiki#ptr_arg) | allow | fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively
51+
[ptr_arg](https://github.com/Manishearth/rust-clippy/wiki#ptr_arg) | warn | fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively
5252
[range_step_by_zero](https://github.com/Manishearth/rust-clippy/wiki#range_step_by_zero) | warn | using Range::step_by(0), which produces an infinite iterator
5353
[redundant_closure](https://github.com/Manishearth/rust-clippy/wiki#redundant_closure) | warn | using redundant closures, i.e. `|a| foo(a)` (which can be written as just `foo`)
5454
[redundant_pattern](https://github.com/Manishearth/rust-clippy/wiki#redundant_pattern) | warn | using `name @ _` in a pattern

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ pub fn plugin_registrar(reg: &mut Registry) {
101101
methods::WRONG_PUB_SELF_CONVENTION,
102102
mut_mut::MUT_MUT,
103103
mutex_atomic::MUTEX_INTEGER,
104-
ptr_arg::PTR_ARG,
105104
shadow::SHADOW_REUSE,
106105
shadow::SHADOW_SAME,
107106
shadow::SHADOW_UNRELATED,
@@ -153,6 +152,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
153152
needless_bool::NEEDLESS_BOOL,
154153
open_options::NONSENSICAL_OPEN_OPTIONS,
155154
precedence::PRECEDENCE,
155+
ptr_arg::PTR_ARG,
156156
ranges::RANGE_STEP_BY_ZERO,
157157
returns::LET_AND_RETURN,
158158
returns::NEEDLESS_RETURN,

src/ptr_arg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Checks for usage of &Vec[_] and &String
22
//!
3-
//! This lint is **allow** by default
3+
//! This lint is **warn** by default
44
55
use rustc::lint::*;
66
use rustc_front::hir::*;
@@ -11,7 +11,7 @@ use utils::{STRING_PATH, VEC_PATH};
1111

1212
declare_lint! {
1313
pub PTR_ARG,
14-
Allow,
14+
Warn,
1515
"fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` \
1616
instead, respectively"
1717
}

0 commit comments

Comments
 (0)