❯ RUST_BACKTRACE=1 rustc --edition 2024 --crate-type lib repro.rs
thread 'rustc' (23080133) panicked at /rustc-dev/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs:1005:13:
could not replace AliasTerm { args: [dyn [Binder { value: Trait(Callback), bound_vars: [] }, Binder { value: Projection(ExistentialProjection { def_id: DefId(2:4448 ~ core[eea8]::ops::function::FnOnce::Output), args: [((),)], term: Term::Ty(()), .. }), bound_vars: [] }] + '!0, (Alias(AliasTy { args: [std::option::Option<std::string::String>], kind: Projection { def_id: DefId(0:4 ~ repro[1d8e]::Helper::Out) }, .. }),)], kind: ProjectionTy { def_id: DefId(2:4448 ~ core[eea8]::ops::function::FnOnce::Output) }, .. } with term from from dyn [Binder { value: Trait(Callback), bound_vars: [] }, Binder { value: Projection(ExistentialProjection { def_id: DefId(2:4448 ~ core[eea8]::ops::function::FnOnce::Output), args: [((),)], term: Term::Ty(()), .. }), bound_vars: [] }] + '!0
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: <rustc_next_trait_solver::solve::assembly::structural_traits::ReplaceProjectionWith<rustc_middle::ty::context::TyCtxt, rustc_trait_selection::solve::delegate::SolverDelegate>>::try_eagerly_replace_alias
3: <rustc_middle::ty::generic_args::GenericArg as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_next_trait_solver::solve::assembly::structural_traits::ReplaceProjectionWith<rustc_middle::ty::context::TyCtxt, rustc_trait_selection::solve::delegate::SolverDelegate>>
4: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_next_trait_solver::solve::assembly::structural_traits::ReplaceProjectionWith<rustc_middle::ty::context::TyCtxt, rustc_trait_selection::solve::delegate::SolverDelegate>>
5: rustc_next_trait_solver::solve::assembly::structural_traits::predicates_for_object_candidate::<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>
6: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::match_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
7: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_match_goal_against_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
8: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::compute_trait_goal
9: <rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate> as rustc_type_ir::search_graph::Delegate>::compute_goal::{closure#0}
10: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_in_task
11: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
12: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_raw
13: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal
14: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_added_goals_step
15: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
16: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::match_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
17: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_match_goal_against_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
18: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::compute_trait_goal
19: <rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate> as rustc_type_ir::search_graph::Delegate>::compute_goal::{closure#0}
20: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_in_task
21: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
22: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_raw
23: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal
24: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_added_goals_step
25: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
26: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::match_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
27: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_match_goal_against_assumption::<<rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_next_trait_solver::solve::assembly::GoalKind<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::probe_and_consider_object_bound_candidate::{closure#0}>
28: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::compute_trait_goal
29: <rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate> as rustc_type_ir::search_graph::Delegate>::compute_goal::{closure#0}
30: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_in_task
31: <rustc_type_ir::search_graph::SearchGraph<rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<rustc_trait_selection::solve::delegate::SolverDelegate>, rustc_middle::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
32: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_raw
33: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal
34: <rustc_trait_selection::solve::delegate::SolverDelegate as rustc_next_trait_solver::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal
35: <rustc_trait_selection::solve::fulfill::FulfillmentCtxt<rustc_infer::traits::engine::ScrubbedTraitError> as rustc_infer::traits::engine::TraitEngine<rustc_infer::traits::engine::ScrubbedTraitError>>::try_evaluate_obligations
36: rustc_trait_selection::traits::impossible_predicates
37: rustc_trait_selection::traits::instantiate_and_check_impossible_predicates
[... omitted 1 frame ...]
38: rustc_trait_selection::traits::vtable::first_method_vtable_slot
39: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefaultCache<rustc_type_ir::predicate::TraitRef<rustc_middle::ty::context::TyCtxt>, rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
40: rustc_ty_utils::instance::resolve_instance_raw
[... omitted 1 frame ...]
41: <rustc_middle::ty::instance::Instance>::try_resolve
42: <rustc_mir_transform::check_call_recursion::CallRecursion as rustc_mir_transform::check_call_recursion::TerminatorClassifier>::is_recursive_terminator
43: <rustc_mir_transform::check_call_recursion::CheckCallRecursion as rustc_mir_transform::pass_manager::MirLint>::run_lint
44: rustc_mir_transform::pass_manager::run_passes_inner
45: rustc_mir_transform::mir_built
46: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
47: rustc_mir_build::check_unsafety::check_unsafety
48: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 0]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
49: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
50: rustc_interface::passes::analysis
51: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
52: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
53: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: the compiler unexpectedly panicked. This is a bug
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: rustc 1.97.0 (2d8144b78 2026-07-07) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib
query stack during panic:
#0 [instantiate_and_check_impossible_predicates] checking impossible instantiated predicates: `Callback`
#1 [first_method_vtable_slot] finding the slot within the vtable of `dyn Callback<Output = ()>` for the implementation of `Callback`
#2 [resolve_instance_raw] resolving instance `<dyn Callback<Output = ()> as Callback>::method`
#3 [mir_built] building MIR for `trigger`
#4 [check_unsafety] unsafety-checking `trigger`
#5 [analysis] running analysis passes on crate `repro`
end of query stack
Code
Meta
rustc --version --verbose:Panics on 1.97.0 stable, 1.97.1 stable, and nightly; compiles fine on 1.96.1 stable.
Error output
Backtrace