]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/mem_replace.stderr
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / mem_replace.stderr
CommitLineData
f20569fa
XL
1error: replacing an `Option` with `None`
2 --> $DIR/mem_replace.rs:14:13
3 |
4LL | let _ = mem::replace(&mut an_option, None);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
6 |
7 = note: `-D clippy::mem-replace-option-with-none` implied by `-D warnings`
8
9error: replacing an `Option` with `None`
10 --> $DIR/mem_replace.rs:16:13
11 |
12LL | let _ = mem::replace(an_option, None);
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
14
15error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
16 --> $DIR/mem_replace.rs:21:13
17 |
18LL | let _ = std::mem::replace(&mut s, String::default());
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut s)`
20 |
21 = note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
22
23error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
24 --> $DIR/mem_replace.rs:23:13
25 |
26LL | let _ = std::mem::replace(s, String::default());
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
28
29error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
30 --> $DIR/mem_replace.rs:24:13
31 |
32LL | let _ = std::mem::replace(s, Default::default());
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
34
35error: aborting due to 5 previous errors
36