-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use existing infcx
when emitting trait impl diagnostic
#75363
Conversation
Fixes rust-lang#75361 Fixes rust-lang#74918 Previously, we were creating a new `InferCtxt`, which caused an ICE when used with type variables from the existing `InferCtxt`
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | type Item<'a> = IteratorChunk<<'a>T, S>; |
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.
do we already have an issue for this error message?
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.
I'm not sure, but to fix it we need to extend the logic in the last match
at the end of add_missing_lifetime_specifiers_label
.
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.
#75372 tested locally:
@bors r+ rollup |
📌 Commit 4ed0c6a has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#75098 (Clippy pointer cast lint experiment) - rust-lang#75249 (Only add a border for the rust logo) - rust-lang#75315 (Avoid deleting temporary files on error) - rust-lang#75316 (Don't try to use wasm intrinsics on vectors) - rust-lang#75337 (instance: only polymorphize upvar substs) - rust-lang#75339 (evaluate required_consts when pushing stack frame in Miri engine) - rust-lang#75363 (Use existing `infcx` when emitting trait impl diagnostic) - rust-lang#75366 (Add help button) - rust-lang#75369 (Move to intra-doc links in /library/core/src/borrow.rs) - rust-lang#75379 (Use intra-doc links in /library/core/src/cmp.rs) Failed merges: r? @ghost
Fix suggestion to use lifetime in type and in assoc const _Do not merge until rust-lang#75363 has landed, as it has the test case for this._ * Account for associated types * Associated `const`s can't have generics (fix rust-lang#74264) * Do not suggest duplicate lifetimes and suggest `for<'a>` more (fix rust-lang#72404)
Fix suggestion to use lifetime in type and in assoc const _Do not merge until rust-lang#75363 has landed, as it has the test case for this._ * Account for associated types * Associated `const`s can't have generics (fix rust-lang#74264) * Do not suggest duplicate lifetimes and suggest `for<'a>` more (fix rust-lang#72404)
Fixes #75361
Fixes #74918
Previously, we were creating a new
InferCtxt
, which caused an ICE whenused with type variables from the existing
InferCtxt