Remove unneeded clone in macro deriving - #162004
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Remove unneeded clone in macro deriving
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (70a39cf): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.9%, secondary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 475.389s -> 473.445s (-0.41%) |
Rollup merge of #162004 - Kobzol:remove-unneeded-clone, r=nnethercote Remove unneeded clone in macro deriving Found this while looking at the parser and macro expansion. Note that `newitem` is already an owned `Box<Item>`, so there is no need to clone it. I found a few other places where we clone unnecessarily before dropping a value, but they were all in diagnostics code and the clone was very cheap, so it isn't IMO worth the churn. None of them were detected by the `redundant_clone` Clippy lint, which is a shame - it should be more powerful! r? nnethercote
Found this while looking at the parser and macro expansion. Note that
newitemis already an ownedBox<Item>, so there is no need to clone it.I found a few other places where we clone unnecessarily before dropping a value, but they were all in diagnostics code and the clone was very cheap, so it isn't IMO worth the churn. None of them were detected by the
redundant_cloneClippy lint, which is a shame - it should be more powerful!r? nnethercote