2018-10-16 13:56:39 +00:00
|
|
|
error: unreachable expression
|
2019-12-11 14:51:28 +00:00
|
|
|
--> $DIR/unwarned-match-on-never.rs:10:5
|
2018-10-16 13:56:39 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | match x {}
|
2019-09-21 19:33:02 +00:00
|
|
|
| - any code following this expression is unreachable
|
|
|
|
LL | // But matches in unreachable code are warned.
|
|
|
|
LL | match x {}
|
|
|
|
| ^^^^^^^^^^ unreachable expression
|
2018-10-16 13:56:39 +00:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2018-10-16 13:56:39 +00:00
|
|
|
--> $DIR/unwarned-match-on-never.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![deny(unreachable_code)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-10-17 23:05:19 +00:00
|
|
|
error: unreachable arm
|
2019-12-11 14:51:28 +00:00
|
|
|
--> $DIR/unwarned-match-on-never.rs:15:15
|
2018-10-17 23:05:19 +00:00
|
|
|
|
|
2019-09-18 22:22:13 +00:00
|
|
|
LL | match (return) {
|
2019-09-21 19:33:02 +00:00
|
|
|
| -------- any code following this expression is unreachable
|
|
|
|
LL | () => ()
|
|
|
|
| ^^ unreachable arm
|
2018-10-17 23:05:19 +00:00
|
|
|
|
2018-10-16 13:56:39 +00:00
|
|
|
error: unreachable expression
|
2019-12-11 14:51:28 +00:00
|
|
|
--> $DIR/unwarned-match-on-never.rs:21:5
|
2018-10-16 13:56:39 +00:00
|
|
|
|
|
2019-09-21 19:33:02 +00:00
|
|
|
LL | return;
|
|
|
|
| ------ any code following this expression is unreachable
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | / match () {
|
2018-10-16 13:56:39 +00:00
|
|
|
LL | | () => (),
|
|
|
|
LL | | }
|
2019-09-21 19:33:02 +00:00
|
|
|
| |_____^ unreachable expression
|
2018-10-16 13:56:39 +00:00
|
|
|
|
2018-10-17 23:05:19 +00:00
|
|
|
error: aborting due to 3 previous errors
|
2018-10-16 13:56:39 +00:00
|
|
|
|