From 9c0aebda6f929a8b6ec4e0902c75e861aa5a4af5 Mon Sep 17 00:00:00 2001 From: Adwin White Date: Wed, 8 Jul 2026 21:58:02 +0800 Subject: [PATCH 1/5] rerun if we meet any opaques in post analysis --- .../src/solve/eval_ctxt/mod.rs | 2 +- ...paque-or-has-infer-as-hidden-in-codegen.rs | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/ui/traits/next-solver/rerun-if-any-opaque-or-has-infer-as-hidden-in-codegen.rs diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs index 20f384c1436c0..93becbfb057bf 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs @@ -870,7 +870,7 @@ where ( RerunCondition::OpaqueInStorageOrAnyOpaqueHasInferAsHidden(_), TypingMode::PostAnalysis | TypingMode::Codegen, - ) => RerunDecision::No, + ) => RerunDecision::Yes, ( RerunCondition::OpaqueInStorageOrAnyOpaqueHasInferAsHidden(defids), TypingMode::Typeck { defining_opaque_types_and_generators: opaques }, diff --git a/tests/ui/traits/next-solver/rerun-if-any-opaque-or-has-infer-as-hidden-in-codegen.rs b/tests/ui/traits/next-solver/rerun-if-any-opaque-or-has-infer-as-hidden-in-codegen.rs new file mode 100644 index 0000000000000..8f691ad8f4c45 --- /dev/null +++ b/tests/ui/traits/next-solver/rerun-if-any-opaque-or-has-infer-as-hidden-in-codegen.rs @@ -0,0 +1,34 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +fn mk_vec() -> Vec> { + loop {} +} + +fn parse_feature(feature: &str) -> impl Iterator { + std::iter::once(feature) +} + +fn main() { + // In `codegen_select_candidate`, we try to find an impl for `FlatMap::into_iter` + // We try to prove `FlatMap<...>: IntoIterator`. + // The blanket impl requires `FlatMap<...>: Iterator`. + // The `Iterator` impl of `FlatMap` has nested goals: + // `Projection(Fn::Output, iter::Once`. + // We normalize this goal and set rerun condition to `AnyOpaqueHasInferAsHidden` + // with reason `SelfTyInfer` because we instantiated impls with infers when + // assembling candidates for intermediate goals. + // Then we evaluate the normalized goal: + // `Projection(Fn::Output, iter::Once`. + // The alias term is normalized to rigid alias `impl Iterator` as + // we're in `TypingMode::ErasedNotCoherence`. + // But the expected term is revealed `iter::Once` thus relating failed. + // The goal fails with rerun condition `OpaqueInStorage(parse_feature::opaque)`. + // This goal should be rerun in `TypingMode::Codegen` mode, but + // `AnyOpaqueHasInferAsHidden + OpaqueInStorage = OpaqueInStorageOrAnyOpaqueHasInferAsHidden` + // which didn't trigger rerun in `TypingMode::Codegen` mode previously. + mk_vec() + .into_iter() + .flatten() + .flat_map(parse_feature).into_iter(); +} From 41c7a25d863176cddf1e7a56f583fcc7ec7b3626 Mon Sep 17 00:00:00 2001 From: lcnr Date: Sat, 22 Aug 2026 21:08:02 +0200 Subject: [PATCH 2/5] add test --- ...run-impossible-predicates-post-analysis.rs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/ui/traits/object/rerun-impossible-predicates-post-analysis.rs diff --git a/tests/ui/traits/object/rerun-impossible-predicates-post-analysis.rs b/tests/ui/traits/object/rerun-impossible-predicates-post-analysis.rs new file mode 100644 index 0000000000000..232557c4a8a9d --- /dev/null +++ b/tests/ui/traits/object/rerun-impossible-predicates-post-analysis.rs @@ -0,0 +1,43 @@ +//@ run-pass + +// Regression test for #161441. This is a next-solver bug fixed by #158993 +// which affected stable due to `impossible_predicates` already using the next-solver +// by default. + +use std::marker::PhantomData; + +struct MyError; + +trait StreamingBody { + type BodyError; +} +struct Body; +impl StreamingBody for Body { + type BodyError = MyError; +} + +trait Service { + type Output; +} +struct HttpClientService; +impl Service for HttpClientService { + type Output = Body; +} + +trait Trait { + fn method(&self); +} +impl Trait for (F, PhantomData) +where + F: Fn() -> R, + HttpClientService: Service, + ResBody: StreamingBody, +{ + fn method(&self) {} +} + +fn inspect_websocket_message() -> impl Sized {} + +fn main() { + (&(inspect_websocket_message, PhantomData) as &dyn Trait).method(); +} From c10713e59995da64c82e05d154516854986f57ff Mon Sep 17 00:00:00 2001 From: lcnr Date: Sun, 23 Aug 2026 08:56:56 +0200 Subject: [PATCH 3/5] update version to 1.98.1 --- src/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version b/src/version index 783fda86436c2..5c87d6004a3b8 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -1.98.0 +1.98.1 From c1e5701b476027809750658fcacae69401eff63a Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 31 Aug 2026 08:11:00 -0400 Subject: [PATCH 4/5] Add release notes --- RELEASES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 940fa7c6072a9..049f207ea34e2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,10 @@ +Version 1.98.1 (2026-09-03) +=========================== + + + +* [rustc: fix miscompilation in generating vtables](https://github.com/rust-lang/rust/issues/161441) + Version 1.98.0 (2026-08-20) ========================== From 4014df6d653bb4da247c57b52a573ac1352496fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 20 Aug 2026 08:15:48 +0200 Subject: [PATCH 5/5] Bust sccache's cache (cherry picked and altered to random value from commit 93a81b48070ee5281294e6404c745c601bdb907d) --- src/ci/run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ci/run.sh b/src/ci/run.sh index 2aba67d28aee8..e6dc0d806a67e 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -236,6 +236,10 @@ datecheck() { datecheck trap datecheck EXIT +# Bump this value if you need to invalidate sccache's cache, if some wrong +# builds go into it +export SCCACHE_C_CUSTOM_CACHE_BUSTER=57c589c2a3266d9733e2 + # We've had problems in the past of shell scripts leaking fds into the sccache # server (#48192) which causes Cargo to erroneously think that a build script # hasn't finished yet. Try to solve that problem by starting a very long-lived