[ICE]: `not implemented` in the function `consider_builtin_pointee_candidate`

未关闭
#166,478 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
compilers

调研方向

The panic is the unimplemented! at compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs line 828, reached from the consider_builtin_pointee_candidate path during trait solving. Start by reproducing with the snippet in the issue (rustc --edition 2024, with unsafe_binders enabled) and read the candidate assembly around that line. Done means the snippet no longer ICEs, with a regression test added under tests/ui, likely next to ui/typeck/issue-112252-ptr-arithmetics-help.rs.

由索引模型根据 Issue 内容生成。

描述

C-bug F-unsafe_binders I-ICE needs-triage S-found-by-fuzzing T-compiler
Code
#![feature(unsafe_binders)]
#![expect(incomplete_features)]

fn main() {
    let _ptr1: *const unsafe<'a> &'a Box<()> = std::ptr::null();
}

A mutant of ui/typeck/issue-112252-ptr-arithmetics-help.rs.

Meta

rustc --version --verbose:

rustc 1.102.0-nightly (20fe935d5 2026-11-23)
binary: rustc
commit-hash: 20fe935d50367c0ff8872c2ebfa050c5c99d9201
commit-date: 2026-11-23
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.6
Error output

Command: rustc --edition 2024

thread 'rustc' (297803) panicked at /rustc-dev/20fe935d50367c0ff8872c2ebfa050c5c99d9201/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs:828:17:
not implemented
Backtrace

thread 'rustc' (297803) panicked at /rustc-dev/20fe935d50367c0ff8872c2ebfa050c5c99d9201/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs:828:17:
not implemented
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::panicking::unimplemented_default_msg
   4: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::assemble_and_evaluate_candidates::<rustc_type_ir::predicate::NormalizesTo<rustc_middle::ty::context::TyCtxt>>
   5: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_in_search_graph
   6: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_raw
   7: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_no_fast_paths
   8: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
   9: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::compute_trait_goal
  10: <rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<rustc_trait_selection::solve::delegate::SolverDelegate, rustc_middle::ty::context::TyCtxt>>::evaluate_goal_no_fast_paths
  11: <rustc_trait_selection::traits::engine::FulfillmentEngine<rustc_trait_selection::traits::FulfillmentError> as rustc_infer::traits::engine::TraitEngine<rustc_trait_selection::traits::FulfillmentError>>::try_evaluate_obligations
  12: rustc_hir_typeck::typeck_with_inspect::{closure#0}
      [... omitted 1 frame ...]
  13: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis::check_crate::{closure#1}>::{closure#0}
  14: rustc_hir_analysis::check_crate
  15: rustc_interface::passes::run_required_analyses
  16: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
  17: rustc_interface::passes::full_analysis
  18: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::compiler_entrypoint::{closure#0}>::{closure#2}
  19: <rustc_thread_pool::job::StackJob<rustc_thread_pool::latch::LatchRef<rustc_thread_pool::latch::LockLatch>, <rustc_thread_pool::registry::Registry>::in_worker_cold<<rustc_thread_pool::thread_pool::ThreadPool>::install<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#1}::{closure#0}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> as rustc_thread_pool::job::Job>::execute
  20: <rustc_thread_pool::registry::WorkerThread>::wait_or_steal_until_cold
  21: <rustc_thread_pool::registry::ThreadBuilder>::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please attach the file at `/home/jb/workspace/261124-ice-report-check/tmp/rustc-ice-2026-11-24T09_19_50-297792.txt` to your bug report

note: rustc 1.102.0-nightly (20fe935d5 2026-11-23) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck_root] type-checking `main`
#1 [required_analysis] running required analysis passes on crate `asdf`
end of query stack

Notes
Duplication Check
  • When searched with ICE location filepath "rustc_next_trait_solver/src/solve/normalizes_to.rs:", there exists no ICE issue that points this report's ICE location. github search result

@rustbot label +S-found-by-fuzzing +F-unsafe_binders

主要语言
Rust
星标
123k
派生
16.6k
平均合并
2 天 17 小时
30 天内合并 PR
532

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rust-lang/rust 的其他 Issue

查看 rust-lang/rust 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。