]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-use-uninitialized-in-cast.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }