Closed
Description
Given the following code:
fn f() { dbg!(); }
static A: fn() = f;
static B: () = A();
fn main() {
println!("Hello, world!");
B
}
The current output is:
error: function pointers are not allowed in const fn
--> src/main.rs:3:16
|
3 | static B: () = A();
| ^^^
error: could not compile `f` due to previous error
IMO it's a bit weird that rust tells me about a "const fn" since there is none in the code snippet...? 😅