]>
Commit | Line | Data |
---|---|---|
3c0e092e XL |
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; | |
064997fb | 8 | std::ptr::addr_of_mut!(x); //~ ERROR E0381 |
3c0e092e XL |
9 | |
10 | let y = x; // Should error here if `addr_of_mut` is ever allowed on uninitialized variables | |
11 | drop(y); | |
12 | } |