rust/tests/ui/mem_replace_macro.stderr
Aaron Hill 4698b366c4 Show macro name in 'this error originates in macro' message
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
2021-05-12 19:03:06 -04:00

14 lines
553 B
Text

error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> $DIR/mem_replace_macro.rs:9:9
|
LL | std::mem::replace($s, Default::default())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | take!(s);
| --------- in this macro invocation
|
= note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
= note: this error originates in the macro `take` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error