diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-02 17:17:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-02 17:17:36 +0200 |
| commit | 7aaeee734fd1c68ddf27464e3f68caa77c98c0b2 (patch) | |
| tree | e6497ae5a433091da7df13b668f9771b7115ac03 | |
| parent | 4546f5d1dc3f3dc355d9dd8535e61910c1a9743b (diff) | |
| parent | 2fcaac79bcaf6b100172d9b5b932790923dcc97f (diff) | |
| download | rust-7aaeee734fd1c68ddf27464e3f68caa77c98c0b2.tar.gz rust-7aaeee734fd1c68ddf27464e3f68caa77c98c0b2.zip | |
Rollup merge of #100053 - flip1995:clippy_backport, r=xFrednet
move [`assertions_on_result_states`] to restriction "Backports" the first commit of https://github.com/rust-lang/rust-clippy/pull/9273, so that the lint doesn't go into beta as a warn-by-default lint. The other changes in the linked PR can ride the train as usual. r? ``@xFrednet`` (only Clippy changes, so we don't need to bother compiler people) --- For Clippy: changelog: none
| -rw-r--r-- | clippy_lints/src/assertions_on_result_states.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_all.rs | 1 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_restriction.rs | 1 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_style.rs | 1 |
4 files changed, 5 insertions, 3 deletions
diff --git a/clippy_lints/src/assertions_on_result_states.rs b/clippy_lints/src/assertions_on_result_states.rs index b6affdee523..4caab623090 100644 --- a/clippy_lints/src/assertions_on_result_states.rs +++ b/clippy_lints/src/assertions_on_result_states.rs @@ -19,6 +19,9 @@ declare_clippy_lint! { /// ### Why is this bad? /// An assertion failure cannot output an useful message of the error. /// + /// ### Known problems + /// The suggested replacement decreases the readability of code and log output. + /// /// ### Example /// ```rust,ignore /// # let r = Ok::<_, ()>(()); @@ -28,7 +31,7 @@ declare_clippy_lint! { /// ``` #[clippy::version = "1.64.0"] pub ASSERTIONS_ON_RESULT_STATES, - style, + restriction, "`assert!(r.is_ok())`/`assert!(r.is_err())` gives worse error message than directly calling `r.unwrap()`/`r.unwrap_err()`" } diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs index 5be1c417bf8..0ba9b7ae7e5 100644 --- a/clippy_lints/src/lib.register_all.rs +++ b/clippy_lints/src/lib.register_all.rs @@ -6,7 +6,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec