Skip to content

Commit a50d9e7

Browse files
committed
Deprecate temporary_cstr_as_ptr
1 parent c42a22d commit a50d9e7

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,7 @@ Released 2018-09-13
19621962
[`suspicious_unary_op_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_unary_op_formatting
19631963
[`tabs_in_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments
19641964
[`temporary_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_assignment
1965+
[`temporary_cstring_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_cstring_as_ptr
19651966
[`to_digit_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_digit_is_some
19661967
[`to_string_in_display`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_display
19671968
[`todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo

clippy_lints/src/deprecated_lints.rs

+9
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,12 @@ declare_deprecated_lint! {
172172
pub DROP_BOUNDS,
173173
"this lint has been uplifted to rustc and is now called `drop_bounds`"
174174
}
175+
176+
declare_deprecated_lint! {
177+
/// **What it does:** Nothing. This lint has been deprecated.
178+
///
179+
/// **Deprecation reason:** This lint has been uplifted to rustc and is now called
180+
/// `temporary_cstring_as_ptr`.
181+
pub TEMPORARY_CSTRING_AS_PTR,
182+
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`"
183+
}

clippy_lints/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
488488
"clippy::drop_bounds",
489489
"this lint has been uplifted to rustc and is now called `drop_bounds`",
490490
);
491+
store.register_removed(
492+
"clippy::temporary_cstring_as_ptr",
493+
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`",
494+
);
491495
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
492496

493497
// begin register lints, do not remove this comment, it’s used in `update_lints`

tests/ui/deprecated.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
#[warn(clippy::unused_label)]
1010
#[warn(clippy::regex_macro)]
1111
#[warn(clippy::drop_bounds)]
12+
#[warn(clippy::temporary_cstring_as_ptr)]
1213

1314
fn main() {}

tests/ui/deprecated.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ error: lint `clippy::drop_bounds` has been removed: `this lint has been uplifted
6666
LL | #[warn(clippy::drop_bounds)]
6767
| ^^^^^^^^^^^^^^^^^^^
6868

69+
error: lint `clippy::temporary_cstring_as_ptr` has been removed: `this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr``
70+
--> $DIR/deprecated.rs:12:8
71+
|
72+
LL | #[warn(clippy::temporary_cstring_as_ptr)]
73+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74+
6975
error: lint `clippy::str_to_string` has been removed: `using `str::to_string` is common even today and specialization will likely happen soon`
7076
--> $DIR/deprecated.rs:1:8
7177
|
7278
LL | #[warn(clippy::str_to_string)]
7379
| ^^^^^^^^^^^^^^^^^^^^^
7480

75-
error: aborting due to 12 previous errors
81+
error: aborting due to 13 previous errors
7682

0 commit comments

Comments
 (0)