Skip to content

delegation: OOM #155060

Description

@matthiaskrgr

I tried this code:

#![feature(fn_delegation)]
trait Trait<T> {
    fn foo<U>(&self, _: dyn Trait) {}
}

reuse Trait::<_>::foo::<i32> as x;

fn main() {}

I expected to see this happen:
no oom

Instead, this happened:
oom

Meta

rustc --version --verbose:

rustc 1.96.0-nightly (a87c9b960 2026-04-09)
binary: rustc
commit-hash: a87c9b96031d4d8698bb0cd6533e83bc6d77ddaa
commit-date: 2026-04-09
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2
Backtrace

   8,68%  librustc_driver-5ecf1647954ff888.so             [.] rustc_query_impl::execution::collect_active_query_jobs
   4,59%  librustc_driver-5ecf1647954ff888.so             [.] rustc_query_impl::execution::collect_active_query_jobs_inner::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 16]>>>
   3,57%  librustc_driver-5ecf1647954ff888.so             [.] rustc_query_impl::execution::collect_active_query_jobs_inner::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 0]>, rustc_middle::dep_graph::graph::DepNodeIndex>>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-fn_delegation`#![feature(fn_delegation)]`I-compilememIssue: Problems and improvements with respect to memory usage during compilation.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions