Skip to content

Commit 69f99e7

Browse files
Update tests for revert of never type stabilization
1 parent d82debb commit 69f99e7

7 files changed

+14
-11
lines changed

tests/ui/infallible_destructuring_match.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![feature(exhaustive_patterns)]
2+
#![feature(exhaustive_patterns, never_type)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

tests/ui/infallible_destructuring_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![feature(exhaustive_patterns)]
2+
#![feature(exhaustive_patterns, never_type)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

tests/ui/must_use_candidates.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-rustfix
2+
#![feature(never_type)]
23
#![allow(unused_mut)]
34
#![warn(clippy::must_use_candidate)]
45
use std::rc::Rc;

tests/ui/must_use_candidates.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-rustfix
2+
#![feature(never_type)]
23
#![allow(unused_mut)]
34
#![warn(clippy::must_use_candidate)]
45
use std::rc::Rc;

tests/ui/must_use_candidates.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: this function could have a `#[must_use]` attribute
2-
--> $DIR/must_use_candidates.rs:11:1
2+
--> $DIR/must_use_candidates.rs:12:1
33
|
44
LL | pub fn pure(i: u8) -> u8 {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pure(i: u8) -> u8`
66
|
77
= note: `-D clippy::must-use-candidate` implied by `-D warnings`
88

99
error: this method could have a `#[must_use]` attribute
10-
--> $DIR/must_use_candidates.rs:16:5
10+
--> $DIR/must_use_candidates.rs:17:5
1111
|
1212
LL | pub fn inherent_pure(&self) -> u8 {
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn inherent_pure(&self) -> u8`
1414

1515
error: this function could have a `#[must_use]` attribute
16-
--> $DIR/must_use_candidates.rs:47:1
16+
--> $DIR/must_use_candidates.rs:48:1
1717
|
1818
LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool {
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool`
2020

2121
error: this function could have a `#[must_use]` attribute
22-
--> $DIR/must_use_candidates.rs:59:1
22+
--> $DIR/must_use_candidates.rs:60:1
2323
|
2424
LL | pub fn rcd(_x: Rc<u32>) -> bool {
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn rcd(_x: Rc<u32>) -> bool`
2626

2727
error: this function could have a `#[must_use]` attribute
28-
--> $DIR/must_use_candidates.rs:67:1
28+
--> $DIR/must_use_candidates.rs:68:1
2929
|
3030
LL | pub fn arcd(_x: Arc<u32>) -> bool {
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn arcd(_x: Arc<u32>) -> bool`

tests/ui/result_map_unit_fn_unfixable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::result_map_unit_fn)]
2+
#![feature(never_type)]
23
#![allow(unused)]
34

45
fn do_nothing<T>(_: T) {}

tests/ui/result_map_unit_fn_unfixable.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0425]: cannot find value `x` in this scope
2-
--> $DIR/result_map_unit_fn_unfixable.rs:16:5
2+
--> $DIR/result_map_unit_fn_unfixable.rs:17:5
33
|
44
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
55
| ^ not found in this scope
66

77
error[E0425]: cannot find value `x` in this scope
8-
--> $DIR/result_map_unit_fn_unfixable.rs:18:5
8+
--> $DIR/result_map_unit_fn_unfixable.rs:19:5
99
|
1010
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
1111
| ^ not found in this scope
1212

1313
error[E0425]: cannot find value `x` in this scope
14-
--> $DIR/result_map_unit_fn_unfixable.rs:22:5
14+
--> $DIR/result_map_unit_fn_unfixable.rs:23:5
1515
|
1616
LL | x.field.map(|value| {
1717
| ^ not found in this scope
1818

1919
error[E0425]: cannot find value `x` in this scope
20-
--> $DIR/result_map_unit_fn_unfixable.rs:26:5
20+
--> $DIR/result_map_unit_fn_unfixable.rs:27:5
2121
|
2222
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
2323
| ^ not found in this scope

0 commit comments

Comments
 (0)