-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Don't ICE when computing PointerLike trait when region vars are in param-env #111880
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
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.
Why erase rather than just checking if the goal has any infer?
@jackh726: There's no reason to treat this goal as ambiguous just because our param-env has early bound regions that get canonicalized into region vars. If we treated the presence of region vars as ambiguous, then something this would fail for no particularly good reason:
To put it in other words, layout computation is done modulo regions anyways. |
@bors r+ |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#111861 (Don't ICE on return-type notation when promoting trait preds to associated type bounds) - rust-lang#111864 (Always require closure parameters to be `Sized`) - rust-lang#111870 (Rename `traits_in_crate` query to `traits`) - rust-lang#111880 (Don't ICE when computing PointerLike trait when region vars are in param-env) - rust-lang#111887 (Add regression tests for pretty-printing inherent projections) r? `@ghost` `@rustbot` modify labels: rollup
let self_ty = | ||
tcx.erase_regions(tcx.erase_late_bound_regions(obligation.predicate.self_ty())); | ||
|
||
let self_ty = tcx.erase_late_bound_regions(obligation.predicate.self_ty()); |
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.
that should ICE with non lifetime binders 🤔 also just style (and irrelevant perf) would prefer to first check for non_region_infer in the ParamEnvAnd
and then erase regions.
Fixes #111877