summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/repl_uninit.stderr
blob: 09468eeaea4bf9d18dacd1c5c03809c5032909bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)`
   |
   = note: `-D clippy::mem-replace-with-uninit` implied by `-D warnings`

error: replacing with `mem::MaybeUninit::uninit().assume_init()`
  --> $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
   |
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
   |
LL |     let taken_u = unsafe { mem::replace(uref, mem::uninitialized()) };
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::ptr::read(uref)`

error: aborting due to 4 previous errors