Function fixed_const_fn_error

Source
pub fn fixed_const_fn_error()
Expand description

§修正错误的 const 求值用法


const fn hello() -> &'static str{
    "Hello"
}

const Y: &str = hello();

fn main(){
    println!("{}", Y);
}