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