Rust-GCC / Rust-GCC/gccrs

ICE `in get_type_aliased, at rust/ast/rust-item.h:1594` missing trait

Open
#3,952 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Code
trait T {}

type S = for<'a> T+; // <- plus what?

fn main() {}
Meta

5c3e2adc695b04a199d37cacd8c23b14fdab914f

Error output
<output>
Backtrace

crab1: internal compiler error: in get_type_aliased, at rust/ast/rust-item.h:1594
0x2fec938 internal_error(char const*, ...)
  ../../gcc/diagnostic-global-context.cc:517
0xc0dfbb fancy_abort(char const*, int, char const*)
  ../../gcc/diagnostic.cc:1803
0x8fbf41 Rust::AST::TypeAlias::get_type_aliased()
  ../../gcc/rust/ast/rust-item.h:1594
0x8fbf41 Rust::AST::DefaultASTVisitor::visit(Rust::AST::TypeAlias&)
  ../../gcc/rust/ast/rust-ast-visitor.cc:900
0xd6d6ef void Rust::AST::DefaultASTVisitor::visit<Rust::AST::Item>(std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >&)
  ../../gcc/rust/ast/rust-ast-visitor.h:416
0xd6d6ef Rust::AST::DefaultASTVisitor::visit(Rust::AST::Crate&)
  ../../gcc/rust/ast/rust-ast-visitor.cc:38
0xdb8e37 Rust::AST::CollectLangItems::go(Rust::AST::Crate&)
  ../../gcc/rust/ast/rust-collect-lang-items.h:37
0xdb8e37 Rust::Session::compile_crate(char const*)
  ../../gcc/rust/rust-session-manager.cc:615
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 Rust snippet, then inspect Rust::AST::TypeAlias::get_type_aliased() at rust/ast/rust-item.h:1594 and its visitor call at rust/ast/rust-ast-visitor.cc:900. Done means this input no longer reaches an internal compiler error and the missing-trait case is handled without aborting.

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
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.