Fix ICE in borrowck when recovering fn_sig for -> _#152323
Fix ICE in borrowck when recovering fn_sig for -> _#152323rust-bors[bot] merged 3 commits intorust-lang:mainfrom
fn_sig for -> _#152323Conversation
| ); | ||
|
|
||
| let fn_sig = fold_regions(tcx, fn_sig, |r, _| match r.kind() { | ||
| ty::ReLateParam(lp) if lp.scope == scope => { |
There was a problem hiding this comment.
this if should be an assert, should it not?
There was a problem hiding this comment.
Ah right, it's inconsistency and should be rejected.
Addressed in: 313959d
| } | ||
| }; | ||
|
|
||
| br.map(|br| ty::Region::new_bound(tcx, ty::INNERMOST, br)) |
There was a problem hiding this comment.
ty::INNERMOST is wrong, u need to use the binder from the closure argument.
Also, can you move this into a utility function fn late_param_regions_to_bound or sth like this. I think this code is too general (and somewhat subtle to understand) for it to be inline here
There was a problem hiding this comment.
also, we should be able to just unwrap here 🤔 having spurious late bound regions is a compiler bug
c5a55e8 to
313959d
Compare
This comment has been minimized.
This comment has been minimized.
| scope: DefId, | ||
| bound_vars: &'tcx ty::List<ty::BoundVariableKind<'tcx>>, | ||
| value: T, | ||
| ) -> T |
There was a problem hiding this comment.
return a Binder instead of doing so in the caller :3
313959d to
b0f2ac8
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. |
|
Thank you for the review, too! |
Fix ICE in borrowck when recovering `fn_sig` for `-> _` (Should be) a proper fix for rust-lang#135845, replaces a dummy binder with a concrete one not to ICE, as mentioned in rust-lang#147631 (comment). Fixes rust-lang#135845 r? @lcnr @jackh726
Fix ICE in borrowck when recovering `fn_sig` for `-> _` (Should be) a proper fix for rust-lang#135845, replaces a dummy binder with a concrete one not to ICE, as mentioned in rust-lang#147631 (comment). Fixes rust-lang#135845 r? @lcnr @jackh726
Fix ICE in borrowck when recovering `fn_sig` for `-> _` (Should be) a proper fix for rust-lang#135845, replaces a dummy binder with a concrete one not to ICE, as mentioned in rust-lang#147631 (comment). Fixes rust-lang#135845 r? @lcnr @jackh726
…uwer Rollup of 14 pull requests Successful merges: - #152323 (Fix ICE in borrowck when recovering `fn_sig` for `-> _`) - #152469 (Remove unused features) - #152515 (Extract `DepKindVTable` constructors to their own module) - #152555 (Port `#[rustc_diagnostic_item]` to the new attribute parsers) - #152218 (Report unconstrained region in hidden types lazily) - #152356 (Improve the `inline_fluent!` macro) - #152392 (Fix ICE in supertrait_vtable_slot when supertrait has missing generics) - #152407 (Add regression test for type_const with unit struct ctor under mGCA) - #152440 (Fix typos and grammar in compiler and build documentation) - #152536 (bootstrap: add explicit UTF-8 encoding to text-mode open() calls) - #152554 (Remove `deprecated_safe` and its corresponding feature gate) - #152556 (doc: move riscv64a23-unknown-linux-gnu to tier 2) - #152563 (Replace "bug" with "issue" in triagebot ping messages) - #152565 (fix missleading error for tuple ctor) Failed merges: - #152512 (core: Implement feature `float_exact_integer_constants`) - #152296 (Port `rust_nonnull_optimization_guaranteed` and `rustc_do_not_const_check` to the new attribute parser)
…uwer Rollup of 14 pull requests Successful merges: - #152323 (Fix ICE in borrowck when recovering `fn_sig` for `-> _`) - #152469 (Remove unused features) - #152515 (Extract `DepKindVTable` constructors to their own module) - #152555 (Port `#[rustc_diagnostic_item]` to the new attribute parsers) - #152218 (Report unconstrained region in hidden types lazily) - #152356 (Improve the `inline_fluent!` macro) - #152392 (Fix ICE in supertrait_vtable_slot when supertrait has missing generics) - #152407 (Add regression test for type_const with unit struct ctor under mGCA) - #152440 (Fix typos and grammar in compiler and build documentation) - #152536 (bootstrap: add explicit UTF-8 encoding to text-mode open() calls) - #152554 (Remove `deprecated_safe` and its corresponding feature gate) - #152556 (doc: move riscv64a23-unknown-linux-gnu to tier 2) - #152563 (Replace "bug" with "issue" in triagebot ping messages) - #152565 (fix missleading error for tuple ctor) Failed merges: - #152512 (core: Implement feature `float_exact_integer_constants`) - #152296 (Port `rust_nonnull_optimization_guaranteed` and `rustc_do_not_const_check` to the new attribute parser)
(Should be) a proper fix for #135845, replaces a dummy binder with a concrete one not to ICE, as mentioned in #147631 (comment).
Fixes #135845
r? @lcnr @jackh726