Closed
Description
I tried this code:
#![feature(inline_const)]
fn run() {
const { assert!(false) };
}
I expected to see this happen: compile error.
Instead, this happened: compile passes.
If I change the visibility of fn run
to pub
, it will throw a compile error.
For comparison, const value always throw a compile error even if the const is never used.
const X: i32 = {
assert!(false); // This will error!
1
};