Skip to content
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 on bad transmute in typeck in new solver #134744

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

compiler-errors
Copy link
Member

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

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Dec 25, 2024
@@ -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)
Copy link
Contributor

@lcnr lcnr Jan 6, 2025

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

@compiler-errors
Copy link
Member Author

@bors r=lcnr rollup

@bors
Copy link
Contributor

bors commented Jan 6, 2025

📌 Commit 96285bd has been approved by lcnr

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 Jan 6, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 7, 2025
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2025
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
@bors bors merged commit 3deb5c2 into rust-lang:master Jan 7, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 7, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2025
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
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants