[(); {while true {break}; 0}]; //~ ERROR constant contains unimplemented expression type
[(); { for _ in 0usize.. {}; 0}]; //~ ERROR calls in constants are limited to constant functions
//~^ ERROR constant contains unimplemented expression type
+ //~| ERROR evaluation of constant value failed
}
LL | let array: [usize; Dim3::dim()]
| ^^^^^^^^^^^
+error[E0080]: evaluation of constant value failed
+ --> $DIR/issue-39559-2.rs:24:24
+ |
+LL | let array: [usize; Dim3::dim()]
+ | ^^^^^^^^^^^ calling non-const function `<Dim3 as Dim>::dim`
+
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
- --> $DIR/issue-39559-2.rs:26:15
+ --> $DIR/issue-39559-2.rs:27:15
|
LL | = [0; Dim3::dim()];
| ^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error[E0080]: evaluation of constant value failed
+ --> $DIR/issue-39559-2.rs:27:15
+ |
+LL | = [0; Dim3::dim()];
+ | ^^^^^^^^^^^ calling non-const function `<Dim3 as Dim>::dim`
+
+error: aborting due to 4 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors occurred: E0015, E0080.
+For more information about an error, try `rustc --explain E0015`.
const NUM: u8 = xyz();
//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants
+//~| ERROR any use of this value will cause an error [const_err]
fn main() {
match 1 {
NUM => unimplemented!(),
+ //~^ ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}
LL | const NUM: u8 = xyz();
| ^^^^^
-error: aborting due to previous error
+error: any use of this value will cause an error
+ --> $DIR/issue-43105.rs:13:1
+ |
+LL | const NUM: u8 = xyz();
+ | ^^^^^^^^^^^^^^^^-----^
+ | |
+ | calling non-const function `xyz`
+ |
+ = note: #[deny(const_err)] on by default
+
+error: could not evaluate constant pattern
+ --> $DIR/issue-43105.rs:19:9
+ |
+LL | NUM => unimplemented!(),
+ | ^^^
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0015`.