From aa13d470f359c688ff58144742c2c4bcad8739e6 Mon Sep 17 00:00:00 2001 From: wieDasDing <6884440+dingxiangfei2009@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:47:07 +0800 Subject: [PATCH] add error code Co-authored-by: Eric Huss --- src/const_eval.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/const_eval.md b/src/const_eval.md index 4c243244e..4e106f286 100644 --- a/src/const_eval.md +++ b/src/const_eval.md @@ -83,7 +83,7 @@ const A_CONST: &'static u32 = allowed(); On the contrary, for example, `static mut` and types embedding an `UnsafeCell` is not allowed. -```rust,edition2021,compile_fail +```rust,edition2021,compile_fail,E0080 const fn not_allowed() -> &'static u32 { static mut VALUE: u32 = 0; &VALUE