Rust-GCC / Rust-GCC/gccrs

ICE in is_refutable, at rust/hir/tree/rust-hir-pattern-abstract.cc:103

Open
#4,737 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

snippet:

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core
fn main() {
    let &[0] = &[0] as &[_];
}

Version information:

c539964b8cc842e871d77b45150df6a5882335fb

Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/c539964b8cc842e871d77b45150df6a5882335fb/gcc/rust/hir/tree/rust-hir-pattern-abstract.cc#L97-L109

Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core -frust-crate-attr=feature(no_core)

Program output

crab1: internal compiler error: in is_refutable, at rust/hir/tree/rust-hir-pattern-abstract.cc:103
0x32edd17 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:787
0xc847b9 fancy_abort(char const*, int, char const*)
	../../gcc/diagnostics/context.cc:1813
0x92802c Rust::HIR::SlicePattern::is_refutable(Rust::TyTy::BaseType const&) const
	../../gcc/rust/hir/tree/rust-hir-pattern-abstract.cc:103
0x1199a59 Rust::Analysis::PatternChecker::visit(Rust::HIR::LetStmt&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:702
0x1199593 Rust::Analysis::PatternChecker::visit(Rust::HIR::BlockExpr&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:281
0x119a4e3 Rust::Analysis::PatternChecker::go(Rust::HIR::Crate&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:46
0xecc43b Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:815
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 /tmp/icemaker_global_tempdir.B2FG2Wbdt9GO/rustc_testrunner_tmpdir_reporting.GUJy1iwKCpJK/mvce.rs -o/tmp/icemaker_global_tempdir.B2FG2Wbdt9GO/rustc_testrunner_tmpdir_reporting.GUJy1iwKCpJK/binaryname -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core -frust-crate-attr=feature(no_core)
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.

Research direction

Start by running the supplied Rust snippet with the listed gccrs flags and confirm the ICE. Inspect is_refutable in gcc/rust/hir/tree/rust-hir-pattern-abstract.cc around line 103, then follow its call from rust-hir-pattern-analysis.cc:702. Done means the reproducer no longer triggers an internal compiler error and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.