-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Labels
Description
auto-reduced (treereduce-rust):
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
fn main() {
let (a, .., b) = (2, 3);
}
original:
#[allow(non_camel_case_types)]
struct foo(usize);
fn main() {
let (a, .., b) = (2, 3); //~ ERROR let bindings cannot shadow tuple structs
}
Version information:
Possibly related line of code:
gccrs/gcc/rust/backend/rust-compile-pattern.cc
Lines 840 to 852 in 5c3e2ad
// | |
void | |
CompilePatternLet::visit (HIR::IdentifierPattern &pattern) | |
{ | |
Bvariable *var = nullptr; | |
rust_assert ( | |
ctx->lookup_var_decl (pattern.get_mappings ().get_hirid (), &var)); | |
auto fnctx = ctx->peek_fn (); | |
if (ty->is_unit ()) | |
{ | |
ctx->add_statement (init_expr); |
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/backend/rust-compile-pattern.cc:846
0x2fec938 internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:517
0xc0dfbb fancy_abort(char const*, int, char const*)
../../gcc/diagnostic.cc:1803
0x909583 Rust::Compile::CompilePatternLet::visit(Rust::HIR::IdentifierPattern&)
../../gcc/rust/backend/rust-compile-pattern.cc:846
0x11502e2 Rust::Compile::CompilePatternLet::Compile(Rust::HIR::Pattern*, tree_node*, Rust::TyTy::BaseType*, unsigned long, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile-pattern.h:123
0x11502e2 Rust::Compile::CompilePatternLet::visit(Rust::HIR::TuplePattern&)
../../gcc/rust/backend/rust-compile-pattern.cc:913
0x1159906 Rust::Compile::CompilePatternLet::Compile(Rust::HIR::Pattern*, tree_node*, Rust::TyTy::BaseType*, unsigned long, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile-pattern.h:123
0x1159906 Rust::Compile::CompileStmt::visit(Rust::HIR::LetStmt&)
../../gcc/rust/backend/rust-compile-stmt.cc:88
0x11599bc Rust::Compile::CompileStmt::Compile(Rust::HIR::Stmt*, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile-stmt.cc:36
0x118a83c Rust::Compile::HIRCompileBase::compile_function_body(tree_node*, Rust::HIR::BlockExpr&, Rust::TyTy::BaseType*)
../../gcc/rust/backend/rust-compile-base.cc:613
0x118d7c0 Rust::Compile::HIRCompileBase::compile_function(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tl::optional<Rust::HIR::SelfParam>&, std::vector<Rust::HIR::FunctionParam, std::allocator<Rust::HIR::FunctionParam> >&, Rust::HIR::FunctionQualifiers const&, Rust::HIR::Visibility&, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >&, unsigned long, Rust::HIR::BlockExpr*, Rust::Resolver::CanonicalPath const&, Rust::TyTy::FnType*)
../../gcc/rust/backend/rust-compile-base.cc:791
0x1157e91 Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
../../gcc/rust/backend/rust-compile-item.cc:220
0xdbee6b Rust::Compile::CompileItem::compile(Rust::HIR::Item*, Rust::Compile::Context*, Rust::TyTy::BaseType*, unsigned long)
../../gcc/rust/backend/rust-compile-item.h:37
0xdbee6b Rust::Compile::CompileCrate::go()
../../gcc/rust/backend/rust-compile.cc:48
0xdbee6b Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile.cc:41
0xdb98f0 Rust::Session::compile_crate(char const*)
../../gcc/rust/rust-session-manager.cc:732
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.