-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Labels
Description
auto-reduced (treereduce-rust):
trait Bar {}
struct S;
fn test(foo: impl Bar) {}
original:
// run-rustfix
trait Foo {}
trait Bar {
fn hello(&self) {}
}
struct S;
impl Foo for S {}
impl Bar for S {}
fn test(foo: impl Bar) {
foo.hello(); // run-rustfix
}
fn main() {
test(S);
}
Version information:
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: tree check: expected var_decl or function_decl, have error_mark in setup_fndecl, at rust/backend/rust-compile-base.cc:71
0x9933eb tree_check_failed(tree_node const*, char const*, int, char const*, ...)
../../gcc/tree.cc:8955
0x8754b4 tree_check2(tree_node*, char const*, int, char const*, tree_code, tree_code)
../../gcc/tree.h:3631
0x8754b4 Rust::Compile::HIRCompileBase::setup_fndecl(tree_node*, bool, bool, Rust::HIR::Visibility&, Rust::HIR::FunctionQualifiers const&, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> > const&)
../../gcc/rust/backend/rust-compile-base.cc:71
0x100fbbd Rust::Compile::HIRCompileBase::compile_function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, 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 int, Rust::HIR::BlockExpr*, Rust::Resolver::CanonicalPath const&, Rust::TyTy::FnType*)
../../gcc/rust/backend/rust-compile-base.cc:695
0xfd862d Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
../../gcc/rust/backend/rust-compile-item.cc:256
0xc64994 Rust::Compile::CompileItem::compile(Rust::HIR::Item*, Rust::Compile::Context*, Rust::TyTy::BaseType*, unsigned int)
../../gcc/rust/backend/rust-compile-item.h:37
0xc64994 Rust::Compile::CompileCrate::go()
../../gcc/rust/backend/rust-compile.cc:48
0xc64a7b Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile.cc:41
0xc5c48b Rust::Session::compile_crate(char const*)
../../gcc/rust/rust-session-manager.cc:733
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.