Skip to content

backport "rerun in original typing mode if we meet any opaques in post analysis" to stable - #161555

Open
lcnr wants to merge 3 commits into
rust-lang:stablefrom
lcnr:backport-erased-handling
Open

backport "rerun in original typing mode if we meet any opaques in post analysis" to stable#161555
lcnr wants to merge 3 commits into
rust-lang:stablefrom
lcnr:backport-erased-handling

Conversation

@lcnr

@lcnr lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

backport of #158993 to stable, fixes #161441

we didn't notice that a beta cutoff happened between #156742 and #158993 and it's easy to forget that we need to be careful with next-solver bugs as they can affect stable via coherence and impossible_predicates.

@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 Aug 22, 2026
@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 19 candidates

@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • Pull requests are usually filed against the main branch for this repo, but this one is against stable. Please double check that you specified the right target!

@lcnr lcnr changed the title Backport erased handling backport "rerun in original typing mode if we meet any opaques in post analysis" to stable Aug 22, 2026
@lcnr lcnr added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Aug 22, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-release Relevant to the release subteam, which will review and decide on the PR/issue. label Aug 22, 2026
@lcnr

lcnr commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

no idea if this is correct for a stable backport xd

@rust-log-analyzer

This comment has been minimized.

@lcnr
lcnr force-pushed the backport-erased-handling branch from 0237223 to c10713e Compare August 23, 2026 06:57
@rust-log-analyzer

This comment was marked as outdated.

@cuviper

cuviper commented Aug 24, 2026

Copy link
Copy Markdown
Member

no idea if this is correct for a stable backport xd

Normally we would just label the original PR and discuss from there, but that's ok.

Did the object test come from a different PR?

@lcnr

lcnr commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

the object test is from #161441.

#158993 was already merged on beta by then. So we don't have that test in our test suite (yet)

meta-codesync Bot pushed a commit to facebook/Lifeguard that referenced this pull request Aug 25, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
meta-codesync Bot pushed a commit to facebookincubator/buck2-change-detector that referenced this pull request Aug 25, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
meta-codesync Bot pushed a commit to facebook/ocamlrep that referenced this pull request Aug 25, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
meta-codesync Bot pushed a commit to facebookincubator/reindeer that referenced this pull request Aug 25, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
meta-codesync Bot pushed a commit to facebook/buck2 that referenced this pull request Aug 25, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
meta-codesync Bot pushed a commit to meta-pytorch/monarch that referenced this pull request Aug 26, 2026
Summary:
D117423626 rust-lang/rust#161441

Miscompilation on 1.98.0 stable, waiting for PR rust-lang/rust#161555 before 1.98.1 release.

In the meantime, revert the 1.98.0 bump and wait.

Reviewed By: dtolnay

Differential Revision: D117431620

fbshipit-source-id: 7f93e5654ba6c2783e7411df47b62a1c3fdcc32c
@jieyouxu jieyouxu closed this Aug 26, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2026
@jieyouxu jieyouxu reopened this Aug 26, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2026
@lcnr lcnr added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Aug 27, 2026
@theemathas

theemathas commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Here's my attempt at drafting the release notes and blog post.

Release notes:

[rustc: fix miscompilation in vtable generation](https://github.com/rust-lang/rust/issues/161441)

Blog post (last paragraph copied from the 1.97.1 blog post):

Rust 1.98.1 fixes a [miscompilation in vtable generation](https://github.com/rust-lang/rust/issues/161441).

In Rust 1.98.0, in some circumstances, rustc would incorrectly generate a trait object vtable with a null pointer
where a function pointer should be. When an affected method is called, this is likely to cause a segmentation fault
with optimizations turned off, but may cause (arbitrary) undefined behavior with optimizations turned on.

If you'd like to help us out by testing future releases, you might consider
running your code's CI or locally using the beta channel (`rustup default beta`) or the nightly
channel (`rustup default nightly`). Please
[report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you
might come across!

@cuviper

cuviper commented Aug 28, 2026

Copy link
Copy Markdown
Member

Suggested edits: it should be "affected", and we should probably call this UB directly.

-where a function pointer should be. When an effected method is called, this would cause a segmentation fault
-with optimizations turned off, but may cause arbitrary behavior with optimizations turned on.
+where a function pointer should be. When an affected method is called, this would cause a segmentation fault
+with optimizations turned off, but may cause arbitrary undefined behavior with optimizations turned on.

... although I'm not sure it's even safe to make any specific behavior claim about the non-opt case either.

@theemathas

Copy link
Copy Markdown
Contributor

although I'm not sure it's even safe to make any specific behavior claim about the non-opt case either.

Edited, and added a "likely" qualifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. stable-accepted Accepted for backporting to the compiler in the stable channel. stable-nominated Nominated for backporting to the compiler in the stable channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, 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.

8 participants