[ICE]: arg must exist for infer
Author: matthiaskrgrCreated Sep 28, 2026Updated Sep 28, 2026
LabelsI-ICET-compilerC-bugneeds-triageF-fn_delegation
auto-reduced (treereduce-rust):
struct S;
trait Trait<const Self: usize = 2> {
fn foo();
}
impl S {
reuse Trait::<_>::foo ;
}
original:
#![feature(fn_delegation)]
struct S;
trait Trait<const Self: usize = 2> {
fn foo();
}
impl S {
reuse Trait::<_>::foo ;
}
fn main() {}
Version information
rustc 1.101.0-nightly (c1070d693 2026-09-28)
binary: rustc
commit-hash: c1070d69382b8d2f2eb65119c738a77d9e324c9e
commit-date: 2026-09-28
host: x86_64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.1
Possibly related line of code: https://github.com/rust-lang/rust/blob/c1070d69382b8d2f2eb65119c738a77d9e324c9e/compiler/rustc_ast_lowering/src/delegation/mod.rs#L527-L539
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
error: expected identifier, found keyword `Self`
--> /tmp/icemaker_global_tempdir.EVjskufWNHMt/rustc_testrunner_tmpdir_reporting.gqSsVl8Cd71m/mvce.rs:3:19
|
3 | trait Trait<const Self: usize = 2> {
| ^^^^ expected identifier, found keyword
error[E0658]: functions delegation is not yet fully implemented
--> /tmp/icemaker_global_tempdir.EVjskufWNHMt/rustc_testrunner_tmpdir_reporting.gqSsVl8Cd71m/mvce.rs:7:2
|
7 | reuse Trait::<_>::foo ;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #118212 <https://github.com/rust-lang/rust/issues/118212> for more information
= help: add `#![feature(fn_delegation)]` to the crate attributes to enable
= note: this compiler was built on 2026-09-28; consider upgrading it if it is out of date
thread 'rustc' (1559202) panicked at /rustc-dev/c1070d69382b8d2f2eb65119c738a77d9e324c9e/compiler/rustc_ast_lowering/src/delegation/mod.rs:533:64:
arg must exist for infer
stack backtrace:
0: 0x7fa40ec3f2a6 - <<std[af611e8e58dabf54]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[f1c628afe7e04b32]::fmt::Display>::fmt
1: 0x7fa40f20935f - core[f1c628afe7e04b32]::fmt::write
2: 0x7fa40ec5419c - <std[af611e8e58dabf54]::sys::stdio::unix::Stderr as core[f1c628afe7e04b32]::io::write::Write>::write_fmt
3: 0x7fa40ec11bba - std[af611e8e58dabf54]::panicking::default_hook::{closure#0}
4: 0x7fa40ec336b3 - std[af611e8e58dabf54]::panicking::default_hook
5: 0x7fa40d96dac5 - std[af611e8e58dabf54]::panicking::update_hook::<alloc[adf45ffcb3834945]::boxed::Box<rustc_driver_impl[ea0ca4a178486b3a]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7fa40ec33b52 - std[af611e8e58dabf54]::panicking::panic_with_hook
7: 0x7fa40ec11c72 - std[af611e8e58dabf54]::panicking::panic_handler::{closure#0}
8: 0x7fa40ec0aa89 - std[af611e8e58dabf54]::sys::backtrace::__rust_end_short_backtrace::<std[af611e8e58dabf54]::panicking::panic_handler::{closure#0}, !>
9: 0x7fa40ec1384d - __rustc[1ad58332c490a294]::rust_begin_unwind
10: 0x7fa40b706c9c - core[f1c628afe7e04b32]::panicking::panic_fmt
11: 0x7fa40c6475b4 - core[f1c628afe7e04b32]::option::expect_failed
12: 0x7fa40d40b80a - <rustc_ast_lowering[d00790f80016fa11]::LoweringContext>::process_segment::{closure#1}::{closure#0}
13: 0x7fa40d40d5ae - <rustc_ast_lowering[d00790f80016fa11]::LoweringContext>::process_segment
14: 0x7fa40d410f4a - <rustc_ast_lowering[d00790f80016fa11]::LoweringContext>::lower_delegation
15: 0x7fa40f8dc4f2 - rustc_ast_lowering[d00790f80016fa11]::lower_to_hir
16: 0x7fa40f8d485f - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::lower_to_hir::invoke_provider_fn::__rust_begin_short_backtrace
17: 0x7fa40f8d301c - rustc_query_impl[e93b5f18b65b84fc]::execution::try_execute_query::<rustc_data_structures[d0770f23ab9bd95]::vec_cache::VecCache<rustc_span[c8a59e6aaa1389c3]::def_id::LocalDefId, rustc_middle[e05d4bd679e2af3b]::query::erase::ErasedData<[u8; 16usize]>, rustc_middle[e05d4bd679e2af3b]::dep_graph::graph::DepNodeIndex>, false>
18: 0x7fa40f8d2d62 - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::lower_to_hir::execute_query_non_incr::__rust_end_short_backtrace
19: 0x7fa40f8d2812 - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::hir_owner::invoke_provider_fn::__rust_begin_short_backtrace
20: 0x7fa40f8d1a5e - rustc_query_impl[e93b5f18b65b84fc]::execution::try_execute_query::<rustc_data_structures[d0770f23ab9bd95]::vec_cache::VecCache<rustc_span[c8a59e6aaa1389c3]::def_id::LocalDefId, rustc_middle[e05d4bd679e2af3b]::query::erase::ErasedData<[u8; 32usize]>, rustc_middle[e05d4bd679e2af3b]::dep_graph::graph::DepNodeIndex>, false>
21: 0x7fa40f8d17a2 - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::hir_owner::execute_query_non_incr::__rust_end_short_backtrace
22: 0x7fa4103fa700 - <rustc_middle[e05d4bd679e2af3b]::hir::map::ItemCollector as rustc_hir[f4ef7889e1efac0d]::intravisit::Visitor>::visit_nested_item
23: 0x7fa4103f7fd6 - rustc_middle[e05d4bd679e2af3b]::hir::map::hir_crate_items
24: 0x7fa4103fff5d - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::hir_crate_items::invoke_provider_fn::__rust_begin_short_backtrace
25: 0x7fa410309bd7 - rustc_query_impl[e93b5f18b65b84fc]::execution::try_execute_query::<rustc_middle[e05d4bd679e2af3b]::query::caches::SingleCache<rustc_middle[e05d4bd679e2af3b]::query::erase::ErasedData<[u8; 8usize]>>, false>
26: 0x7fa410309764 - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::hir_crate_items::execute_query_non_incr::__rust_end_short_backtrace
27: 0x7fa40fbee26e - rustc_interface[bb8b4c8c6b0292de]::passes::analysis
28: 0x7fa41030909f - rustc_query_impl[e93b5f18b65b84fc]::execution::try_execute_query::<rustc_middle[e05d4bd679e2af3b]::query::caches::SingleCache<rustc_middle[e05d4bd679e2af3b]::query::erase::ErasedData<[u8; 0usize]>>, false>
29: 0x7fa410308e53 - rustc_query_impl[e93b5f18b65b84fc]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
30: 0x7fa4104ed024 - rustc_interface[bb8b4c8c6b0292de]::interface::run_compiler::<(), rustc_driver_impl[ea0ca4a178486b3a]::run_compiler::{closure#0}>::{closure#2}
31: 0x7fa41053a364 - std[af611e8e58dabf54]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[bb8b4c8c6b0292de]::util::run_in_thread_with_globals<rustc_interface[bb8b4c8c6b0292de]::util::run_in_thread_pool_with_globals<rustc_interface[bb8b4c8c6b0292de]::interface::run_compiler<(), rustc_driver_impl[ea0ca4a178486b3a]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
32: 0x7fa41053a10b - <std[af611e8e58dabf54]::thread::lifecycle::spawn_unchecked<rustc_interface[bb8b4c8c6b0292de]::util::run_in_thread_with_globals<rustc_interface[bb8b4c8c6b0292de]::util::run_in_thread_pool_with_globals<rustc_interface[bb8b4c8c6b0292de]::interface::run_compiler<(), rustc_driver_impl[ea0ca4a178486b3a]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[f1c628afe7e04b32]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
33: 0x7fa41053895b - <std[af611e8e58dabf54]::sys::thread::unix::Thread>::new::thread_start
34: 0x7fa4094980a2 - <unknown>
35: 0x7fa40952080c - <unknown>
36: 0x0 - <unknown>
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: please make sure that you have updated to the latest nightly
note: rustc 1.101.0-nightly (c1070d693 2026-09-28) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [lower_to_hir] lowering HIR for `<impl at /tmp/icemaker_global_tempdir.EVjskufWNHMt/rustc_testrunner_tmpdir_reporting.gqSsVl8Cd71m/mvce.rs:6:1: 6:7>::foo`
#1 [hir_owner] getting owner for `<impl at /tmp/icemaker_global_tempdir.EVjskufWNHMt/rustc_testrunner_tmpdir_reporting.gqSsVl8Cd71m/mvce.rs:6:1: 6:7>::foo`
#2 [hir_crate_items] getting HIR crate items
#3 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
@rustbot label +F-fn_delegation
Source: rust-lang/rust