Skip to content

Commit a59e35e

Browse files
committed
more stuff
1 parent 6aa9a06 commit a59e35e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

content/Rust-1.89.0.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you'd like to help us out by testing future releases, you might consider upda
2727
Rust now supports `_` as an argument to const generic parameters, inferring the value from surrounding context:
2828

2929
```rust
30-
pub fn make_bitset<const LEN: usize>() -> [bool; LEN] {
30+
pub fn all_false<const LEN: usize>() -> [bool; LEN] {
3131
[false; _]
3232
}
3333
```
@@ -36,11 +36,12 @@ 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 const fn make_bitset<const LEN: usize>() -> [bool; _] {
39+
pub const fn all_false<const LEN: usize>() -> [bool; _] {
4040
[false; LEN]
4141
}
42+
4243
// Neither is this
43-
pub const MY_BITSET: [bool; _] = make_bitset::<10>();
44+
pub const ALL_FALSE: [bool; _] = all_false::<10>();
4445
```
4546

4647
### Mismatched lifetime syntaxes lint
@@ -52,7 +53,7 @@ pub const MY_BITSET: [bool; _] = make_bitset::<10>();
5253
// but there's no visual indication of that.
5354
//
5455
// Lifetime elision infers the lifetime of the return
55-
// value to be the same as the argument `scores`.
56+
// type to be the same as that of `scores`.
5657
fn items(scores: &[u8]) -> std::slice::Iter<u8> {
5758
scores.iter()
5859
}

0 commit comments

Comments
 (0)