#162774·Rust

[ICE]: `failed to resolve delegation to inherent impl`

Author: matthiaskrgrCreated Sep 14, 2026Updated Sep 17, 2026
LabelsI-ICET-compilerC-bugneeds-triageF-fn_delegation
auto-reduced (treereduce-rust): ````rust #![feature(fn_delegation)] trait Trait { fn foo<'a: 'a>(&self) {} } struct F; impl Trait for F {} struct S(F); impl S { reuse Trait::foo::<> { self.0 } reuse Self::foo::<'_> as bar { self.0 } } fn main() {} ```` original: ````rust //@ check-pass //@ compile-flags: -Z deduplicate-diagnostics=yes #![feature(fn_delegation)] trait Trait { fn foo<'a: 'a>(&self) {} } struct F; impl Trait for F {} struct S(F); impl S { reuse Trait::foo::<> { self.0 } reuse Self::foo::<'_> as bar { self.0 } } fn main() {} ```` Version information ```` rustc 1.100.0-nightly (a8a1e6fd9 2026-09-14) binary: rustc commit-hash: a8a1e6fd9df2e094d6f09c0d57991508680acc1c commit-date: 2026-09-14 host: x86_64-unknown-linux-gnu release: 1.100.0-nightly LLVM version: 23.1.1 ```` Command: `/home/matthias/.rustup/toolchains/master/bin/rustc ` Program output

``` warning: the feature `fn_delegation` is incomplete and may not be safe to use and/or cause compiler crashes --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:1:12 | 1 | #![feature(fn_delegation)] | ^^^^^^^^^^^^^ | = note: see issue #118212 for more information = note: `#[warn(incomplete_features)]` on by default warning: trait `Trait` is never used --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:3:7 | 3 | trait Trait { | ^^^^^ | = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default warning: struct `F` is never constructed --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:7:8 | 7 | struct F; | ^ warning: struct `S` is never constructed --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:10:8 | 10 | struct S(F); | ^ warning: associated items `foo` and `bar` are never used --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:12:18 | 11 | impl S { | ------ associated items in this implementation 12 | reuse Trait::foo::<> { self.0 } | ^^^ 13 | 14 | reuse Self::foo::<'_> as bar { self.0 } | ^^^ warning: 5 warnings emitted 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: failed to resolve delegation to inherent impl --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:14:17 | 14 | reuse Self::foo::<'_> as bar { self.0 } | ^^^ | note: delayed at /rustc-dev/a8a1e6fd9df2e094d6f09c0d57991508680acc1c/compiler/rustc_ast_lowering/src/delegation/resolution.rs:83:68 0: ::emit_diagnostic 1: ::emit_diagnostic 2: ::emit 3: ::span_delayed_bug:: 4: rustc_ast_lowering::delegation::resolution::resolve_type_relative_delegations 5: rustc_query_impl::query_vtables::resolve_type_relative_delegations::invoke_provider_fn::__rust_begin_short_backtrace 6: rustc_query_impl::execution::try_execute_query::>, false> 7: rustc_query_impl::query_vtables::resolve_type_relative_delegations::execute_query_non_incr::__rust_end_short_backtrace 8: rustc_ast_lowering::lower_to_hir 9: rustc_query_impl::query_vtables::lower_to_hir::invoke_provider_fn::__rust_begin_short_backtrace 10: rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> 11: rustc_query_impl::query_vtables::lower_to_hir::execute_query_non_incr::__rust_end_short_backtrace 12: rustc_query_impl::query_vtables::hir_owner::invoke_provider_fn::__rust_begin_short_backtrace 13: rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> 14: rustc_query_impl::query_vtables::hir_owner::execute_query_non_incr::__rust_end_short_backtrace 15: ::expect_hir_owner_nodes 16: rustc_middle::hir::map::hir_crate_items 17: rustc_query_impl::query_vtables::hir_crate_items::invoke_provider_fn::__rust_begin_short_backtrace 18: rustc_query_impl::execution::try_execute_query::>, false> 19: rustc_query_impl::query_vtables::hir_crate_items::execute_query_non_incr::__rust_end_short_backtrace 20: rustc_interface::passes::analysis 21: rustc_query_impl::execution::try_execute_query::>, false> 22: rustc_query_impl::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace 23: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#2} 24: std::sys::backtrace::__rust_begin_short_backtrace::::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> 25: ::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 26: ::new::thread_start 27: 28: --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:14:17 | 14 | reuse Self::foo::<'_> as bar { self.0 } | ^^^ error: internal compiler error: `Res::Err` but no error emitted --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:14:36 | 14 | reuse Self::foo::<'_> as bar { self.0 } | ^^^^ | note: delayed at /rustc-dev/a8a1e6fd9df2e094d6f09c0d57991508680acc1c/compiler/rustc_hir_typeck/src/expr.rs:598:32 0: ::emit_diagnostic 1: ::emit_diagnostic 2: ::emit 3: ::span_delayed_bug:: 4: ::check_expr_path 5: ::check_expr_with_expectation_and_args 6: ::check_expr_field 7: ::check_expr_with_expectation_and_args 8: ::check_expr_block 9: ::check_expr_with_expectation_and_args 10: ::check_expr_call 11: ::check_expr_with_expectation_and_args 12: ::check_expr_block 13: ::check_expr_with_expectation_and_args 14: rustc_hir_typeck::check::check_fn 15: rustc_hir_typeck::typeck_with_inspect::{closure#0} 16: rustc_query_impl::query_vtables::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace 17: rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> 18: rustc_query_impl::query_vtables::typeck_root::execute_query_non_incr::__rust_end_short_backtrace 19: ::par_hir_body_owners::::{closure#0} 20: rustc_hir_analysis::check_crate 21: rustc_interface::passes::analysis 22: rustc_query_impl::execution::try_execute_query::>, false> 23: rustc_query_impl::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace 24: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#2} 25: std::sys::backtrace::__rust_begin_short_backtrace::::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> 26: ::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 27: ::new::thread_start 28: 29: --> /tmp/icemaker_global_tempdir.FOTYhPGUBckV/rustc_testrunner_tmpdir_reporting.W5Ae5KwyzJd6/mvce.rs:14:36 | 14 | reuse Self::foo::<'_> as bar { self.0 } | ^^^^ 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.100.0-nightly (a8a1e6fd9 2026-09-14) running on x86_64-unknown-linux-gnu query stack during panic: end of query stack ```

@rustbot label +F-fn_delegation