Skip to content

Commit

Permalink
Remove never_type feature
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Nov 22, 2019
1 parent d183bda commit 3c308b8
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 41 deletions.
1 change: 0 additions & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#![feature(box_syntax)]
#![feature(box_patterns)]
#![feature(never_type)]
#![feature(rustc_private)]
#![feature(slice_patterns)]
#![feature(stmt_expr_attributes)]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/diverging_sub_expression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(never_type)]
#![warn(clippy::diverging_sub_expression)]
#![allow(clippy::match_same_arms, clippy::logic_bug)]

Expand Down
12 changes: 6 additions & 6 deletions tests/ui/diverging_sub_expression.stderr
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
error: sub-expression diverges
--> $DIR/diverging_sub_expression.rs:21:10
--> $DIR/diverging_sub_expression.rs:20:10
|
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,
| ^^^^^
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/infallible_destructuring_match.fixed
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/infallible_destructuring_match.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/must_use_candidates.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-rustfix
#![feature(never_type)]
#![allow(unused_mut)]
#![warn(clippy::must_use_candidate)]
use std::rc::Rc;
Expand Down
1 change: 0 additions & 1 deletion tests/ui/must_use_candidates.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-rustfix
#![feature(never_type)]
#![allow(unused_mut)]
#![warn(clippy::must_use_candidate)]
use std::rc::Rc;
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/must_use_candidates.stderr
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
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`
|
= 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`
Expand Down
1 change: 0 additions & 1 deletion tests/ui/result_map_unit_fn_fixable.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-rustfix

#![feature(never_type)]
#![warn(clippy::result_map_unit_fn)]
#![allow(unused)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/result_map_unit_fn_fixable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-rustfix

#![feature(never_type)]
#![warn(clippy::result_map_unit_fn)]
#![allow(unused)]

Expand Down
34 changes: 17 additions & 17 deletions tests/ui/result_map_unit_fn_fixable.stderr
Original file line number Diff line number Diff line change
@@ -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);
| ^^^^^^^^^^^^^^^^^^^^^^^-
Expand All @@ -9,127 +9,127 @@ 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);
| ^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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);
| ^^^^^^^^^^^^^^^^^^^^-
| |
| 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));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| 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) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
Expand Down
1 change: 0 additions & 1 deletion tests/ui/result_map_unit_fn_unfixable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(never_type)]
#![warn(clippy::result_map_unit_fn)]
#![allow(unused)]

Expand Down
8 changes: 4 additions & 4 deletions tests/ui/result_map_unit_fn_unfixable.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3c308b8

Please sign in to comment.