Skip to content

Commit

Permalink
add error code
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Huss <[email protected]>
  • Loading branch information
dingxiangfei2009 and ehuss authored Sep 30, 2024
1 parent 9340d52 commit aa13d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/const_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa13d47

Please sign in to comment.