rust/tests/ui/consts/const-call.stderr
2025-11-02 20:12:26 +00:00

16 lines
490 B
Text

error[E0015]: cannot call non-const function `f` in constants
--> $DIR/const-call.rs:6:17
|
LL | let _ = [0; f(2)];
| ^^^^
|
note: function `f` is not const
--> $DIR/const-call.rs:1:1
|
LL | fn f(x: usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0015`.