]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.rs
Merge commit '40b00f4200fbdeefd11815398cb46394b8cb0a5e' into sync_cg_clif-2021-12-30
[rust.git] / src / test / ui / borrowck / borrowck-use-uninitialized-in-cast.rs
1 // Check that we detect unused values that are cast to other things.
2 // The problem was specified to casting to `*`, as creating unsafe
3 // pointers was not being fully checked. Issue #20791.
4
5 fn main() {
6     let x: &i32;
7     let y = x as *const i32; //~ ERROR [E0381]
8 }