Skip to content

Allow explicit lifetime arguments (behind new #![feature(late_bound_turbofishing)]) and prevent explicit lifetime arguments where they do not appear in a function signature - #160471

Draft
addiesh wants to merge 5 commits into
rust-lang:mainfrom
addiesh:fishymandias

Conversation

@addiesh

@addiesh addiesh commented Aug 3, 2026

Copy link
Copy Markdown

r? oli-obk

note: commit dd17e77 is part of another PR (#159403) and needs to be merged before this does (I'll rebase the commit out when it gets merged, which should be soon)

This PR is a little bit big (and probably super messy). here's what it changes/adds:

addie's checklist:

  • make sure that the late-bound lifetime specification makes sense and isn't just failing silently
    • i do not know how to do this!!! this is some type system wizardry that escapes me. I will need help with this
    • i added one (1) test case to check and it fails (here)
  • fix the the turbofishing doesn't work because late-bound lifetimes aren't being counted right now

so what:

  1. this will now compile:
#![feature(late_bound_turbofishing)]

fn foo<'a>(b: &'a u32) -> &'a u32 { b }

fn main() {
    let f = foo::<'static>;
}

...and if the feature gate is missing, a diagnostic will be reported.

  1. this snippet (taken from this issue) will now fail to compile:
trait Trait {
    type Assoc<'a>;
}

fn do_thing<'b, T: Trait>(_: Option<<T as Trait>::Assoc<'_>>) -> (&i32, &'b i64) {
    todo!()
}

fn foo<T: Trait>() {
    do_thing::<'static, 'static, T>(None);
}

...although its diagnostic probably could stand to be improved.

ty :3

And on the pull request these words appear:
"My name is Fishymandias, fish of fish:
Look on my Rust, ye Reviewer, and despair!"

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. 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 3, 2026
@rustbot

rustbot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.


fn bar<'a>(_: &'a u32) {
let f = foo_late::<'a>;
require_static(f);

@addiesh addiesh Aug 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to fail, but currently it's not... don't know how to fix

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this just the usual FnDef outlives issue that already exists without your PR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops- I think so? But I;m not sure. the following (which is early-bound afaik) compiles when it shouldn't(?) in the rust playground

fn require_static<T: 'static>(_: T) {}

fn foo<'a: 'a>(b: &'a u32) -> &'a u32 { b }

fn bar<'a>(_: &'a u32) {
    let f = foo::<'a>;
    require_static(f);
}

fn main() {
    let x = 4;
    {
        bar(&x);
    }
}

@rust-log-analyzer

This comment has been minimized.

@addiesh

addiesh commented Aug 4, 2026

Copy link
Copy Markdown
Author

that CI run didn't give a good backtrace so to save future me from agony, the problem is here

param_counts.lifetimes - hidden_lifetimes + late_bound_lt_count;

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   9:     0xffaf8d231fc4 - std[faaa1722a6c2e07a]::panicking::default_hook::{closure#0}
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:292:27
  10:     0xffaf8d251a48 - std[faaa1722a6c2e07a]::panicking::default_hook
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:319:9
  11:     0xffaf898fdea4 - std[faaa1722a6c2e07a]::panicking::update_hook::<alloc[7220a3968fb26a7c]::boxed::Box<rustc_driver_impl[e532099ebedc0074]::install_ice_hook::{closure#1}>>::{closure#0}
  12:     0xffaf8d251dc4 - <alloc[7220a3968fb26a7c]::boxed::Box<dyn for<'a, 'b> core[a3bed6fa7f8910de]::ops::function::Fn<(&'a std[faaa1722a6c2e07a]::panic::PanicHookInfo<'b>,), Output = ()> + core[a3bed6fa7f8910de]::marker::Sync + core[a3bed6fa7f8910de]::marker::Send> as core[a3bed6fa7f8910de]::ops::function::Fn<(&std[faaa1722a6c2e07a]::panic::PanicHookInfo,)>>::call
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/alloc/src/boxed.rs:2333:9
  13:     0xffaf8d251dc4 - std[faaa1722a6c2e07a]::panicking::panic_with_hook
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:823:13
  14:     0xffaf8d232088 - std[faaa1722a6c2e07a]::panicking::panic_handler::{closure#0}
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:681:13
  15:     0xffaf8d22a1b4 - std[faaa1722a6c2e07a]::sys::backtrace::__rust_end_short_backtrace::<std[faaa1722a6c2e07a]::panicking::panic_handler::{closure#0}, !>
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/sys/backtrace.rs:182:18
  16:     0xffaf8d2338dc - __rustc[a25a212e9fab2cd3]::rust_begin_unwind
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:679:5
  17:     0xffaf8986b2ac - core[a3bed6fa7f8910de]::panicking::panic_fmt
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/panicking.rs:80:14
  18:     0xffaf8986b4b4 - core[a3bed6fa7f8910de]::panicking::panic_const::panic_const_sub_overflow
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/panicking.rs:175:17
  19:     0xffaf8a2c0008 - rustc_hir_analysis[157e5144c445dfe5]::hir_ty_lowering::generics::check_generic_arg_count
  20:     0xffaf89f1b080 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::instantiate_value_path
  21:     0xffaf89ee2cd8 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_path
  22:     0xffaf89eefd90 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:     0xffaf89edeff0 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_kind
  24:     0xffaf89eefdf8 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:     0xffaf89eee6d4 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_with_expectation
  26:     0xffaf89f266ac - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_block
  27:     0xffaf89edaa20 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_kind
  28:     0xffaf89eefdf8 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0xffaf89eee6d4 - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_expr_with_expectation
  30:     0xffaf89eee18c - <rustc_hir_typeck[c21fe22d9832d0b6]::fn_ctxt::FnCtxt>::check_return_or_body_tail
  31:     0xffaf89fe58bc - rustc_hir_typeck[c21fe22d9832d0b6]::check::check_fn
  32:     0xffaf8a005fa0 - rustc_hir_typeck[c21fe22d9832d0b6]::typeck_with_inspect
  33:     0xffaf8b393350 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
  34:     0xffaf8b3031dc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::CrateNum, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  35:     0xffaf8b1fd130 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  36:     0xffaf8b4c2714 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
  37:     0xffaf8a619ea8 - <rustc_middle[1dea9bde7a266407]::ty::context::TyCtxt>::typeck::<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId>
  38:     0xffaf8a63af14 - rustc_mir_build[1e54efd0932a83ff]::thir::pattern::check_match::check_match
  39:     0xffaf8b59da54 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::check_match::invoke_provider_fn::__rust_begin_short_backtrace
  40:     0xffaf8b3033d0 - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>>
  41:     0xffaf8b1f60d4 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  42:     0xffaf8b4c23d4 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::check_match::execute_query_non_incr::__rust_end_short_backtrace
  43:     0xffaf8a5b6224 - rustc_middle[1dea9bde7a266407]::query::inner::query_ensure_result::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, ()>
  44:     0xffaf8a5d66e8 - rustc_mir_build[1e54efd0932a83ff]::builder::build_mir_inner_impl
  45:     0xffaf8ba3d37c - rustc_mir_transform[a95976196175f3ac]::mir_built
  46:     0xffaf8b490c54 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_built::invoke_provider_fn::__rust_begin_short_backtrace
  47:     0xffaf8b3031dc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::CrateNum, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  48:     0xffaf8b1fd130 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  49:     0xffaf8b4c7664 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_built::execute_query_non_incr::__rust_end_short_backtrace
  50:     0xffaf8bac9644 - rustc_mir_transform[a95976196175f3ac]::ffi_unwind_calls::has_ffi_unwind_calls
  51:     0xffaf8b4c49d0 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::has_ffi_unwind_calls::invoke_provider_fn::__rust_begin_short_backtrace
  52:     0xffaf8b3033d0 - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>>
  53:     0xffaf8b1f60d4 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  54:     0xffaf8b4c4c60 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::has_ffi_unwind_calls::execute_query_non_incr::__rust_end_short_backtrace
  55:     0xffaf8ba38bc8 - rustc_mir_transform[a95976196175f3ac]::mir_promoted
  56:     0xffaf8b5cff10 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_promoted::invoke_provider_fn::__rust_begin_short_backtrace
  57:     0xffaf8b3032bc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 16usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 16usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 16usize]>>
  58:     0xffaf8b1f2924 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 16usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  59:     0xffaf8b59e53c - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_promoted::execute_query_non_incr::__rust_end_short_backtrace
  60:     0xffaf8a790f78 - rustc_borrowck[854156864b0980d2]::mir_borrowck
  61:     0xffaf8b48ac74 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
  62:     0xffaf8b3031dc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::CrateNum, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  63:     0xffaf8b1fd130 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_data_structures[443d1c562d8c65fb]::vec_cache::VecCache<rustc_span[b5af8dea9a98d005]::def_id::LocalDefId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[1dea9bde7a266407]::dep_graph::graph::DepNodeIndex>, false>
  64:     0xffaf8b4c27d0 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
  65:     0xffaf8a34d6c0 - rustc_hir_analysis[157e5144c445dfe5]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  66:     0xffaf8a46275c - rustc_hir_analysis[157e5144c445dfe5]::collect::type_of::type_of_opaque
  67:     0xffaf8b394dc4 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::type_of_opaque::invoke_provider_fn::__rust_begin_short_backtrace
  68:     0xffaf8b303abc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_middle[1dea9bde7a266407]::query::caches::DefIdCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  69:     0xffaf8b219c3c - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_middle[1dea9bde7a266407]::query::caches::DefIdCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>, false>
  70:     0xffaf8b42e7d4 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::type_of_opaque::execute_query_non_incr::__rust_end_short_backtrace
  71:     0xffaf8a464258 - rustc_hir_analysis[157e5144c445dfe5]::collect::type_of::type_of
  72:     0xffaf8b39f8b0 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace
  73:     0xffaf8b303abc - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_middle[1dea9bde7a266407]::query::caches::DefIdCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  74:     0xffaf8b219c3c - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_middle[1dea9bde7a266407]::query::caches::DefIdCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>, false>
  75:     0xffaf8b43b5a8 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::type_of::execute_query_non_incr::__rust_end_short_backtrace
  76:     0xffaf8b08fdc8 - <rustc_privacy[f1dcc7612f1feaf4]::ReachEverythingInTheInterfaceVisitor>::ty
  77:     0xffaf8b08d4c4 - rustc_privacy[f1dcc7612f1feaf4]::effective_visibilities
  78:     0xffaf8b48e370 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::effective_visibilities::invoke_provider_fn::__rust_begin_short_backtrace
  79:     0xffaf8b303e88 - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_middle[1dea9bde7a266407]::query::caches::SingleCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>
  80:     0xffaf8b225dac - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_middle[1dea9bde7a266407]::query::caches::SingleCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 8usize]>>, false>
  81:     0xffaf8b4353c4 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::effective_visibilities::execute_query_non_incr::__rust_end_short_backtrace
  82:     0xffaf8ae44fbc - rustc_passes[6187195f98e2bd37]::stability::check_mod_unstable_api_usage
  83:     0xffaf8b3d90e8 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::check_mod_unstable_api_usage::invoke_provider_fn::__rust_begin_short_backtrace
  84:     0xffaf8b304d34 - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_middle[1dea9bde7a266407]::query::caches::DefaultCache<rustc_span[b5af8dea9a98d005]::def_id::LocalModId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>
  85:     0xffaf8b259a8c - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_middle[1dea9bde7a266407]::query::caches::DefaultCache<rustc_span[b5af8dea9a98d005]::def_id::LocalModId, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>, false>
  86:     0xffaf8b5a1900 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::check_mod_unstable_api_usage::execute_query_non_incr::__rust_end_short_backtrace
  87:     0xffaf89b7c498 - <rustc_middle[1dea9bde7a266407]::ty::context::TyCtxt>::par_hir_for_each_module::<rustc_interface[7cd79aa87e9db2d9]::passes::run_required_analyses::{closure#0}::{closure#1}::{closure#0}>::{closure#0}
  88:     0xffaf89b7a28c - rustc_data_structures[443d1c562d8c65fb]::sync::parallel::par_for_each_in::<&rustc_span[b5af8dea9a98d005]::def_id::LocalModId, &[rustc_span[b5af8dea9a98d005]::def_id::LocalModId], <rustc_middle[1dea9bde7a266407]::ty::context::TyCtxt>::par_hir_for_each_module<rustc_interface[7cd79aa87e9db2d9]::passes::run_required_analyses::{closure#0}::{closure#1}::{closure#0}>::{closure#0}>
  89:     0xffaf89b128a0 - rustc_interface[7cd79aa87e9db2d9]::passes::run_required_analyses::{closure#0}::{closure#1}
  90:     0xffaf8d1e1e50 - rustc_data_structures[443d1c562d8c65fb]::sync::parallel::par_fns
  91:     0xffaf89b09768 - <rustc_session[b220a414c50c6c0]::session::Session>::time::<(), rustc_interface[7cd79aa87e9db2d9]::passes::run_required_analyses::{closure#0}>
  92:     0xffaf89adc2c4 - rustc_interface[7cd79aa87e9db2d9]::passes::analysis
  93:     0xffaf8b4764b0 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::analysis::invoke_provider_fn::__rust_begin_short_backtrace
  94:     0xffaf8b303bb8 - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<rustc_query_impl[bba0a8c71d0f45c2]::execution::execute_job_non_incr<rustc_middle[1dea9bde7a266407]::query::caches::SingleCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>::{closure#0}, rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>
  95:     0xffaf8b21d664 - rustc_query_impl[bba0a8c71d0f45c2]::execution::try_execute_query::<rustc_middle[1dea9bde7a266407]::query::caches::SingleCache<rustc_middle[1dea9bde7a266407]::query::erase::ErasedData<[u8; 0usize]>>, false>
  96:     0xffaf8b4c75a8 - rustc_query_impl[bba0a8c71d0f45c2]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  97:     0xffaf898bf43c - <std[faaa1722a6c2e07a]::thread::local::LocalKey<core[a3bed6fa7f8910de]::cell::Cell<*const ()>>>::with::<rustc_middle[1dea9bde7a266407]::ty::context::tls::enter_context<<rustc_middle[1dea9bde7a266407]::ty::context::GlobalCtxt>::enter<rustc_interface[7cd79aa87e9db2d9]::passes::create_and_enter_global_ctxt<core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>, rustc_driver_impl[e532099ebedc0074]::run_compiler::{closure#0}::{closure#1}>::{closure#2}, core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>>::{closure#1}, core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>>::{closure#0}, core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>>
  98:     0xffaf89897fcc - <rustc_middle[1dea9bde7a266407]::ty::context::TyCtxt>::create_global_ctxt::<core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>, rustc_interface[7cd79aa87e9db2d9]::passes::create_and_enter_global_ctxt<core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>, rustc_driver_impl[e532099ebedc0074]::run_compiler::{closure#0}::{closure#1}>::{closure#2}>
  99:     0xffaf899383f4 - rustc_interface[7cd79aa87e9db2d9]::passes::create_and_enter_global_ctxt::<core[a3bed6fa7f8910de]::option::Option<rustc_interface[7cd79aa87e9db2d9]::queries::Linker>, rustc_driver_impl[e532099ebedc0074]::run_compiler::{closure#0}::{closure#1}>
 100:     0xffaf8991241c - std[faaa1722a6c2e07a]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[7cd79aa87e9db2d9]::util::run_in_thread_with_globals<rustc_interface[7cd79aa87e9db2d9]::util::run_in_thread_pool_with_globals<rustc_interface[7cd79aa87e9db2d9]::interface::run_compiler<(), rustc_driver_impl[e532099ebedc0074]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
 101:     0xffaf898e8794 - <std[faaa1722a6c2e07a]::thread::lifecycle::spawn_unchecked<rustc_interface[7cd79aa87e9db2d9]::util::run_in_thread_with_globals<rustc_interface[7cd79aa87e9db2d9]::util::run_in_thread_pool_with_globals<rustc_interface[7cd79aa87e9db2d9]::interface::run_compiler<(), rustc_driver_impl[e532099ebedc0074]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[a3bed6fa7f8910de]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 102:     0xffaf8d25ccec - <alloc[7220a3968fb26a7c]::boxed::Box<dyn core[a3bed6fa7f8910de]::ops::function::FnOnce<(), Output = ()> + core[a3bed6fa7f8910de]::marker::Send> as core[a3bed6fa7f8910de]::ops::function::FnOnce<()>>::call_once
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/alloc/src/boxed.rs:2319:9
 103:     0xffaf8d25ccec - <std[faaa1722a6c2e07a]::sys::thread::unix::Thread>::new::thread_start
                               at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/sys/thread/unix.rs:123:17
 104:     0xffaf88cbb9f4 - <unknown>
 105:     0xffaf88d2700c - <unknown>
---
warning: the ICE couldn't be written to `/checkout/rustc-ice-2026-08-04T16_47_10-12238.txt`: Read-only file system (os error 30)

note: rustc 1.99.0-nightly (5d351e228 2026-08-04) running on aarch64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z embed-metadata=no -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C embed-bitcode=yes -Z unstable-options -C force-frame-pointers=non-leaf -C debug-assertions=on -Z annotate-moves -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z inline-mir -Z inline-mir-preserve-debug -Z mir_strip_debuginfo=locals-in-tiny-functions -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck_root] type-checking `ffi::c_str::<impl at library/core/src/ffi/c_str.rs:187:1: 187:10>::display`
#1 [check_match] match-checking `ffi::c_str::<impl at library/core/src/ffi/c_str.rs:187:1: 187:10>::display`
... and 9 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: OpaqueTypeStorage { opaque_types: {OpaqueTypeKey { def_id: DefId(0:6954 ~ core[e122]::ffi::c_str::{impl#5}::display::{opaque#0}), args: [ReLateParam(DefId(0:6953 ~ core[e122]::ffi::c_str::{impl#5}::display), LateNamed(DefId(0:85878 ~ core[e122]::ffi::c_str::{impl#5}::display::'_)))] }: ProvisionalHiddenType { span: library/core/src/ffi/c_str.rs:649:30: 649:47 (#44697), ty: ?0t }}, duplicate_entries: [] }
  |
  = note: delayed at compiler/rustc_infer/src/infer/mod.rs:376:43 - disabled backtrace

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

warning: the ICE couldn't be written to `/checkout/rustc-ice-2026-08-04T16_47_10-12238.txt`: Read-only file system (os error 30)

note: rustc 1.99.0-nightly (5d351e228 2026-08-04) running on aarch64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z embed-metadata=no -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C embed-bitcode=yes -Z unstable-options -C force-frame-pointers=non-leaf -C debug-assertions=on -Z annotate-moves -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z inline-mir -Z inline-mir-preserve-debug -Z mir_strip_debuginfo=locals-in-tiny-functions -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
[RUSTC-TIMING] core test:false 5.616
error: could not compile `core` (lib)

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name core --edition=2024 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -Z embed-metadata=no -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 --warn=unexpected_cfgs --check-cfg 'cfg(no_fp_fmt_parse)' --check-cfg 'cfg(feature, values(any()))' --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' --check-cfg 'cfg(no_io_statics)' -Cembed-bitcode=yes -Zunstable-options -Cforce-frame-pointers=non-leaf -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("debug_refcell", "optimize_for_size", "panic_immediate_abort"))' -C metadata=2d870288834c6e9d -C extra-filename=-d8b05ff2eeaa5dc3 --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage1-std/aarch64-unknown-linux-gnu/dist/build/core/d8b05ff2eeaa5dc3/out --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-std/dist/build/core/d8b05ff2eeaa5dc3/out -Zannotate-moves -Zrandomize-layout '--check-cfg=cfg(feature,values(any()))' -Zunstable-options -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 --cfg=randomized_layouts -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo` (exit status: 101)
Bootstrap failed while executing `--stage 2 test --skip tidy --skip intrinsic-test --skip compiler --skip src`
Currently active steps:
compile::Assemble { target_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false } } at src/bootstrap/src/core/build_steps/test.rs:1884
compile::Rustc { target: aarch64-unknown-linux-gnu, build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [] } at src/bootstrap/src/core/build_steps/compile.rs:2301
compile::Std { target: aarch64-unknown-linux-gnu, build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false } at src/bootstrap/src/core/build_steps/compile.rs:1071

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants