Skip to content

[ICE]: next solver: Unexpected node Synthetic #159557

Description

@matthiaskrgr

Code

this code compiles

//@compile-flags: -Znext-solver=globally --edition=2024
trait Foo: Mirror
where
    <Self as Mirror>::Assoc: Clone,
{
    async fn e() {}
}
trait Mirror {
    type Assoc;
}

fn main() {}

but if we remove the first : Mirror annotation

//@compile-flags: -Znext-solver=globally --edition=2024
trait Foo
where
    <Self as Mirror>::Assoc: Clone,
{
    async fn e() {}
}
trait Mirror {
    type Assoc;
}

fn main() {}

it will cause the next solver to ICE

Meta

rustc --version --verbose:

rustc 1.99.0-nightly (eff8269f7 2026-07-18)
binary: rustc
commit-hash: eff8269f797067c30555e77f160ec84c0ed15cd9
commit-date: 2026-07-18
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8

Error output

error[E0277]: the trait bound `Self: Mirror` is not satisfied
 --> code.rs:5:17
  |
5 |     async fn e() {}
  |                 ^ the trait `Mirror` is not implemented for `Self`
  |
help: consider further restricting `Self`
  |
1 | trait Foo: Mirror /*: Mirror .*/
  |          ++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
 --> code.rs:1:1
  |
1 | trait Foo /*: Mirror .*/
  | ^^^^^^^^^ the trait `Mirror` is not implemented for `Self`
  |
help: consider further restricting `Self`
  |
1 | trait Foo: Mirror /*: Mirror .*/
  |          ++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
   --> code.rs:3:30
    |
  3 |     <Self as Mirror>::Assoc: Clone,
    |                              ^^^^^ the trait `Mirror` is not implemented for `Self`
    |
note: required by a bound in `Clone`
   --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:194:24
    |
194 | pub const trait Clone: Sized {
    |                        ^^^^^ required by this bound in `Clone`
help: consider further restricting `Self`
    |
  1 | trait Foo: Mirror /*: Mirror .*/
    |          ++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
  |
note: required by a bound in `Foo`
 --> code.rs:3:30
  |
1 | trait Foo /*: Mirror .*/
  |       --- required by a bound in this trait
2 | where
3 |     <Self as Mirror>::Assoc: Clone,
  |                              ^^^^^ required by this bound in `Foo`
help: consider further restricting `Self`
  |
1 | trait Foo: Mirror /*: Mirror .*/
  |          ++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
 --> code.rs:5:5
  |
5 |     async fn e() {}
  |     ^^^^^^^^^^^^ the trait `Mirror` is not implemented for `Self`
  |
help: consider further restricting `Self`
  |
5 |     async fn e() where Self: Mirror {}
  |                  ++++++++++++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
   --> code.rs:3:30
    |
  3 |     <Self as Mirror>::Assoc: Clone,
    |                              ^^^^^ the trait `Mirror` is not implemented for `Self`
    |
note: required by a bound in `Clone`
   --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:194:24
    |
194 | pub const trait Clone: Sized {
    |                        ^^^^^ required by this bound in `Clone`
help: consider further restricting `Self`
    |
  5 |     async fn e() where Self: Mirror {}
    |                  ++++++++++++++++++

error[E0277]: the trait bound `Self: Mirror` is not satisfied
  |
note: required by a bound in `Foo`
 --> code.rs:3:30
  |
1 | trait Foo /*: Mirror .*/
  |       --- required by a bound in this trait
2 | where
3 |     <Self as Mirror>::Assoc: Clone,
  |                              ^^^^^ required by this bound in `Foo`
help: consider further restricting `Self`
  |
5 |     async fn e() where Self: Mirror {}
  |                  ++++++++++++++++++

error: the type `impl Future<Output = ()>` is not well-formed
 --> code.rs:5:17
  |
5 |     async fn e() {}
  |                 ^
Backtrace

error: internal compiler error: /rustc-dev/eff8269f797067c30555e77f160ec84c0ed15cd9/compiler/rustc_hir_analysis/src/hir_wf_check.rs:192:25: Unexpected node Synthetic


thread 'rustc' (1214808) panicked at /rustc-dev/eff8269f797067c30555e77f160ec84c0ed15cd9/compiler/rustc_hir_analysis/src/hir_wf_check.rs:192:25:
Box<dyn Any>
stack backtrace:
   0:     0x7fc76ba50a16 - <<std[2a8c3cd46992084f]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[f0447a45d83adb47]::fmt::Display>::fmt
   1:     0x7fc76c00ec88 - core[f0447a45d83adb47]::fmt::write
   2:     0x7fc76ba65c7c - <std[2a8c3cd46992084f]::sys::stdio::unix::Stderr as core[f0447a45d83adb47]::io::write::Write>::write_fmt
   3:     0x7fc76ba226aa - std[2a8c3cd46992084f]::panicking::default_hook::{closure#0}
   4:     0x7fc76ba43143 - std[2a8c3cd46992084f]::panicking::default_hook
   5:     0x7fc76a9fc04b - std[2a8c3cd46992084f]::panicking::update_hook::<alloc[4a894a599ddd1b2d]::boxed::Box<rustc_driver_impl[c2a64f8504684822]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fc76ba435e2 - std[2a8c3cd46992084f]::panicking::panic_with_hook
   7:     0x7fc76aa29b01 - std[2a8c3cd46992084f]::panicking::begin_panic::<rustc_errors[1361c60ac6b93a37]::ExplicitBug>::{closure#0}
   8:     0x7fc76aa229e6 - std[2a8c3cd46992084f]::sys::backtrace::__rust_end_short_backtrace::<std[2a8c3cd46992084f]::panicking::begin_panic<rustc_errors[1361c60ac6b93a37]::ExplicitBug>::{closure#0}, !>
   9:     0x7fc76aa208b7 - std[2a8c3cd46992084f]::panicking::begin_panic::<rustc_errors[1361c60ac6b93a37]::ExplicitBug>
  10:     0x7fc76aa34c91 - <rustc_errors[1361c60ac6b93a37]::diagnostic::BugAbort as rustc_errors[1361c60ac6b93a37]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7fc76afc19e9 - rustc_middle[96c442875f2cb62c]::util::bug::opt_span_bug_fmt::<rustc_span[157f53c51de8f998]::span_encoding::Span>::{closure#0}
  12:     0x7fc76afc1b52 - rustc_middle[96c442875f2cb62c]::ty::context::tls::with_opt::<rustc_middle[96c442875f2cb62c]::util::bug::opt_span_bug_fmt<rustc_span[157f53c51de8f998]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  13:     0x7fc76aface0b - rustc_middle[96c442875f2cb62c]::ty::context::tls::with_context_opt::<rustc_middle[96c442875f2cb62c]::ty::context::tls::with_opt<rustc_middle[96c442875f2cb62c]::util::bug::opt_span_bug_fmt<rustc_span[157f53c51de8f998]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  14:     0x7fc7684e23d4 - rustc_middle[96c442875f2cb62c]::util::bug::bug_fmt
  15:     0x7fc76ab9f885 - rustc_hir_analysis[e34517a71420646b]::hir_wf_check::diagnostic_hir_wf_check
  16:     0x7fc76b4c110e - rustc_query_impl[5a309cdb9f26d392]::query_impl::diagnostic_hir_wf_check::invoke_provider_fn::__rust_begin_short_backtrace
  17:     0x7fc76b4298b5 - rustc_query_impl[5a309cdb9f26d392]::execution::try_execute_query::<rustc_middle[96c442875f2cb62c]::query::caches::DefaultCache<(rustc_middle[96c442875f2cb62c]::ty::predicate::Predicate, rustc_middle[96c442875f2cb62c]::traits::WellFormedLoc), rustc_middle[96c442875f2cb62c]::query::erase::ErasedData<[u8; 8usize]>>, false>
  18:     0x7fc76b4c12f0 - rustc_query_impl[5a309cdb9f26d392]::query_impl::diagnostic_hir_wf_check::execute_query_non_incr::__rust_end_short_backtrace
  19:     0x7fc76b861bbc - <rustc_trait_selection[230890ec563485ea]::error_reporting::TypeErrCtxt>::report_selection_error
  20:     0x7fc76b887d7b - <rustc_trait_selection[230890ec563485ea]::error_reporting::TypeErrCtxt>::report_fulfillment_error
  21:     0x7fc76a30d47c - <rustc_trait_selection[230890ec563485ea]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  22:     0x7fc76c95e1e3 - rustc_hir_analysis[e34517a71420646b]::check::wfcheck::enter_wf_checking_ctxt::<rustc_hir_analysis[e34517a71420646b]::check::wfcheck::check_associated_item::{closure#0}>
  23:     0x7fc76c6ff4d3 - rustc_hir_analysis[e34517a71420646b]::check::wfcheck::check_trait_item
  24:     0x7fc76caed030 - rustc_hir_analysis[e34517a71420646b]::check::check::check_item_type
  25:     0x7fc76cae921c - rustc_hir_analysis[e34517a71420646b]::check::wfcheck::check_well_formed
  26:     0x7fc76cae91ed - rustc_query_impl[5a309cdb9f26d392]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
  27:     0x7fc76cae87d3 - rustc_query_impl[5a309cdb9f26d392]::execution::try_execute_query::<rustc_data_structures[6044b2f767527520]::vec_cache::VecCache<rustc_span[157f53c51de8f998]::def_id::LocalDefId, rustc_middle[96c442875f2cb62c]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[96c442875f2cb62c]::dep_graph::graph::DepNodeIndex>, false>
  28:     0x7fc76cae8553 - rustc_query_impl[5a309cdb9f26d392]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
  29:     0x7fc76cae508a - rustc_hir_analysis[e34517a71420646b]::check::wfcheck::check_type_wf
  30:     0x7fc76cae4f4f - rustc_query_impl[5a309cdb9f26d392]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
  31:     0x7fc76d148e92 - rustc_query_impl[5a309cdb9f26d392]::execution::try_execute_query::<rustc_middle[96c442875f2cb62c]::query::caches::SingleCache<rustc_middle[96c442875f2cb62c]::query::erase::ErasedData<[u8; 1usize]>>, false>
  32:     0x7fc76d148c77 - rustc_query_impl[5a309cdb9f26d392]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
  33:     0x7fc76c619c9a - rustc_hir_analysis[e34517a71420646b]::check_crate
  34:     0x7fc76c614bf5 - rustc_interface[bb04609e4c960450]::passes::analysis
  35:     0x7fc76d1474c7 - rustc_query_impl[5a309cdb9f26d392]::execution::try_execute_query::<rustc_middle[96c442875f2cb62c]::query::caches::SingleCache<rustc_middle[96c442875f2cb62c]::query::erase::ErasedData<[u8; 0usize]>>, false>
  36:     0x7fc76d147129 - rustc_query_impl[5a309cdb9f26d392]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  37:     0x7fc76d10464d - rustc_interface[bb04609e4c960450]::interface::run_compiler::<(), rustc_driver_impl[c2a64f8504684822]::run_compiler::{closure#0}>::{closure#2}
  38:     0x7fc76d172ae4 - std[2a8c3cd46992084f]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[bb04609e4c960450]::util::run_in_thread_with_globals<rustc_interface[bb04609e4c960450]::util::run_in_thread_pool_with_globals<rustc_interface[bb04609e4c960450]::interface::run_compiler<(), rustc_driver_impl[c2a64f8504684822]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  39:     0x7fc76d1728bb - <std[2a8c3cd46992084f]::thread::lifecycle::spawn_unchecked<rustc_interface[bb04609e4c960450]::util::run_in_thread_with_globals<rustc_interface[bb04609e4c960450]::util::run_in_thread_pool_with_globals<rustc_interface[bb04609e4c960450]::interface::run_compiler<(), rustc_driver_impl[c2a64f8504684822]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[f0447a45d83adb47]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7fc76d17cec8 - <std[2a8c3cd46992084f]::sys::thread::unix::Thread>::new::thread_start
  41:     0x7fc766a97739 - <unknown>
  42:     0x7fc766b1bedc - <unknown>
  43:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/CRED/rustc-ice-2026-07-19T09_52_34-1214798.txt` to your bug report

note: rustc 1.99.0-nightly (eff8269f7 2026-07-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=globally

query stack during panic:
#0 [diagnostic_hir_wf_check] performing HIR wf-checking for predicate `Binder { value: WellFormed(Term::Ty(Alias(Yes, Alias { kind: Opaque { def_id: DefId(0:5 ~ code[b566]::Foo::e::{opaque#0}) }, args: [Self/#0], .. }))), bound_vars: [] }` at item `Ty(DefId(0:10 ~ code[b566]::Foo::e::{anon_assoc#0}))`
#1 [check_well_formed] checking that `Foo::e` is well-formed
#2 [check_type_wf] checking that types are well-formed
#3 [analysis] running analysis passes on crate `code`
end of query stack
error: aborting due to 9 previous errors

For more information about this error, try `rustc --explain E0277`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.D-papercutDiagnostics: An error or lint that needs small tweaks.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions