Skip to content

Conversation

compiler-errors
Copy link
Member

Fixes #109232

Makes sure that the fn_id: HirId that we pass to suggest_missing_return_type matches up with the fn_decl: hir::FnDecl that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...

This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like hir::Node and just deal with LocalDefIds everywhere... Anyways, I'd rather fix this ICE, now.

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 17, 2023
Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after minor nitpicks fixed

@WaffleLapkin WaffleLapkin assigned WaffleLapkin and unassigned TaKO8Ki Mar 17, 2023
@compiler-errors
Copy link
Member Author

@bors r=WaffleLapkin rollup (diagnostics only)

@bors
Copy link
Collaborator

bors commented Mar 17, 2023

📌 Commit 08c9132 has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
…=WaffleLapkin

Pass the right HIR back from `get_fn_decl`

Fixes rust-lang#109232

Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...

This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
…=WaffleLapkin

Pass the right HIR back from `get_fn_decl`

Fixes rust-lang#109232

Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...

This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
…=WaffleLapkin

Pass the right HIR back from `get_fn_decl`

Fixes rust-lang#109232

Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...

This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#109102 (Erase escaping late-bound regions when probing for ambiguous associated types)
 - rust-lang#109200 (Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer`)
 - rust-lang#109211 (E0206 - update description )
 - rust-lang#109222 (Do not ICE for unexpected lifetime with ConstGeneric rib)
 - rust-lang#109235 (fallback to lstat when stat fails on Windows)
 - rust-lang#109248 (Pass the right HIR back from `get_fn_decl`)
 - rust-lang#109251 (Suggest surrounding the macro with `{}` to interpret as a statement)
 - rust-lang#109256 (Check for llvm-tools before install)
 - rust-lang#109257 (resolve: Improve debug impls for `NameBinding`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d91858b into rust-lang:master Mar 18, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 18, 2023
@compiler-errors compiler-errors deleted the get_fn_decl-aaa branch August 11, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: not enough bound vars
5 participants