2022-10-05 16:18:22 -05:00
|
|
|
error[E0658]: `X..` patterns in slices are experimental
|
2024-04-27 19:35:32 -05:00
|
|
|
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:10
|
2022-10-05 16:18:22 -05:00
|
|
|
|
|
|
|
|
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
|
|
|
|
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
2024-01-10 00:39:02 -06:00
|
|
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
2022-10-05 16:18:22 -05:00
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
error[E0005]: refutable pattern in local binding
|
2024-04-27 19:35:32 -05:00
|
|
|
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:9
|
2024-02-01 16:45:00 -06:00
|
|
|
|
|
|
|
|
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `[i32::MIN..=2_i32, ..]` not covered
|
|
|
|
|
|
|
|
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
|
|
|
|
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
|
|
|
= note: the matched value is of type `[i32; 8]`
|
|
|
|
help: you might want to use `let else` to handle the variant that isn't matched
|
|
|
|
|
|
|
|
|
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs else { todo!() };
|
|
|
|
| ++++++++++++++++
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2022-10-05 16:18:22 -05:00
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
Some errors have detailed explanations: E0005, E0658.
|
|
|
|
For more information about an error, try `rustc --explain E0005`.
|