Rust-GCC / Rust-GCC/gccrs

ICE in visit, at rust/typecheck/rust-substitution-mapper.h:62 StrType

Open
#3,640 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
type X = str<i32>;

fn main() {}

original:

type X = str<i32>; //~ ERROR E0109

fn main() {
}

Version information:

765121736dfe3f5b319bbe9837880deda326394e

Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/765121736dfe3f5b319bbe9837880deda326394e/gcc/rust/typecheck/rust-substitution-mapper.h#L56-L68

Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: in visit, at rust/typecheck/rust-substitution-mapper.h:62
0x8938bc Rust::Resolver::SubstMapper::visit(Rust::TyTy::StrType&)
	../../gcc/rust/typecheck/rust-substitution-mapper.h:62
0x10380f4 Rust::Resolver::SubstMapper::Resolve(Rust::TyTy::BaseType*, unsigned int, Rust::HIR::GenericArgs*, std::vector<Rust::TyTy::Region, std::allocator<Rust::TyTy::Region> > const&)
	../../gcc/rust/typecheck/rust-substitution-mapper.cc:38
0xf9562c Rust::Resolver::TypeCheckType::resolve_root_path(Rust::HIR::TypePath&, unsigned long*, bool*)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:454
0xf970b2 Rust::Resolver::TypeCheckType::visit(Rust::HIR::TypePath&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:139
0xf92e86 Rust::Resolver::TypeCheckType::Resolve(Rust::HIR::Type&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:70
0xf94d67 Rust::Resolver::TypeCheckType::Resolve(Rust::HIR::Type&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:66
0xf7bc8d Rust::Resolver::TypeCheckItem::visit(Rust::HIR::TypeAlias&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:154
0xf7dbb7 Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
	../../gcc/rust/typecheck/rust-hir-type-check-item.cc:59
0xf1518b Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
	../../gcc/rust/typecheck/rust-hir-type-check.cc:75
0xce8f73 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

Run the reduced Rust input with -frust-incomplete-and-experimental-compiler-do-not-use and confirm the ICE at rust/typecheck/rust-substitution-mapper.h:62. Trace the call through rust/typecheck/rust-substitution-mapper.cc and the TypeCheckType entries named in the backtrace; done means the invalid str input reports E0109 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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.