Skip to content

ICE in visit, at rust/checks/errors/rust-hir-pattern-analysis.cc:404 match on ouroboros type #3653

Open
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
type A = A;

fn main() {
    match A {}
}

original:

struct S(u8, u16);
type A = A;

fn main() {
    let main = A(0, 1); //~ ERROR expected function
    match A {
        A(..) => {} //~ ERROR expected function
    }
}

Version information:

7651217

Possibly related line of code:

match_arm.get_expr ().accept_vis (*this);
// match expressions are only an entrypoint
TyTy::BaseType *scrutinee_ty;
bool ok = tyctx.lookup_type (
expr.get_scrutinee_expr ().get_mappings ().get_hirid (), &scrutinee_ty);
rust_assert (ok);
check_match_usefulness (&tyctx, scrutinee_ty, expr);
}
void
PatternChecker::visit (AwaitExpr &)

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/checks/errors/rust-hir-pattern-analysis.cc:404
0x89483f Rust::Analysis::PatternChecker::visit(Rust::HIR::MatchExpr&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:404
0x10446d3 Rust::Analysis::PatternChecker::go(Rust::HIR::Crate&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:48
0xce8fa8 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:692
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions