Repository navigation
diagnostic: skip wrong loops when explaining borrow errors - #164424
Merged
Merged
Conversation
Contributor
|
Let's not close the original ticket just yet, even though this change fixes the wrong output, I would like to add an additional check for whether the binding comes from an fn argument and that argument's type has nested borrows with the same lifetime, so that it can mention that is rarely what you want. @bors r+ |
Contributor
Member
Author
|
good idea let me have a try |
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 16, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 16, 2026
…uwer Rollup of 4 pull requests Successful merges: - #163731 (Add bootstrap step to build the TPDE plugin) - #164060 (Add hightlight to acceptable characters in macro rules) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 16, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 16, 2026
…uwer Rollup of 5 pull requests Successful merges: - #163731 (Add bootstrap step to build the TPDE plugin) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 17, 2026
…uwer Rollup of 5 pull requests Successful merges: - #163731 (Add bootstrap step to build the TPDE plugin) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 17, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Oct 17, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 17, 2026
Rollup of 10 pull requests Successful merges: - #163731 (Add bootstrap step to build the TPDE plugin) - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd) - #161698 (Fix rmeta-link metadata not being read on AIX) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Oct 17, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 17, 2026
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 17, 2026
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 17, 2026
diagnostic: skip wrong loops when explaining borrow errors Adresss rust-lang#164169 When dealing with loops, restrict the search to the specific loop where the conflict occurs. r? @estebank
This was referenced Oct 17, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 17, 2026
…uwer Rollup of 11 pull requests Successful merges: - #162809 (Remap local def ids for deterministic metadata encoding) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164259 (std: make SOLID `sockaddr_storage` large enough for IPv6) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adresss #164169
When dealing with loops, restrict the search to the specific loop where the conflict occurs.
r? @estebank