Skip to content

Commit f46d291

Browse files
authored
Rollup merge of rust-lang#65438 - Centril:almost, r=varkor
Organize `never_type` tests Extracted from rust-lang#65355. This just moves some tests around to make things better categorized. r? @varkor
2 parents d4e2f44 + 1fb8cfb commit f46d291

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+27
-19
lines changed

src/test/ui/coercion/coerce-issue-49593-box-never.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22

33
#![feature(never_type)]
44
#![allow(unreachable_code)]

src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(never_type)]
2+
23
fn foo() -> Result<u32, !> {
34
Ok(123)
45
}

src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0005]: refutable pattern in local binding: `Err(_)` not covered
2-
--> $DIR/feature-gate-exhaustive-patterns.rs:7:9
2+
--> $DIR/feature-gate-exhaustive-patterns.rs:8:9
33
|
44
LL | let Ok(_x) = foo();
55
| ^^^^^^ pattern `Err(_)` not covered

src/test/ui/for-loop-while/loop-break-value.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
23
#![allow(unreachable_code)]
34
#![feature(never_type)]
45

src/test/ui/lint/must_use-unit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(never_type)]
2-
32
#![deny(unused_must_use)]
43

54
#[must_use]

src/test/ui/lint/must_use-unit.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: unused return value of `foo` that must be used
2-
--> $DIR/must_use-unit.rs:14:5
2+
--> $DIR/must_use-unit.rs:13:5
33
|
44
LL | foo();
55
| ^^^^^^
66
|
77
note: lint level defined here
8-
--> $DIR/must_use-unit.rs:3:9
8+
--> $DIR/must_use-unit.rs:2:9
99
|
1010
LL | #![deny(unused_must_use)]
1111
| ^^^^^^^^^^^^^^^
1212

1313
error: unused return value of `bar` that must be used
14-
--> $DIR/must_use-unit.rs:16:5
14+
--> $DIR/must_use-unit.rs:15:5
1515
|
1616
LL | bar();
1717
| ^^^^^^

src/test/run-fail/adjust_never.rs src/test/ui/never_type/adjust_never.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that a variable of type ! can coerce to another type.
22

3+
// run-fail
34
// error-pattern:explicit
45

56
#![feature(never_type)]

src/test/run-fail/call-fn-never-arg.rs src/test/ui/never_type/call-fn-never-arg.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that we can use a ! for an argument of type !
22

3+
// run-fail
34
// error-pattern:wowzers!
45

56
#![feature(never_type)]

src/test/run-fail/cast-never.rs src/test/ui/never_type/cast-never.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that we can explicitly cast ! to another type
22

3+
// run-fail
34
// error-pattern:explicit
45

56
#![feature(never_type)]

src/test/ui/diverging-fallback-control-flow.rs src/test/ui/never_type/diverging-fallback-control-flow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(unused_assignments)]
55
#![allow(unused_variables)]
66
#![allow(unreachable_code)]
7+
78
// Test various cases where we permit an unconstrained variable
89
// to fallback based on control-flow.
910
//

src/test/ui/impl-for-never.rs src/test/ui/never_type/impl-for-never.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// run-pass
2-
// Test that we can call static methods on ! both directly and when it appears in a generic
32

43
#![feature(never_type)]
54

5+
// Test that we can call static methods on ! both directly and when it appears in a generic
6+
67
trait StringifyType {
78
fn stringify_type() -> &'static str;
89
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/test/ui/issues/issue-44402.rs src/test/ui/never_type/issue-44402.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
2+
23
#![allow(dead_code)]
34
#![feature(never_type)]
45
#![feature(exhaustive_patterns)]

src/test/ui/never-assign-dead-code.rs src/test/ui/never_type/never-assign-dead-code.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Test that an assignment of type ! makes the rest of the block dead code.
22

3+
// check-pass
4+
35
#![feature(never_type)]
4-
// build-pass (FIXME(62277): could be check-pass?)
56
#![warn(unused)]
67

7-
88
fn main() {
99
let x: ! = panic!("aah"); //~ WARN unused
1010
drop(x); //~ WARN unreachable

src/test/ui/never-assign-dead-code.stderr src/test/ui/never_type/never-assign-dead-code.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | drop(x);
77
| ^^^^^^^^ unreachable statement
88
|
99
note: lint level defined here
10-
--> $DIR/never-assign-dead-code.rs:5:9
10+
--> $DIR/never-assign-dead-code.rs:6:9
1111
|
1212
LL | #![warn(unused)]
1313
| ^^^^^^
@@ -29,7 +29,7 @@ LL | let x: ! = panic!("aah");
2929
| ^ help: consider prefixing with an underscore: `_x`
3030
|
3131
note: lint level defined here
32-
--> $DIR/never-assign-dead-code.rs:5:9
32+
--> $DIR/never-assign-dead-code.rs:6:9
3333
|
3434
LL | #![warn(unused)]
3535
| ^^^^^^

src/test/run-fail/never-associated-type.rs src/test/ui/never_type/never-associated-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that we can use ! as an associated type.
22

3+
// run-fail
34
// error-pattern:kapow!
45

56
#![feature(never_type)]

src/test/ui/never-result.rs src/test/ui/never_type/never-result.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#![allow(unused_variables)]
44
#![allow(unreachable_code)]
5+
56
// Test that we can extract a ! through pattern matching then use it as several different types.
67

78
#![feature(never_type)]

src/test/run-fail/never-type-arg.rs src/test/ui/never_type/never-type-arg.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that we can use ! as an argument to a trait impl.
22

3+
// run-fail
34
// error-pattern:oh no!
45

56
#![feature(never_type)]
File renamed without changes.
File renamed without changes.

src/test/ui/never_transmute_never.rs src/test/ui/never_type/never_transmute_never.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22

33
#![crate_type="lib"]
44

File renamed without changes.

src/test/ui/unreachable/unreachable-loop-patterns.rs src/test/ui/reachable/unreachable-loop-patterns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// compile-fail
2-
31
#![feature(never_type)]
42
#![feature(exhaustive_patterns)]
53

src/test/ui/unreachable/unreachable-loop-patterns.stderr src/test/ui/reachable/unreachable-loop-patterns.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: unreachable pattern
2-
--> $DIR/unreachable-loop-patterns.rs:20:9
2+
--> $DIR/unreachable-loop-patterns.rs:18:9
33
|
44
LL | for _ in unimplemented!() as Void {}
55
| ^
66
|
77
note: lint level defined here
8-
--> $DIR/unreachable-loop-patterns.rs:7:9
8+
--> $DIR/unreachable-loop-patterns.rs:5:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: unreachable pattern
14-
--> $DIR/unreachable-loop-patterns.rs:20:14
14+
--> $DIR/unreachable-loop-patterns.rs:18:14
1515
|
1616
LL | for _ in unimplemented!() as Void {}
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/unreachable/unreachable-try-pattern.rs src/test/ui/reachable/unreachable-try-pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22
#![feature(never_type, exhaustive_patterns)]
33
#![warn(unreachable_code)]
44
#![warn(unreachable_patterns)]

0 commit comments

Comments
 (0)