2021-05-27 16:36:45 -05:00
|
|
|
error[E0658]: `X..` patterns in slices are experimental
|
|
|
|
--> $DIR/slice_pattern_syntax_problem1.rs:4:10
|
|
|
|
|
|
|
|
|
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
|
2022-10-05 16:18:22 -05:00
|
|
|
= 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
|
2021-05-27 16:36:45 -05:00
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
error[E0005]: refutable pattern in local binding
|
|
|
|
--> $DIR/slice_pattern_syntax_problem1.rs:4:9
|
|
|
|
|
|
|
|
|
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!() };
|
|
|
|
| ++++++++++++++++
|
|
|
|
|
2024-04-27 19:35:32 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2021-05-27 16:36:45 -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`.
|