2024-01-25 12:17:36 -06:00
|
|
|
error: replacing an `Option` with `None`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:23:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut an_option, None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::mem-replace-option-with-none` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_option_with_none)]`
|
|
|
|
|
|
|
|
error: replacing an `Option` with `None`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:25:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(an_option, None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
|
|
|
|
|
|
|
error: replacing a value of type `T` with `T::default()` is better expressed using `core::mem::take`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:30:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut refstr, "");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::mem::take(&mut refstr)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_with_default)]`
|
|
|
|
|
|
|
|
error: replacing a value of type `T` with `T::default()` is better expressed using `core::mem::take`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:33:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut slice, &[]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::mem::take(&mut slice)`
|
|
|
|
|
|
|
|
error: replacing an `Option` with `None`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:76:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut f.0, None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `f.0.take()`
|
|
|
|
|
|
|
|
error: replacing an `Option` with `None`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:77:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut *f, None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `(*f).take()`
|
|
|
|
|
|
|
|
error: replacing an `Option` with `None`
|
2024-10-03 09:32:51 -05:00
|
|
|
--> tests/ui/mem_replace_no_std.rs:78:13
|
2024-01-25 12:17:36 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mem::replace(&mut b.opt, None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `b.opt.take()`
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|
|
|