Closed
Description
Test case:
#![feature(const_fn)]
const fn foo() -> u32 {
1
}
fn main() {
foo();
}
everybody_loops (#19964) will generate this, as expected:
$ rustc -Z unstable-options --unpretty everybody_loops 1.rs
#![feature(const_fn)]
const fn foo() -> u32 { loop { } }
fn main() { loop { } }
However, loop
is not supported in const fn
, so this will produce E0019
$ rustc -Z unstable-options --unpretty everybody_loops 1.rs | rustc -
error[E0019]: constant function contains unimplemented expression type
--> <anon>:3:25
|
3 | const fn foo() -> u32 { loop { } }
| ^^^^^^^^^
error: aborting due to previous error