|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:11:16
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:10:16
|
|
|
|
|
|
|
|
|
|
|
LL | const _: i32 = if true {
|
|
|
|
|
| ________________^
|
|
|
|
@ -13,7 +13,7 @@ LL | | };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:17:16
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:16:16
|
|
|
|
|
|
|
|
|
|
|
LL | const _: i32 = if let Some(true) = Some(false) {
|
|
|
|
|
| ________________^
|
|
|
|
@ -27,7 +27,7 @@ LL | | };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:23:16
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:22:16
|
|
|
|
|
|
|
|
|
|
|
LL | const _: i32 = match 1 {
|
|
|
|
|
| ________________^
|
|
|
|
@ -41,7 +41,7 @@ LL | | };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `static`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:30:13
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:29:13
|
|
|
|
|
|
|
|
|
|
|
LL | let x = if true { 0 } else { 1 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -50,7 +50,7 @@ LL | let x = if true { 0 } else { 1 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `static`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:32:13
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:31:13
|
|
|
|
|
|
|
|
|
|
|
LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -59,7 +59,7 @@ LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `static`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:34:5
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:33:5
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -68,7 +68,7 @@ LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `static mut`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:39:13
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:38:13
|
|
|
|
|
|
|
|
|
|
|
LL | let x = if true { 0 } else { 1 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -77,7 +77,7 @@ LL | let x = if true { 0 } else { 1 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `static mut`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:41:13
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:40:13
|
|
|
|
|
|
|
|
|
|
|
LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -86,7 +86,7 @@ LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `static mut`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:43:5
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:42:5
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -95,7 +95,7 @@ LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:48:5
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:47:5
|
|
|
|
|
|
|
|
|
|
|
LL | if true { 5 } else { 6 }
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -104,7 +104,7 @@ LL | if true { 5 } else { 6 }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:52:5
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:51:5
|
|
|
|
|
|
|
|
|
|
|
LL | / if let Some(true) = a {
|
|
|
|
|
LL | | 0
|
|
|
|
@ -117,7 +117,7 @@ LL | | }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:60:5
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:59:5
|
|
|
|
|
|
|
|
|
|
|
LL | / match i {
|
|
|
|
|
LL | | i if i > 10 => i,
|
|
|
|
@ -130,7 +130,7 @@ LL | | }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:91:17
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:90:17
|
|
|
|
|
|
|
|
|
|
|
LL | let x = if y { 0 } else { 1 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -139,7 +139,7 @@ LL | let x = if y { 0 } else { 1 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:93:17
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:92:17
|
|
|
|
|
|
|
|
|
|
|
LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -148,7 +148,7 @@ LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const fn`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:95:9
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:94:9
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -157,7 +157,7 @@ LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:111:17
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:110:17
|
|
|
|
|
|
|
|
|
|
|
LL | let x = if false { 0 } else { 1 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -166,7 +166,7 @@ LL | let x = if false { 0 } else { 1 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:113:17
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:112:17
|
|
|
|
|
|
|
|
|
|
|
LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -175,7 +175,7 @@ LL | let x = match x { 0 => 1, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:115:9
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:114:9
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -184,7 +184,7 @@ LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:68:21
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:67:21
|
|
|
|
|
|
|
|
|
|
|
LL | const IF: i32 = if true { 5 } else { 6 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -193,7 +193,7 @@ LL | const IF: i32 = if true { 5 } else { 6 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:71:25
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:70:25
|
|
|
|
|
|
|
|
|
|
|
LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -202,7 +202,7 @@ LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:74:24
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:73:24
|
|
|
|
|
|
|
|
|
|
|
LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -211,7 +211,7 @@ LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:79:21
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:78:21
|
|
|
|
|
|
|
|
|
|
|
LL | const IF: i32 = if true { 5 } else { 6 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -220,7 +220,7 @@ LL | const IF: i32 = if true { 5 } else { 6 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `if` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:82:25
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:81:25
|
|
|
|
|
|
|
|
|
|
|
LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -229,7 +229,7 @@ LL | const IF_LET: i32 = if let Some(true) = None { 5 } else { 6 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0658]: `match` is not allowed in a `const`
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:85:24
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:84:24
|
|
|
|
|
|
|
|
|
|
|
LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
@ -238,7 +238,7 @@ LL | const MATCH: i32 = match 0 { 1 => 2, _ => 0 };
|
|
|
|
|
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
|
|
|
|
|
|
|
|
|
|
error[E0019]: constant contains unimplemented expression type
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:115:21
|
|
|
|
|
--> $DIR/feature-gate-const-if-match.rs:114:21
|
|
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(x) { x } else { 1 }
|
|
|
|
|
| ^
|
|
|
|
|