Function const_fn_error

Source
pub fn const_fn_error()
Expand description

§展示错误的 const 求值用法

#![feature(const_fn)]

// Error
const fn hello() -> String{
    "Hello".to_string()
}

// Error
const S : String = hello();

fn main(){
    println!(" {:?} ", S);
}