Enhance drop forget ref hint#156395
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
As I said in #155895 (comment), I don't think we should do that, being a bit vague was on purpose. Further-more the suggestion is not right when there is an explicit borrow, like in https://github.com/rust-lang/rust/pull/156395/changes#diff-caa7b472da1b6aa2b42ea519f4bdd7eef6c5c031a32a342110116db9b83dde97R14. |
This comment has been minimized.
This comment has been minimized.
|
Why is I don’t quite understand from what angle this way of writing is considered incorrect. From my perspective, this syntax either brings about side effects or is used to disable the "unused variable" lint, and its effect seems roughly equivalent to However, developers may mistakenly assume that Therefore in my opinion, if (Translated by LLM) |
Same as If we are at a point where we are suggesting something to the user, it would be better to suggest code that actually does something. |
|
Ok, I got it Maybe we can give the user links to primitive reference and std::mem::drop as a note, because users only try to drop references due to a lack of relevant knowledge. keep |
|
Sure, if you think linking to I'm not sure we add a link to the reference type. If the goal was to make it clear that a reference is |
730f7b8 to
02e8e3e
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
02e8e3e to
a55c2dc
Compare
a55c2dc to
d580db9
Compare
This comment has been minimized.
This comment has been minimized.
changed `help` to `note`, and bless tests
d580db9 to
6b907cf
Compare
Replace
let _ = ...withlet _ = drop_argChanged some hint messages
Fixes: #155895