Rust-GCC / gccrs

GCC Front-End for Rust

Home Page:https://rust-gcc.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot create inherent impl for simple array type

CohenArthur opened this issue · comments

I tried this code:

impl<T> [T; 1] {
    fn floop() {}
}

the code is incorrect, but since #3015 is still present we cannot have a generic array implementation - and this is used for implementing Default on arrays up to 32 members, so it should still work.

Instead, this happened:

crab1: internal compiler error: in visit, at rust/resolve/rust-ast-resolve-item.cc:585
0x2525001 Rust::Resolver::ResolveItem::visit(Rust::AST::InherentImpl&)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/resolve/rust-ast-resolve-item.cc:585
0x21bba20 Rust::AST::InherentImpl::accept_vis(Rust::AST::ASTVisitor&)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-ast.cc:4785
0x2522416 Rust::Resolver::ResolveItem::go(Rust::AST::Item&, Rust::Resolver::CanonicalPath const&, Rust::Resolver::CanonicalPath const&)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/resolve/rust-ast-resolve-item.cc:174
0x2513d9b Rust::Resolver::NameResolution::go(Rust::AST::Crate&)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/resolve/rust-ast-resolve.cc:105
0x2513991 Rust::Resolver::NameResolution::Resolve(Rust::AST::Crate&)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/resolve/rust-ast-resolve.cc:58
0x22f7969 Rust::Session::compile_crate(char const*)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/rust-session-manager.cc:632
0x22f71a1 Rust::Session::handle_input_files(int, char const**)
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/rust-session-manager.cc:416
0x2151162 grs_langhook_parse_file()
	/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/rust-lang.cc:165
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.

the type ([T; 1]) does not get resolved properly and the name resolver triggers an assertion

the code does not work with name-resolution 2.0 but it triggers a different issue