Skip to content

Commit

Permalink
Refine E0435 description
Browse files Browse the repository at this point in the history
  • Loading branch information
sasurau4 committed Jan 7, 2021
1 parent c9e7045 commit c71348a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_error_codes/src/error_codes/E0435.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ let foo = 42;
let a: [u8; foo]; // error: attempt to use a non-constant value in a constant
```

'constant' means 'a compile-time value'.

More details can be found in the [Variables and Mutability] section of the book.

[Variables and Mutability]: https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants

To fix this error, please replace the value with a constant. Example:

```
Expand Down

0 comments on commit c71348a

Please sign in to comment.