]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[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 }