Rust-GCC / Rust-GCC/gccrs

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

Open
#4,738 0 comments 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

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core
struct Bar;
struct Foo {
    bar: Bar,
}

fn foo(Foo { bar }: &Foo) {}

original:

struct Bar;
struct Foo { bar: Bar }

fn foo(Foo { bar }: &Foo) {}

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#L279-L291

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:285
0x32edd17 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:787
0xc847b9 fancy_abort(char const*, int, char const*)
	../../gcc/diagnostics/context.cc:1813
0x927f94 Rust::HIR::StructPattern::is_refutable(Rust::TyTy::BaseType const&) const
	../../gcc/rust/hir/tree/rust-hir-pattern-abstract.cc:285
0x1199b6e Rust::Analysis::PatternChecker::visit(Rust::HIR::Function&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:487
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.5TlMaCwXXl4l/rustc_testrunner_tmpdir_reporting.6eRl6PNHB6zD/mvce.rs -o/tmp/icemaker_global_tempdir.5TlMaCwXXl4l/rustc_testrunner_tmpdir_reporting.6eRl6PNHB6zD/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

Reproduce the ICE with the reduced Rust snippet and command from the issue. Start at gcc/rust/hir/tree/rust-hir-pattern-abstract.cc:285, then read the caller in gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:487. Done means the snippet no longer aborts in is_refutable.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.