rust/tests/ui/repl_uninit.stderr

31 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-09-13 16:39:14 +00:00
error: replacing with `mem::uninitialized()`
--> $DIR/repl_uninit.rs:15:23
|
LL | let taken_v = mem::replace(&mut v, mem::uninitialized());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::ptr::read(&mut v)`
2019-09-13 16:39:14 +00:00
|
= note: `-D clippy::mem-replace-with-uninit` implied by `-D warnings`
error: replacing with `mem::MaybeUninit::uninit().assume_init()`
2019-09-13 16:39:14 +00:00
--> $DIR/repl_uninit.rs:21:23
|
LL | let taken_v = mem::replace(&mut v, mem::MaybeUninit::uninit().assume_init());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::ptr::read(&mut v)`
error: replacing with `mem::zeroed()`
--> $DIR/repl_uninit.rs:27:23
|
2019-09-13 16:39:14 +00:00
LL | let taken_v = mem::replace(&mut v, mem::zeroed());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a default value or the `take_mut` crate instead
error: replacing with `mem::uninitialized()`
--> $DIR/repl_uninit.rs:39:28
2019-09-13 16:39:14 +00:00
|
LL | let taken_u = unsafe { mem::replace(uref, mem::uninitialized()) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::ptr::read(uref)`
2019-09-13 16:39:14 +00:00
error: aborting due to 4 previous errors
2019-09-13 16:39:14 +00:00