-
Notifications
You must be signed in to change notification settings - Fork 191
Labels
Description
Nice work but i just realised yes this need another change sorry. This null_tree check should still stay but you need another check the error should be:
error[E0658]: `loop` is not allowed in a `static`
--> <source>:1:17
|
1 | static _X: () = loop {};
| ^^^^^^^
|
= note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
error: aborting due to previous error
So what you need to do is add a catch here:
gccrs/gcc/rust/backend/rust-compile-expr.cc
Line 671 in fc6b543
TyTy::BaseType *block_tyty = nullptr; |
if (ctx->const_context_p ())
{
rich_location r;
rust_error_at (r, ErrorCode::0658, "%<loop%> is not allowed in const context");
return;
}
Originally posted by @philberty in #3781 (comment)