Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE - when impl Trait type expands to a recursive type [E0720] #2523

Open
MahadMuhammad opened this issue Aug 4, 2023 · 1 comment
Open
Assignees
Labels

Comments

@MahadMuhammad
Copy link
Contributor

impl Trait type expands to a recursive type E0720

Code

#![allow(unused)]
fn main() {
fn make_recursive_type() -> impl Sized {
    [make_recursive_type(), make_recursive_type()]
}
}

Meta

  • What version of Rust GCC were you using, git sha f7d9373
  • gccrs (Compiler-Explorer-Build-gcc-f7d937321b2426eba5dd5fd0d288967324256f04-binutils-2.40) 13.0.1 20230417 (experimental)

Error output

  • Internal Compiler Error.
 ➜  gccrs-build gcc/crab1 ../mahad-testsuite/E0720.rs                                               
crab1: internal compiler error: in translate, at rust/hir/rust-ast-lower-type.cc:188
0x7c2307 Rust::HIR::ASTLoweringType::translate(Rust::AST::Type*)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-type.cc:188
0xbe05df Rust::HIR::ASTLoweringItem::visit(Rust::AST::Function&)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-item.cc:420
0xbdb2c0 Rust::HIR::ASTLoweringItem::translate(Rust::AST::Item*)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-item.cc:37
0xbf6e2f Rust::HIR::ASTLoweringStmt::visit(Rust::AST::ConstantItem&)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-stmt.cc:64
0xbf71cf Rust::HIR::ASTLoweringStmt::translate(Rust::AST::Stmt*, bool*)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-stmt.cc:32
0xbd0aa4 Rust::HIR::ASTLoweringBlock::visit(Rust::AST::BlockExpr&)
   ../../gccrs/gcc/rust/hir/rust-ast-lower.cc:114
0xbe0770 Rust::HIR::ASTLoweringBlock::translate(Rust::AST::BlockExpr*, bool*)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-block.h:37
0xbe0770 Rust::HIR::ASTLoweringItem::visit(Rust::AST::Function&)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-item.cc:445
0xbdb2c0 Rust::HIR::ASTLoweringItem::translate(Rust::AST::Item*)
   ../../gccrs/gcc/rust/hir/rust-ast-lower-item.cc:37
0xbd06b8 Rust::HIR::ASTLowering::go()
   ../../gccrs/gcc/rust/hir/rust-ast-lower.cc:79
0xbd09b8 Rust::HIR::ASTLowering::Resolve(Rust::AST::Crate&)
   ../../gccrs/gcc/rust/hir/rust-ast-lower.cc:69
0xabf6c8 Rust::Session::compile_crate(char const*)
   ../../gccrs/gcc/rust/rust-session-manager.cc:624
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.
@powerboat9
Copy link
Contributor

fn make_recursive_type() -> impl Sized {}

fn main() {}

This triggers the same ICE. It looks like impl Trait doesn't work in function return position yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants