Skip to content

Commit dd4e471

Browse files
committed
Properly deprecate panic_params lint
1 parent 113c147 commit dd4e471

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

clippy_lints/src/deprecated_lints.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,8 @@ declare_deprecated_lint! {
181181
pub TEMPORARY_CSTRING_AS_PTR,
182182
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`"
183183
}
184+
185+
declare_deprecated_lint! {
186+
pub PANIC_PARAMS,
187+
"this lint has been uplifted to rustc and is now called `panic_fmt`"
188+
}

clippy_lints/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
495495
"clippy::temporary_cstring_as_ptr",
496496
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`",
497497
);
498+
store.register_removed(
499+
"clippy::panic_params",
500+
"this lint has been uplifted to rustc and is now called `panic_fmt`",
501+
);
498502
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
499503

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

src/lintlist/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,13 +1831,6 @@ vec![
18311831
deprecation: None,
18321832
module: "panic_in_result_fn",
18331833
},
1834-
Lint {
1835-
name: "panic_params",
1836-
group: "style",
1837-
desc: "missing parameters in `panic!` calls",
1838-
deprecation: None,
1839-
module: "panic_unimplemented",
1840-
},
18411834
Lint {
18421835
name: "panicking_unwrap",
18431836
group: "correctness",

tests/ui/deprecated.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
#[warn(clippy::regex_macro)]
1111
#[warn(clippy::drop_bounds)]
1212
#[warn(clippy::temporary_cstring_as_ptr)]
13+
#[warn(clippy::panic_params)]
1314

1415
fn main() {}

tests/ui/deprecated.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ error: lint `clippy::temporary_cstring_as_ptr` has been removed: `this lint has
7272
LL | #[warn(clippy::temporary_cstring_as_ptr)]
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7474

75+
error: lint `clippy::panic_params` has been removed: `this lint has been uplifted to rustc and is now called `panic_fmt``
76+
--> $DIR/deprecated.rs:13:8
77+
|
78+
LL | #[warn(clippy::panic_params)]
79+
| ^^^^^^^^^^^^^^^^^^^^
80+
7581
error: lint `clippy::str_to_string` has been removed: `using `str::to_string` is common even today and specialization will likely happen soon`
7682
--> $DIR/deprecated.rs:1:8
7783
|
7884
LL | #[warn(clippy::str_to_string)]
7985
| ^^^^^^^^^^^^^^^^^^^^^
8086

81-
error: aborting due to 13 previous errors
87+
error: aborting due to 14 previous errors
8288

0 commit comments

Comments
 (0)