]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
Rollup merge of #80438 - crlf0710:box_into_inner, r=m-ou-se
[rust.git] / src / test / ui / consts / const-extern-fn / const-extern-fn-requires-unsafe.rs
1 #![feature(const_extern_fn)]
2
3 const unsafe extern "C" fn foo() -> usize { 5 }
4
5 fn main() {
6     let a: [u8; foo()];
7     //~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
8     foo();
9     //~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
10 }