-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some borrowck diagnostic fixes #98603
Some borrowck diagnostic fixes #98603
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one very minor nit, r=me w/ or w/out fixing
// This is not exactly right, yet. | ||
|
||
// Ideally we should be suggesting `as_mut` for the first case, | ||
//and suggesting to change `as_ref` to `as_mut` in the second. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
//and suggesting to change `as_ref` to `as_mut` in the second. | |
// and suggesting to change `as_ref` to `as_mut` in the second. |
8fb6ad3
to
8fd7356
Compare
@bors r=davidtwco |
@bors ping |
😪 I'm awake I'm awake |
@bors r=davidtwco |
📌 Commit 8fd7356 has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#97423 (Simplify memory ordering intrinsics) - rust-lang#97542 (Use typed indices in argument mismatch algorithm) - rust-lang#97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths) - rust-lang#98277 (Fix trait object reborrow suggestion) - rust-lang#98525 (Add regression test for rust-lang#79224) - rust-lang#98549 (interpret: do not prune requires_caller_location stack frames quite so early) - rust-lang#98603 (Some borrowck diagnostic fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
.as_ref
suggestion logic from borrowck, this has the consequence of also not suggesting.as_ref
afterOption
methods, but (correctly) before.This is somewhat incomplete. See
src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs
for more improvements.