-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Erase lifetimes above ty::INNERMOST
when probing ambiguous types
#110195
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
@bors r+ |
…iemjay Erase lifetimes above `ty::INNERMOST` when probing ambiguous types Turns out that `TyCtxt::replace_escaping_bound_vars_uncached` only erases bound vars exactly at `ty::INNERMOST`, and not everything above. This regresses the suggestions for non-lifetime binders, but oh well, I don't really care about those. Fixes rust-lang#110052
// I guess we don't need to make a universe unless we need it, | ||
// but also we're on the error path, so it doesn't matter here. | ||
let universe = infcx.create_next_universe(); | ||
let value = tcx.fold_regions(qself_ty, |_, _| tcx.lifetimes.re_erased); |
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.
sidenote, we should rename this function to fold_free_regions
, or even map_free_regions
. Because currently it feels unclear whether this is supposed to modify bound regions
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.
"free" here is ambiguous because it also folds escaping bound vars, but yeah, I do think it needs a better name.
…iemjay Erase lifetimes above `ty::INNERMOST` when probing ambiguous types Turns out that `TyCtxt::replace_escaping_bound_vars_uncached` only erases bound vars exactly at `ty::INNERMOST`, and not everything above. This regresses the suggestions for non-lifetime binders, but oh well, I don't really care about those. Fixes rust-lang#110052
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#110072 (Stabilize IsTerminal) - rust-lang#110195 (Erase lifetimes above `ty::INNERMOST` when probing ambiguous types) - rust-lang#110218 (Remove `ToRegionVid`) - rust-lang#110220 (cleanup our region error API) - rust-lang#110234 (Fix btree `CursorMut::insert_after` check) - rust-lang#110262 (Update unwind_safe.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Turns out that
TyCtxt::replace_escaping_bound_vars_uncached
only erases bound vars exactly atty::INNERMOST
, and not everything above. This regresses the suggestions for non-lifetime binders, but oh well, I don't really care about those.Fixes #110052