]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.rs
Rollup merge of #102245 - ink-feather-org:const_cmp_by, r=fee1-dead
[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 }