Don't ice on bad transmute in typeck in new solver by compiler-errors · Pull Request #134744 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation3 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Old trait solver ends up getting its infcx tainted because we try to normalize the type, but the new trait solver doesn't. This means we try to compute the stalled transmute obligations, which tries to normalize a type an ICEs. Let's make this a delayed bug.
r? lcnr
@@ -46,7 +46,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
---|
let span = tcx.hir().span(hir_id); |
let normalize = |ty |
let ty = self.resolve_vars_if_possible(ty); |
self.tcx.normalize_erasing_regions(self.typing_env(self.param_env), ty) |
if let Ok(ty) = |
self.tcx.try_normalize_erasing_regions(self.typing_env(self.param_env), ty) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, we should prolly just move this out of HIR typeck into a separate query and then check whether the typeck results are tainted instead, especially as computing the layout uses reveal all anyways, so we get query cycles when revealing opaques.
can you add that as a fixme? after that r=me
📌 Commit 96285bd has been approved by lcnr
It is now in the queue for this repository.
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
jhpratt added a commit to jhpratt/rust that referenced this pull request
…r=lcnr
Don't ice on bad transmute in typeck in new solver
Old trait solver ends up getting its infcx tainted because we try to normalize the type, but the new trait solver doesn't. This means we try to compute the stalled transmute obligations, which tries to normalize a type an ICEs. Let's make this a delayed bug.
r? lcnr
This was referenced
Jan 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 9 pull requests
Successful merges:
- rust-lang#131830 (Add support for wasm exception handling to Emscripten target)
- rust-lang#132345 (Improve diagnostics for
HostEffectPredicate
in the new solver) - rust-lang#134568 (Release notes for 1.84.0)
- rust-lang#134744 (Don't ice on bad transmute in typeck in new solver)
- rust-lang#135090 (Suggest to replace tuple constructor through projection)
- rust-lang#135116 (rustdoc: Fix mismatched capitalization in sidebar)
- rust-lang#135126 (mark deprecated option as deprecated in rustc_session to remove copypasta and small refactor)
- rust-lang#135139 ([generic_assert] Constify methods used by the formatting system)
- rust-lang#135170 (Update triagebot.toml: celinval vacation is over)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#134744 - compiler-errors:transmute-non-wf, r=lcnr
Don't ice on bad transmute in typeck in new solver
Old trait solver ends up getting its infcx tainted because we try to normalize the type, but the new trait solver doesn't. This means we try to compute the stalled transmute obligations, which tries to normalize a type an ICEs. Let's make this a delayed bug.
r? lcnr
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.
The Rustc Trait System Refactor Initiative (-Znext-solver)