Rust-GCC / Rust-GCC/gccrs

ICE in insert_variant_definition, at rust/typecheck/rust-typecheck-context.cc:375

Open
#3,547 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):


mod foo {
    pub enum t { t1, }
}

 fn main() { let _v = foo::t::t1::t1; }

original:

// run-pass
#// run-pass[allow(non_camel_case_types)]
// pretty-expanded FIXME #23616

mod foo {
    pub enum t { t1, }
}

 fn main() { let _v = foo::t::t1::t1; }

Version information:

a988708b4ba2b5a27715ea34c09ccfd3ed5143ca

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 insert_variant_definition, at rust/typecheck/rust-typecheck-context.cc:375
0x86a1ab Rust::Resolver::TypeCheckContext::insert_variant_definition(unsigned int, unsigned int)
	../../gcc/rust/typecheck/rust-typecheck-context.cc:375
0xfae226 Rust::Resolver::TypeCheckExpr::resolve_segments(unsigned int, std::vector<Rust::HIR::PathExprSegment, std::allocator<Rust::HIR::PathExprSegment> >&, unsigned long, Rust::TyTy::BaseType*, Rust::Analysis::NodeMapping const&, unsigned int)
	../../gcc/rust/typecheck/rust-hir-type-check-path.cc:473
0xfb000c Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::PathInExpression&)
	../../gcc/rust/typecheck/rust-hir-type-check-path.cc:248
0xf192b8 Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr&)
	../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:47
0xf28e21 Rust::Resolver::TypeCheckStmt::visit(Rust::HIR::LetStmt&)
	../../gcc/rust/typecheck/rust-hir-type-check-stmt.cc:84
0xf28f15 Rust::Resolver::TypeCheckStmt::Resolve(Rust::HIR::Stmt&)
	../../gcc/rust/typecheck/rust-hir-type-check-stmt.cc:34
0xf1aaa1 Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::BlockExpr&)
	../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:602
0xf192b8 Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr&)
	../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:47
0xef6140 Rust::Resolver::TypeCheckItem::visit(Rust::HIR::Function&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:638
0xeecb37 Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:59
0xe84e8b Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
	../../gcc/rust/typecheck/rust-hir-type-check.cc:75
0xc5c2d3 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.

Research direction

Reproduce the reduced Rust program with the reported crab1 command, then inspect insert_variant_definition at rust/typecheck/rust-typecheck-context.cc:375 and its callers in rust/typecheck/rust-hir-type-check-path.cc. Trace resolution of foo::t::t1::t1 and verify that the compiler handles this input without an internal compiler error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.