-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Description
E0572
- return statement was found outside of a function body:
- You can view the same on
godbolt
I tried this code from E0572
const FOO: u32 = return 0; // error: return statement outside of function body
fn main() {}
Meta
- What version of Rust GCC were you using, git sha 1bc8f08
- gccrs (Compiler-Explorer-Build-gcc-ccac7ed46c2e81434714d74a86d58d2e5e1df7c8-binutils-2.40) 13.0.1 20230417 (experimental)
Error output
- Internal Compiler Error:
Backtrace :
crab1: internal compiler error: in peek_return_type, at rust/typecheck/rust-typecheck-context.cc:148
0x7bb5ac Rust::Resolver::TypeCheckContext::peek_return_type()
../../gccrs/gcc/rust/typecheck/rust-typecheck-context.cc:148
0xc20e92 Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::ReturnExpr&)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check-expr.cc:153
0xc1fce3 Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check-expr.cc:41
0xc0cf70 Rust::Resolver::TypeCheckItem::visit(Rust::HIR::ConstantItem&)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:313
0xc0d500 Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:49
0xc0d500 Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:35
0xbd3b5b Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
../../gccrs/gcc/rust/typecheck/rust-hir-type-check.cc:37
0xa712bb Rust::Session::compile_crate(char const*)
../../gccrs/gcc/rust/rust-session-manager.cc:631
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
Labels
Type
Projects
Status
Done