Skip to content

Commit 1ebc7da

Browse files
authored
Explicitly clarify const items' types for gai
1 parent e065861 commit 1ebc7da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/Rust-1.89.0.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ Similar to the rules for when `_` is permitted as a type, `_` is not permitted a
3636

3737
```rust
3838
// This is not allowed
39-
pub fn make_bitset<const LEN: usize>() -> [bool; _] {
39+
pub const fn make_bitset<const LEN: usize>() -> [bool; _] {
4040
[false; LEN]
4141
}
42+
// Neither is this
43+
pub const MY_BITSET: [bool; _] = make_bitset::<10>();
4244
```
4345

4446
### Mismatched lifetimes syntax lint

0 commit comments

Comments
 (0)