Skip to content

Commit

Permalink
Update tests for revert of never type stabilization
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Dec 14, 2019
1 parent d82debb commit 69f99e7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
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)]
#![feature(exhaustive_patterns, never_type)]
#![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)]
#![feature(exhaustive_patterns, never_type)]
#![allow(dead_code, unreachable_code, unused_variables)]
#![allow(clippy::let_and_return)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/must_use_candidates.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
#![feature(never_type)]
#![allow(unused_mut)]
#![warn(clippy::must_use_candidate)]
use std::rc::Rc;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/must_use_candidates.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// 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:11:1
--> $DIR/must_use_candidates.rs:12: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:16:5
--> $DIR/must_use_candidates.rs:17: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:47:1
--> $DIR/must_use_candidates.rs:48: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:59:1
--> $DIR/must_use_candidates.rs:60: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:67:1
--> $DIR/must_use_candidates.rs:68: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: 1 addition & 0 deletions tests/ui/result_map_unit_fn_unfixable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![warn(clippy::result_map_unit_fn)]
#![feature(never_type)]
#![allow(unused)]

fn do_nothing<T>(_: T) {}
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:16:5
--> $DIR/result_map_unit_fn_unfixable.rs:17: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:18:5
--> $DIR/result_map_unit_fn_unfixable.rs:19: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:22:5
--> $DIR/result_map_unit_fn_unfixable.rs:23: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:26:5
--> $DIR/result_map_unit_fn_unfixable.rs:27:5
|
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
| ^ not found in this scope
Expand Down

0 comments on commit 69f99e7

Please sign in to comment.