]> git.lizzy.rs Git - rust.git/blob - src/test/ui/moves/move-of-addr-of-mut.rs
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / moves / move-of-addr-of-mut.rs
1 // Ensure that taking a mutable raw ptr to an uninitialized variable does not change its
2 // initializedness.
3
4 struct S;
5
6 fn main() {
7     let mut x: S;
8     std::ptr::addr_of_mut!(x); //~ ERROR E0381
9
10     let y = x; // Should error here if `addr_of_mut` is ever allowed on uninitialized variables
11     drop(y);
12 }