parent
d183bda0be
commit
3c308b86c8
@ -2,7 +2,6 @@
|
||||
|
||||
#![feature(box_syntax)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(never_type)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(slice_patterns)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
|
@ -1,4 +1,3 @@
|
||||
#![feature(never_type)]
|
||||
#![warn(clippy::diverging_sub_expression)]
|
||||
#![allow(clippy::match_same_arms, clippy::logic_bug)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:21:10
|
||||
--> $DIR/diverging_sub_expression.rs:20:10
|
||||
|
|
||||
LL | b || diverge();
|
||||
| ^^^^^^^^^
|
||||
@ -7,31 +7,31 @@ LL | b || diverge();
|
||||
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:22:10
|
||||
--> $DIR/diverging_sub_expression.rs:21:10
|
||||
|
|
||||
LL | b || A.foo();
|
||||
| ^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:31:26
|
||||
--> $DIR/diverging_sub_expression.rs:30:26
|
||||
|
|
||||
LL | 6 => true || return,
|
||||
| ^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:32:26
|
||||
--> $DIR/diverging_sub_expression.rs:31:26
|
||||
|
|
||||
LL | 7 => true || continue,
|
||||
| ^^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:35:26
|
||||
--> $DIR/diverging_sub_expression.rs:34:26
|
||||
|
|
||||
LL | 3 => true || diverge(),
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: sub-expression diverges
|
||||
--> $DIR/diverging_sub_expression.rs:40:26
|
||||
--> $DIR/diverging_sub_expression.rs:39:26
|
||||
|
|
||||
LL | _ => true || break,
|
||||
| ^^^^^
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-rustfix
|
||||
#![feature(exhaustive_patterns, never_type)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![allow(dead_code, unreachable_code, unused_variables)]
|
||||
#![allow(clippy::let_and_return)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-rustfix
|
||||
#![feature(exhaustive_patterns, never_type)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![allow(dead_code, unreachable_code, unused_variables)]
|
||||
#![allow(clippy::let_and_return)]
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// run-rustfix
|
||||
#![feature(never_type)]
|
||||
#![allow(unused_mut)]
|
||||
#![warn(clippy::must_use_candidate)]
|
||||
use std::rc::Rc;
|
||||
|
@ -1,5 +1,4 @@
|
||||
// run-rustfix
|
||||
#![feature(never_type)]
|
||||
#![allow(unused_mut)]
|
||||
#![warn(clippy::must_use_candidate)]
|
||||
use std::rc::Rc;
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: this function could have a `#[must_use]` attribute
|
||||
--> $DIR/must_use_candidates.rs:12:1
|
||||
--> $DIR/must_use_candidates.rs:11:1
|
||||
|
|
||||
LL | pub fn pure(i: u8) -> u8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pure(i: u8) -> u8`
|
||||
@ -7,25 +7,25 @@ LL | pub fn pure(i: u8) -> u8 {
|
||||
= note: `-D clippy::must-use-candidate` implied by `-D warnings`
|
||||
|
||||
error: this method could have a `#[must_use]` attribute
|
||||
--> $DIR/must_use_candidates.rs:17:5
|
||||
--> $DIR/must_use_candidates.rs:16:5
|
||||
|
|
||||
LL | pub fn inherent_pure(&self) -> u8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn inherent_pure(&self) -> u8`
|
||||
|
||||
error: this function could have a `#[must_use]` attribute
|
||||
--> $DIR/must_use_candidates.rs:48:1
|
||||
--> $DIR/must_use_candidates.rs:47:1
|
||||
|
|
||||
LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool`
|
||||
|
||||
error: this function could have a `#[must_use]` attribute
|
||||
--> $DIR/must_use_candidates.rs:60:1
|
||||
--> $DIR/must_use_candidates.rs:59:1
|
||||
|
|
||||
LL | pub fn rcd(_x: Rc<u32>) -> bool {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn rcd(_x: Rc<u32>) -> bool`
|
||||
|
||||
error: this function could have a `#[must_use]` attribute
|
||||
--> $DIR/must_use_candidates.rs:68:1
|
||||
--> $DIR/must_use_candidates.rs:67:1
|
||||
|
|
||||
LL | pub fn arcd(_x: Arc<u32>) -> bool {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn arcd(_x: Arc<u32>) -> bool`
|
||||
|
@ -1,6 +1,5 @@
|
||||
// run-rustfix
|
||||
|
||||
#![feature(never_type)]
|
||||
#![warn(clippy::result_map_unit_fn)]
|
||||
#![allow(unused)]
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// run-rustfix
|
||||
|
||||
#![feature(never_type)]
|
||||
#![warn(clippy::result_map_unit_fn)]
|
||||
#![allow(unused)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: called `map(f)` on an Result value where `f` is a unit function
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:36:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:35:5
|
||||
|
|
||||
LL | x.field.map(do_nothing);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -9,7 +9,7 @@ LL | x.field.map(do_nothing);
|
||||
= note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit function
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:38:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:37:5
|
||||
|
|
||||
LL | x.field.map(do_nothing);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -17,7 +17,7 @@ LL | x.field.map(do_nothing);
|
||||
| help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit function
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:40:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:39:5
|
||||
|
|
||||
LL | x.field.map(diverge);
|
||||
| ^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -25,7 +25,7 @@ LL | x.field.map(diverge);
|
||||
| help: try this: `if let Ok(x_field) = x.field { diverge(x_field) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:46:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:45:5
|
||||
|
|
||||
LL | x.field.map(|value| x.do_result_nothing(value + captured));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -33,7 +33,7 @@ LL | x.field.map(|value| x.do_result_nothing(value + captured));
|
||||
| help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:48:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:47:5
|
||||
|
|
||||
LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -41,7 +41,7 @@ LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
|
||||
| help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:51:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:50:5
|
||||
|
|
||||
LL | x.field.map(|value| do_nothing(value + captured));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -49,7 +49,7 @@ LL | x.field.map(|value| do_nothing(value + captured));
|
||||
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:53:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:52:5
|
||||
|
|
||||
LL | x.field.map(|value| { do_nothing(value + captured) });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -57,7 +57,7 @@ LL | x.field.map(|value| { do_nothing(value + captured) });
|
||||
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:55:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:54:5
|
||||
|
|
||||
LL | x.field.map(|value| { do_nothing(value + captured); });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -65,7 +65,7 @@ LL | x.field.map(|value| { do_nothing(value + captured); });
|
||||
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:57:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:56:5
|
||||
|
|
||||
LL | x.field.map(|value| { { do_nothing(value + captured); } });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -73,7 +73,7 @@ LL | x.field.map(|value| { { do_nothing(value + captured); } });
|
||||
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:60:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:59:5
|
||||
|
|
||||
LL | x.field.map(|value| diverge(value + captured));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -81,7 +81,7 @@ LL | x.field.map(|value| diverge(value + captured));
|
||||
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:62:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:61:5
|
||||
|
|
||||
LL | x.field.map(|value| { diverge(value + captured) });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -89,7 +89,7 @@ LL | x.field.map(|value| { diverge(value + captured) });
|
||||
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:64:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:63:5
|
||||
|
|
||||
LL | x.field.map(|value| { diverge(value + captured); });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -97,7 +97,7 @@ LL | x.field.map(|value| { diverge(value + captured); });
|
||||
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:66:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:65:5
|
||||
|
|
||||
LL | x.field.map(|value| { { diverge(value + captured); } });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -105,7 +105,7 @@ LL | x.field.map(|value| { { diverge(value + captured); } });
|
||||
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:71:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:70:5
|
||||
|
|
||||
LL | x.field.map(|value| { let y = plus_one(value + captured); });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -113,7 +113,7 @@ LL | x.field.map(|value| { let y = plus_one(value + captured); });
|
||||
| help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:73:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:72:5
|
||||
|
|
||||
LL | x.field.map(|value| { plus_one(value + captured); });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -121,7 +121,7 @@ LL | x.field.map(|value| { plus_one(value + captured); });
|
||||
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:75:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:74:5
|
||||
|
|
||||
LL | x.field.map(|value| { { plus_one(value + captured); } });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
@ -129,7 +129,7 @@ LL | x.field.map(|value| { { plus_one(value + captured); } });
|
||||
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
|
||||
|
||||
error: called `map(f)` on an Result value where `f` is a unit closure
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:78:5
|
||||
--> $DIR/result_map_unit_fn_fixable.rs:77:5
|
||||
|
|
||||
LL | x.field.map(|ref value| { do_nothing(value + captured) });
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
|
@ -1,4 +1,3 @@
|
||||
#![feature(never_type)]
|
||||
#![warn(clippy::result_map_unit_fn)]
|
||||
#![allow(unused)]
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
error[E0425]: cannot find value `x` in this scope
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:17:5
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:16:5
|
||||
|
|
||||
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
|
||||
| ^ not found in this scope
|
||||
|
||||
error[E0425]: cannot find value `x` in this scope
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:19:5
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:18:5
|
||||
|
|
||||
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
|
||||
| ^ not found in this scope
|
||||
|
||||
error[E0425]: cannot find value `x` in this scope
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:23:5
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:22:5
|
||||
|
|
||||
LL | x.field.map(|value| {
|
||||
| ^ not found in this scope
|
||||
|
||||
error[E0425]: cannot find value `x` in this scope
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:27:5
|
||||
--> $DIR/result_map_unit_fn_unfixable.rs:26:5
|
||||
|
|
||||
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
|
||||
| ^ not found in this scope
|
||||
|
Loading…
Reference in New Issue
Block a user