Skip to content

Commit 72da101

Browse files
committed
Auto merge of #4368 - RalfJung:invalid_ref, r=oli-obk
deprecate invalid_ref lint This fixes the `invalid_ref` lint test to no longer fail when rust-lang/rust#63346 lands. I also fixed the lint itself, because its wording made no sense: there is no "reference to zeroed/uninitialized memory" here. changelog: none
2 parents c55d38e + 40fea7a commit 72da101

File tree

9 files changed

+11
-172
lines changed

9 files changed

+11
-172
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,6 @@ Released 2018-09-13
982982
[`integer_division`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
983983
[`into_iter_on_array`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_array
984984
[`into_iter_on_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
985-
[`invalid_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_ref
986985
[`invalid_regex`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex
987986
[`invalid_upcast_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons
988987
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
88

9-
[There are 310 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
9+
[There are 309 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1010

1111
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
1212

clippy_lints/src/deprecated_lints.rs

+9
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,12 @@ declare_deprecated_lint! {
113113
pub UNSAFE_VECTOR_INITIALIZATION,
114114
"the replacement suggested by this lint had substantially different behavior"
115115
}
116+
117+
/// **What it does:** Nothing. This lint has been deprecated.
118+
///
119+
/// **Deprecation reason:** This lint has been superseded by the warn-by-default
120+
/// `invalid_value` rustc lint.
121+
declare_clippy_lint! {
122+
pub INVALID_REF,
123+
"superseded by rustc lint `invalid_value`"
124+
}

clippy_lints/src/invalid_ref.rs

-55
This file was deleted.

clippy_lints/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ pub mod inherent_to_string;
200200
pub mod inline_fn_without_body;
201201
pub mod int_plus_one;
202202
pub mod integer_division;
203-
pub mod invalid_ref;
204203
pub mod items_after_statements;
205204
pub mod large_enum_variant;
206205
pub mod len_zero;
@@ -558,7 +557,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
558557
reg.register_late_lint_pass(box bytecount::ByteCount);
559558
reg.register_late_lint_pass(box infinite_iter::InfiniteIter);
560559
reg.register_late_lint_pass(box inline_fn_without_body::InlineFnWithoutBody);
561-
reg.register_late_lint_pass(box invalid_ref::InvalidRef);
562560
reg.register_late_lint_pass(box identity_conversion::IdentityConversion::default());
563561
reg.register_late_lint_pass(box types::ImplicitHasher);
564562
reg.register_early_lint_pass(box redundant_static_lifetimes::RedundantStaticLifetimes);
@@ -736,7 +734,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
736734
inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY,
737735
inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
738736
int_plus_one::INT_PLUS_ONE,
739-
invalid_ref::INVALID_REF,
740737
large_enum_variant::LARGE_ENUM_VARIANT,
741738
len_zero::LEN_WITHOUT_IS_EMPTY,
742739
len_zero::LEN_ZERO,
@@ -1094,7 +1091,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
10941091
infinite_iter::INFINITE_ITER,
10951092
inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY,
10961093
inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
1097-
invalid_ref::INVALID_REF,
10981094
literal_representation::MISTYPED_LITERAL_SUFFIXES,
10991095
loops::FOR_LOOP_OVER_OPTION,
11001096
loops::FOR_LOOP_OVER_RESULT,

clippy_lints/src/utils/paths.rs

-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub const HASHMAP_ENTRY: [&str; 5] = ["std", "collections", "hash", "map", "Entr
3737
pub const HASHSET: [&str; 5] = ["std", "collections", "hash", "set", "HashSet"];
3838
pub const INDEX: [&str; 3] = ["core", "ops", "Index"];
3939
pub const INDEX_MUT: [&str; 3] = ["core", "ops", "IndexMut"];
40-
pub const INIT: [&str; 4] = ["core", "intrinsics", "", "init"];
4140
pub const INTO: [&str; 3] = ["core", "convert", "Into"];
4241
pub const INTO_ITERATOR: [&str; 5] = ["core", "iter", "traits", "collect", "IntoIterator"];
4342
pub const IO_READ: [&str; 3] = ["std", "io", "Read"];
@@ -50,8 +49,6 @@ pub const LINT_PASS: [&str; 3] = ["rustc", "lint", "LintPass"];
5049
pub const MEM_DISCRIMINANT: [&str; 3] = ["core", "mem", "discriminant"];
5150
pub const MEM_FORGET: [&str; 3] = ["core", "mem", "forget"];
5251
pub const MEM_REPLACE: [&str; 3] = ["core", "mem", "replace"];
53-
pub const MEM_UNINIT: [&str; 3] = ["core", "mem", "uninitialized"];
54-
pub const MEM_ZEROED: [&str; 3] = ["core", "mem", "zeroed"];
5552
pub const MUTEX: [&str; 4] = ["std", "sync", "mutex", "Mutex"];
5653
pub const OPEN_OPTIONS: [&str; 3] = ["std", "fs", "OpenOptions"];
5754
pub const OPS_MODULE: [&str; 2] = ["core", "ops"];
@@ -109,7 +106,6 @@ pub const TO_STRING_METHOD: [&str; 4] = ["alloc", "string", "ToString", "to_stri
109106
pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
110107
pub const TRY_FROM_ERROR: [&str; 4] = ["std", "ops", "Try", "from_error"];
111108
pub const TRY_INTO_RESULT: [&str; 4] = ["std", "ops", "Try", "into_result"];
112-
pub const UNINIT: [&str; 4] = ["core", "intrinsics", "", "uninit"];
113109
pub const VEC: [&str; 3] = ["alloc", "vec", "Vec"];
114110
pub const VEC_DEQUE: [&str; 4] = ["alloc", "collections", "vec_deque", "VecDeque"];
115111
pub const VEC_FROM_ELEM: [&str; 3] = ["alloc", "vec", "from_elem"];

src/lintlist/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub use lint::Lint;
66
pub use lint::LINT_LEVELS;
77

88
// begin lint list, do not remove this comment, it’s used in `update_lints`
9-
pub const ALL_LINTS: [Lint; 310] = [
9+
pub const ALL_LINTS: [Lint; 309] = [
1010
Lint {
1111
name: "absurd_extreme_comparisons",
1212
group: "correctness",
@@ -791,13 +791,6 @@ pub const ALL_LINTS: [Lint; 310] = [
791791
deprecation: None,
792792
module: "methods",
793793
},
794-
Lint {
795-
name: "invalid_ref",
796-
group: "correctness",
797-
desc: "creation of invalid reference",
798-
deprecation: None,
799-
module: "invalid_ref",
800-
},
801794
Lint {
802795
name: "invalid_regex",
803796
group: "correctness",

tests/ui/invalid_ref.rs

-56
This file was deleted.

tests/ui/invalid_ref.stderr

-43
This file was deleted.

0 commit comments

Comments
 (0)