Skip to content

Commit c036ca0

Browse files
lint not error
Co-Authored-By: Jonas Schievink <[email protected]>
1 parent 8e2e77b commit c036ca0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

posts/2019-09-26-Rust-1.38.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ As [previously announced](https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html
3333

3434
We have not yet deprecated `mem::uninitialized`; this will be done in a future release. Starting in 1.38.0, however, `rustc` will provide a lint for a narrow class of incorrect initializations using `mem::uninitialized` or `mem::zeroed`.
3535

36-
It is undefined behavior for some types, such as `&T` and `Box<T>`, to ever contain an all-`0` bit pattern, because they represent pointer-like objects that cannot be `null`. It is therefore an error to use `mem::uninitialized` or `mem::zeroed` to initialize one of these types, so the new error will attempt to warn whenever one of those functions is used to initialize one of them, either directly or as a member of a larger `struct`. The check is recursive, so the following code will emit a warning:
36+
It is undefined behavior for some types, such as `&T` and `Box<T>`, to ever contain an all-`0` bit pattern, because they represent pointer-like objects that cannot be `null`. It is therefore an error to use `mem::uninitialized` or `mem::zeroed` to initialize one of these types, so the new lint will attempt to warn whenever one of those functions is used to initialize one of them, either directly or as a member of a larger `struct`. The check is recursive, so the following code will emit a warning:
3737

3838
```rust
3939
struct Wrap<T>(T);

0 commit comments

Comments
 (0)