-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
I tried this code with the -Zunleash-the-miri-inside-of-you flag:
const FOO: i32 = foo();
fn foo() -> i32 {
5
}This should work if i understand the flag correctly and make FOO have the value 5, but instead it gives me an evaluation error
error[E0080]: calling non-const function `foo`
--> src\lib.rs:3:18
|
3 | const FOO: i32 = foo();
| ^^^^^ evaluation of `FOO` failed here
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
--> src\lib.rs:3:18
|
3 | const FOO: i32 = foo();
| ^^^^^
For more information about this error, try `rustc --explain E0080`.Meta
rustc --version --verbose:
rustc 1.94.0-nightly (f52090008 2025-12-10)
binary: rustc
commit-hash: f5209000832c9d3bc29c91f4daef4ca9f28dc797
commit-date: 2025-12-10
host: x86_64-pc-windows-msvc
release: 1.94.0-nightly
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.