Rust-GCC / Rust-GCC/gccrs

ICE in visit, at rust/typecheck/rust-hir-type-check-implitem.cc:496

Open
#3,596 0 comments 0 reactions 1 assignee View on GitHub

@philberty is already working on this.

Since Sep 15, 2026.

bug
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

auto-reduced (treereduce-rust):

impl &[u8; 2] {
    fn bar(self) {}
}

original:

struct Foo;

impl &[u8; 2] {
    //~^ ERROR E0118
    fn bar(self) {}
}

fn main() {}

Version information:

34b0a681598d52de442a0a21c3a7df20bf1485bc

Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/34b0a681598d52de442a0a21c3a7df20bf1485bc/gcc/rust/typecheck/rust-hir-type-check-implitem.cc#L490-L502

Command:
crab1 -Warray-bounds -mtune=generic -march=x86-64 -O0 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: in visit, at rust/typecheck/rust-hir-type-check-implitem.cc:496
0x86b6d5 Rust::Resolver::TypeCheckImplItem::visit(Rust::HIR::Function&)
	../../gcc/rust/typecheck/rust-hir-type-check-implitem.cc:496
0xf371d7 Rust::Resolver::TypeCheckImplItem::Resolve(Rust::HIR::ImplBlock&, Rust::HIR::ImplItem&, Rust::TyTy::BaseType*, std::vector<Rust::TyTy::SubstitutionParamMapping, std::allocator<Rust::TyTy::SubstitutionParamMapping> >)
	../../gcc/rust/typecheck/rust-hir-type-check-implitem.cc:351
0xf371d7 Rust::Resolver::TypeCheckImplItem::Resolve(Rust::HIR::ImplBlock&, Rust::HIR::ImplItem&, Rust::TyTy::BaseType*, std::vector<Rust::TyTy::SubstitutionParamMapping, std::allocator<Rust::TyTy::SubstitutionParamMapping> >)
	../../gcc/rust/typecheck/rust-hir-type-check-implitem.cc:335
0xef2366 Rust::Resolver::TypeCheckItem::visit(Rust::HIR::ImplBlock&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:527
0xeed5f7 Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:59
0xe84f0b Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
	../../gcc/rust/typecheck/rust-hir-type-check.cc:75
0xc5c313 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:685
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.