You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lang team indicated that the following code should compile:
constunsafefntest() -> usize{42}fnmain(){unsafe{let x = [0;test()];}}
However currently the array length does not "inherit" unsafety from the surrounding block.
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> src/main.rs:4:17
|
4 | let x = [0; test()];
| ^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
The text was updated successfully, but these errors were encountered:
The lang team indicated that the following code should compile:
However currently the array length does not "inherit" unsafety from the surrounding block.
The text was updated successfully, but these errors were encountered: