Skip to content

[ICE]: assumptions on binder: outlives clauses should not error outside borrowck #157732

@matthiaskrgr

Description

@matthiaskrgr

Code

//@compiler-flags: -Zassumptions-on-binders -Znext-solver=globally
fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a {
}

fn main() {
    foo(&10);
}

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (beae78130 2026-06-09)
binary: rustc
commit-hash: beae781308e9ddef13074a03faf57ca2fac59a5b
commit-date: 2026-06-09
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Error output

<output>
Backtrace

error: internal compiler error: /rustc-dev/beae781308e9ddef13074a03faf57ca2fac59a5b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:665:25: outlives clauses should not error outside borrowck. obligation: `Obligation(predicate=Binder { value: OutlivesPredicate(&'^0.Named(DefId(0:5 ~ a[0922]::foo::'b)) (), '?0), bound_vars: [Region(BrNamed(DefId(0:5 ~ a[0922]::foo::'b)))] }, depth=0)`
 --> a.rs:5:5
  |
5 |     foo(&10);
  |     ^^^^^^^^


thread 'rustc' (1677410) panicked at /rustc-dev/beae781308e9ddef13074a03faf57ca2fac59a5b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:665:25:
Box<dyn Any>
stack backtrace:
   0:     0x7fb6eb6a0dd9 - <<std[210f122337a7df4c]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[56696922243b1362]::fmt::Display>::fmt
   1:     0x7fb6ebe17988 - core[56696922243b1362]::fmt::write
   2:     0x7fb6eb6b6e66 - <std[210f122337a7df4c]::sys::stdio::unix::Stderr as std[210f122337a7df4c]::io::Write>::write_fmt
   3:     0x7fb6eb67656e - std[210f122337a7df4c]::panicking::default_hook::{closure#0}
   4:     0x7fb6eb693d33 - std[210f122337a7df4c]::panicking::default_hook
   5:     0x7fb6ea4840d1 - std[210f122337a7df4c]::panicking::update_hook::<alloc[87f39702ba754b16]::boxed::Box<rustc_driver_impl[17e5fc0182803539]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fb6eb694012 - std[210f122337a7df4c]::panicking::panic_with_hook
   7:     0x7fb6ea4b1d41 - std[210f122337a7df4c]::panicking::begin_panic::<rustc_errors[c58c3e91abb3cebc]::ExplicitBug>::{closure#0}
   8:     0x7fb6ea4aaab6 - std[210f122337a7df4c]::sys::backtrace::__rust_end_short_backtrace::<std[210f122337a7df4c]::panicking::begin_panic<rustc_errors[c58c3e91abb3cebc]::ExplicitBug>::{closure#0}, !>
   9:     0x7fb6ea4a8a47 - std[210f122337a7df4c]::panicking::begin_panic::<rustc_errors[c58c3e91abb3cebc]::ExplicitBug>
  10:     0x7fb6ea4bcd71 - <rustc_errors[c58c3e91abb3cebc]::diagnostic::BugAbort as rustc_errors[c58c3e91abb3cebc]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7fb6eab245ec - <rustc_errors[c58c3e91abb3cebc]::DiagCtxtHandle>::span_bug::<rustc_span[1164d50c362b2714]::span_encoding::Span, alloc[87f39702ba754b16]::string::String>
  12:     0x7fb6eab4fa66 - rustc_middle[f785d3947f0fb584]::util::bug::opt_span_bug_fmt::<rustc_span[1164d50c362b2714]::span_encoding::Span>::{closure#0}
  13:     0x7fb6eab4fbf2 - rustc_middle[f785d3947f0fb584]::ty::context::tls::with_opt::<rustc_middle[f785d3947f0fb584]::util::bug::opt_span_bug_fmt<rustc_span[1164d50c362b2714]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7fb6eab3e77b - rustc_middle[f785d3947f0fb584]::ty::context::tls::with_context_opt::<rustc_middle[f785d3947f0fb584]::ty::context::tls::with_opt<rustc_middle[f785d3947f0fb584]::util::bug::opt_span_bug_fmt<rustc_span[1164d50c362b2714]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7fb6e813f618 - rustc_middle[f785d3947f0fb584]::util::bug::span_bug_fmt::<rustc_span[1164d50c362b2714]::span_encoding::Span>
  16:     0x7fb6eb3dc21f - <rustc_trait_selection[b9d50ad77c2f4c38]::error_reporting::TypeErrCtxt>::report_selection_error
  17:     0x7fb6e9d3deb0 - <rustc_trait_selection[b9d50ad77c2f4c38]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  18:     0x7fb6ec18962e - <rustc_hir_typeck[61599d949c3b0189]::fn_ctxt::FnCtxt>::check_expr_call
  19:     0x7fb6ec15d84c - <rustc_hir_typeck[61599d949c3b0189]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20:     0x7fb6ec13fc73 - <rustc_hir_typeck[61599d949c3b0189]::fn_ctxt::FnCtxt>::check_expr_block
  21:     0x7fb6ec15d7ff - <rustc_hir_typeck[61599d949c3b0189]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  22:     0x7fb6ec631a92 - rustc_hir_typeck[61599d949c3b0189]::check::check_fn
  23:     0x7fb6ec55d735 - rustc_hir_typeck[61599d949c3b0189]::typeck_with_inspect::{closure#0}
  24:     0x7fb6ec55a670 - rustc_query_impl[6a84ebe04ccf7fcc]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
  25:     0x7fb6ec559be6 - rustc_query_impl[6a84ebe04ccf7fcc]::execution::try_execute_query::<rustc_data_structures[48e645d8be9cf502]::vec_cache::VecCache<rustc_span[1164d50c362b2714]::def_id::LocalDefId, rustc_middle[f785d3947f0fb584]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[f785d3947f0fb584]::dep_graph::graph::DepNodeIndex>, false>
  26:     0x7fb6ec559643 - rustc_query_impl[6a84ebe04ccf7fcc]::query_impl::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
  27:     0x7fb6ec6452ec - <rustc_middle[f785d3947f0fb584]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[266d646e8063f5b7]::check_crate::{closure#1}>::{closure#0}
  28:     0x7fb6ec644cdc - rustc_hir_analysis[266d646e8063f5b7]::check_crate
  29:     0x7fb6ec555cbf - rustc_interface[fcb53972e547428a]::passes::analysis
  30:     0x7fb6ecfd5106 - rustc_query_impl[6a84ebe04ccf7fcc]::execution::try_execute_query::<rustc_middle[f785d3947f0fb584]::query::caches::SingleCache<rustc_middle[f785d3947f0fb584]::query::erase::ErasedData<[u8; 0usize]>>, false>
  31:     0x7fb6ecfd4de9 - rustc_query_impl[6a84ebe04ccf7fcc]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  32:     0x7fb6ecf8211a - rustc_interface[fcb53972e547428a]::interface::run_compiler::<(), rustc_driver_impl[17e5fc0182803539]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7fb6ed00547a - std[210f122337a7df4c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[fcb53972e547428a]::util::run_in_thread_with_globals<rustc_interface[fcb53972e547428a]::util::run_in_thread_pool_with_globals<rustc_interface[fcb53972e547428a]::interface::run_compiler<(), rustc_driver_impl[17e5fc0182803539]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:     0x7fb6ed00522d - <std[210f122337a7df4c]::thread::lifecycle::spawn_unchecked<rustc_interface[fcb53972e547428a]::util::run_in_thread_with_globals<rustc_interface[fcb53972e547428a]::util::run_in_thread_pool_with_globals<rustc_interface[fcb53972e547428a]::interface::run_compiler<(), rustc_driver_impl[17e5fc0182803539]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[56696922243b1362]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7fb6ecd5ec92 - <std[210f122337a7df4c]::sys::thread::unix::Thread>::new::thread_start
  36:     0x7fb6e64981b9 - <unknown>
  37:     0x7fb6e651d21c - <unknown>
  38:                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 `/tmp/assumptions/2/rustc-ice-2026-06-10T20_43_59-1677400.txt` to your bug report

note: rustc 1.98.0-nightly (beae78130 2026-06-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z assumptions-on-binders -Z next-solver=globally

query stack during panic:
#0 [typeck_root] type-checking `main`
#1 [analysis] running analysis passes on crate `a`
end of query stack
error: aborting due to 1 previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zassumptions-on-bindersUnstable option: `-Zassumptions-on-bindersC-bugCategory: This is a bug.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
    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