百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#163457·Rust

[ICE]: arg 必须存在才能进行推断

作者: matthiaskrgr创建于 2026年9月28日更新于 2026年9月28日
标签I-ICET-compilerC-bugneeds-triageF-fn_delegation

auto-reduced (treereduce-Rust):

rust
struct S;
trait Trait<const Self: usize = 2> {
	fn foo();
}
impl S {
	reuse Trait::<_>::foo ;
}

original:

rust
#![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 `

<details><summary><strong>Program output</strong></summary>
<p>
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:

内容来源: rust-lang/rust

查看 GitHub 原文在 GitHub 查看讨论