Suggest .swap()
method on slice instead of std::mem::swap
when latter causes conflicting borrows
#102269
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=599e18cde44ec5b1ebb113780f3e6487
The current output is:
I'd expect a
help:
or similar suggesting a replacement witharr.swap(0, 1)
.The text was updated successfully, but these errors were encountered: