Stabilize exclusive_range
This commit is contained in:
parent
79734f1db8
commit
6967d1c0fc
74 changed files with 300 additions and 619 deletions
|
@ -1,7 +1,7 @@
|
|||
use rustc_ast as ast;
|
||||
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
|
||||
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
|
||||
use rustc_ast::{token, PatKind, RangeEnd};
|
||||
use rustc_ast::{token, PatKind};
|
||||
use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP};
|
||||
use rustc_session::parse::{feature_err, feature_err_issue, feature_warn};
|
||||
use rustc_session::Session;
|
||||
|
@ -418,15 +418,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||
PatKind::Box(..) => {
|
||||
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
|
||||
}
|
||||
PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => {
|
||||
gate!(
|
||||
&self,
|
||||
exclusive_range_pattern,
|
||||
pattern.span,
|
||||
"exclusive range pattern syntax is experimental",
|
||||
"use an inclusive range pattern, like N..=M"
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
visit::walk_pat(self, pattern)
|
||||
|
@ -619,10 +610,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
|
|||
// be too.
|
||||
gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
|
||||
gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
|
||||
gate_all_legacy_dont_use!(
|
||||
exclusive_range_pattern,
|
||||
"exclusive range pattern syntax is experimental"
|
||||
);
|
||||
gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
|
||||
gate_all_legacy_dont_use!(auto_traits, "`auto` traits are unstable");
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ A lower range wasn't less than the upper range.
|
|||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0579
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match 5u32 {
|
||||
|
|
|
@ -162,6 +162,8 @@ declare_features! (
|
|||
(accepted, drop_types_in_const, "1.22.0", Some(33156)),
|
||||
/// Allows using `dyn Trait` as a syntax for trait objects.
|
||||
(accepted, dyn_trait, "1.27.0", Some(44662)),
|
||||
/// Allows `X..Y` patterns.
|
||||
(accepted, exclusive_range_pattern, "CURRENT_RUSTC_VERSION", Some(37854)),
|
||||
/// Allows integer match exhaustiveness checking (RFC 2591).
|
||||
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907)),
|
||||
/// Allows explicit generic arguments specification with `impl Trait` present.
|
||||
|
|
|
@ -454,8 +454,6 @@ declare_features! (
|
|||
(incomplete, dyn_star, "1.65.0", Some(102425)),
|
||||
/// Uses generic effect parameters for ~const bounds
|
||||
(unstable, effects, "1.72.0", Some(102090)),
|
||||
/// Allows `X..Y` patterns.
|
||||
(unstable, exclusive_range_pattern, "1.11.0", Some(37854)),
|
||||
/// Allows exhaustive pattern matching on types that contain uninhabited types.
|
||||
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
|
||||
/// Allows explicit tail calls via `become` expression.
|
||||
|
|
|
@ -844,7 +844,6 @@ declare_lint! {
|
|||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// # #![feature(exclusive_range_pattern)]
|
||||
/// let x = 123u32;
|
||||
/// match x {
|
||||
/// 0..100 => { println!("small"); }
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
//! This is enough to compute usefulness: a pattern in a `match` expression is redundant iff it is
|
||||
//! not useful w.r.t. the patterns above it:
|
||||
//! ```compile_fail,E0004
|
||||
//! # #![feature(exclusive_range_pattern)]
|
||||
//! # fn foo() {
|
||||
//! match Some(0u32) {
|
||||
//! Some(0..100) => {},
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
//
|
||||
// Language features:
|
||||
// tidy-alphabetical-start
|
||||
#![cfg_attr(bootstrap, feature(exclusive_range_pattern))]
|
||||
#![cfg_attr(not(test), feature(coroutine_trait))]
|
||||
#![cfg_attr(test, feature(panic_update_hook))]
|
||||
#![cfg_attr(test, feature(test))]
|
||||
|
@ -179,7 +180,6 @@
|
|||
#![feature(const_try)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(dropck_eyepatch)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(fundamental)]
|
||||
#![feature(hashmap_internals)]
|
||||
#![feature(lang_items)]
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# `exclusive_range_pattern`
|
||||
|
||||
The tracking issue for this feature is: [#37854].
|
||||
|
||||
|
||||
[#67264]: https://github.com/rust-lang/rust/issues/67264
|
||||
[#37854]: https://github.com/rust-lang/rust/issues/37854
|
||||
-----
|
||||
|
||||
The `exclusive_range_pattern` feature allows non-inclusive range
|
||||
patterns (`0..10`) to be used in appropriate pattern matching
|
||||
contexts. It also can be combined with `#![feature(half_open_range_patterns]`
|
||||
to be able to use RangeTo patterns (`..10`).
|
||||
|
||||
It also enabled RangeFrom patterns but that has since been
|
||||
stabilized.
|
||||
|
||||
```rust
|
||||
#![feature(exclusive_range_pattern)]
|
||||
let x = 5;
|
||||
match x {
|
||||
0..10 => println!("single digit"),
|
||||
10 => println!("ten isn't part of the above range"),
|
||||
_ => println!("nor is everything else.")
|
||||
}
|
||||
```
|
|
@ -1,7 +1,7 @@
|
|||
# `half_open_range_patterns_in_slices`
|
||||
|
||||
The tracking issue for this feature is: [#67264]
|
||||
It is part of the `exclusive_range_pattern` feature,
|
||||
It is a future part of the `exclusive_range_pattern` feature,
|
||||
tracked at [#37854].
|
||||
|
||||
[#67264]: https://github.com/rust-lang/rust/issues/67264
|
||||
|
@ -12,7 +12,6 @@ This feature allow using top-level half-open range patterns in slices.
|
|||
|
||||
```rust
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Check specific cases of sorting candidates in match lowering.
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
// EMIT_MIR sort_candidates.constant_eq.SimplifyCfg-initial.after.mir
|
||||
fn constant_eq(s: &str, b: bool) -> u32 {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//@ run-pass
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
pub fn main() {
|
||||
match 5_usize {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//@ aux-build:static_cross_crate.rs
|
||||
//@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
|
||||
//@ normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
|
||||
#![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![allow(static_mut_refs)]
|
||||
|
||||
extern crate static_cross_crate;
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
pub fn main() {
|
||||
match 22 {
|
||||
0 .. 3 => {} //~ ERROR exclusive range pattern syntax is experimental
|
||||
_ => {}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/feature-gate-exclusive-range-pattern.rs:3:9
|
||||
|
|
||||
LL | 0 .. 3 => {}
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
|
@ -1,5 +1,4 @@
|
|||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision.rs:6:13
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision.rs:5:13
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error[E0527]: pattern requires 2 elements but array has 3
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:6:9
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:9
|
||||
|
|
||||
LL | [_, 99..] => {},
|
||||
| ^^^^^^^^^ expected 3 elements
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:6:13
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:13
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
[..9, 99..100, _] => {},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:12
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:12
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
@ -10,7 +10,7 @@ LL | [..9, 99..100, _] => {},
|
|||
found type `{integer}`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:15
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:15
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
@ -23,7 +23,7 @@ LL | [..9, 99..100, _] => {},
|
|||
found type `{integer}`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:19
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:19
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: `X..` patterns in slices are experimental
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:5:10
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:10
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^^^^
|
||||
|
@ -9,7 +9,7 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:5:9
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:9
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `[i32::MIN..=2_i32, ..]` not covered
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let "a".. = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns
|
||||
let .."a" = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:4:9
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:2:9
|
||||
|
|
||||
LL | let "a".. = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:5:11
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:3:11
|
||||
|
|
||||
LL | let .."a" = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:6:12
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:4:12
|
||||
|
|
||||
LL | let ..="a" = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Test various non-exhaustive matches for `X..`, `..=X` and `..X` ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:15:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:14:8
|
||||
|
|
||||
LL | m!(0f32, f32::NEG_INFINITY..);
|
||||
| ^^^^ pattern `_` not covered
|
||||
|
@ -11,7 +11,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
|
|||
| ++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:16:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:15:8
|
||||
|
|
||||
LL | m!(0f32, ..f32::INFINITY);
|
||||
| ^^^^ pattern `_` not covered
|
||||
|
@ -23,7 +23,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
|
|||
| ++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:25:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:24:8
|
||||
|
|
||||
LL | m!('a', ..core::char::MAX);
|
||||
| ^^^ pattern `'\u{10ffff}'` not covered
|
||||
|
@ -35,7 +35,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
|
|||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:25:8
|
||||
|
|
||||
LL | m!('a', ..ALMOST_MAX);
|
||||
| ^^^ pattern `'\u{10fffe}'..='\u{10ffff}'` not covered
|
||||
|
@ -47,7 +47,7 @@ LL | match $s { $($t)+ => {}, '\u{10fffe}'..='\u{10ffff}' => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\0'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
|
||||
|
|
||||
LL | m!('a', ALMOST_MIN..);
|
||||
| ^^^ pattern `'\0'` not covered
|
||||
|
@ -59,7 +59,7 @@ LL | match $s { $($t)+ => {}, '\0' => todo!() }
|
|||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
|
||||
|
|
||||
LL | m!('a', ..=ALMOST_MAX);
|
||||
| ^^^ pattern `'\u{10ffff}'` not covered
|
||||
|
@ -71,7 +71,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
|
|||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'b'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
|
||||
|
|
||||
LL | m!('a', ..=VAL | VAL_2..);
|
||||
| ^^^ pattern `'b'` not covered
|
||||
|
@ -83,7 +83,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
|
|||
| ++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'b'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
|
||||
|
|
||||
LL | m!('a', ..VAL_1 | VAL_2..);
|
||||
| ^^^ pattern `'b'` not covered
|
||||
|
@ -95,7 +95,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
|
|||
| ++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:40:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:39:12
|
||||
|
|
||||
LL | m!(0, ..u8::MAX);
|
||||
| ^ pattern `u8::MAX` not covered
|
||||
|
@ -107,7 +107,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:40:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `254_u8..=u8::MAX` not covered
|
||||
|
@ -119,7 +119,7 @@ LL | match $s { $($t)+ => {}, 254_u8..=u8::MAX => todo!() }
|
|||
| +++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u8` not covered
|
||||
|
@ -131,7 +131,7 @@ LL | match $s { $($t)+ => {}, 0_u8 => todo!() }
|
|||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u8::MAX` not covered
|
||||
|
@ -143,7 +143,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u8` not covered
|
||||
|
@ -155,7 +155,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u8` not covered
|
||||
|
@ -167,7 +167,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:53:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:52:12
|
||||
|
|
||||
LL | m!(0, ..u16::MAX);
|
||||
| ^ pattern `u16::MAX` not covered
|
||||
|
@ -179,7 +179,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:53:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `65534_u16..=u16::MAX` not covered
|
||||
|
@ -191,7 +191,7 @@ LL | match $s { $($t)+ => {}, 65534_u16..=u16::MAX => todo!() }
|
|||
| +++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u16` not covered
|
||||
|
@ -203,7 +203,7 @@ LL | match $s { $($t)+ => {}, 0_u16 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u16::MAX` not covered
|
||||
|
@ -215,7 +215,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u16` not covered
|
||||
|
@ -227,7 +227,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u16` not covered
|
||||
|
@ -239,7 +239,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:66:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:65:12
|
||||
|
|
||||
LL | m!(0, ..u32::MAX);
|
||||
| ^ pattern `u32::MAX` not covered
|
||||
|
@ -251,7 +251,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:66:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `4294967294_u32..=u32::MAX` not covered
|
||||
|
@ -263,7 +263,7 @@ LL | match $s { $($t)+ => {}, 4294967294_u32..=u32::MAX => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u32` not covered
|
||||
|
@ -275,7 +275,7 @@ LL | match $s { $($t)+ => {}, 0_u32 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u32::MAX` not covered
|
||||
|
@ -287,7 +287,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u32` not covered
|
||||
|
@ -299,7 +299,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u32` not covered
|
||||
|
@ -311,7 +311,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:79:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:78:12
|
||||
|
|
||||
LL | m!(0, ..u64::MAX);
|
||||
| ^ pattern `u64::MAX` not covered
|
||||
|
@ -323,7 +323,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:79:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `18446744073709551614_u64..=u64::MAX` not covered
|
||||
|
@ -335,7 +335,7 @@ LL | match $s { $($t)+ => {}, 18446744073709551614_u64..=u64::MAX => tod
|
|||
| ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u64` not covered
|
||||
|
@ -347,7 +347,7 @@ LL | match $s { $($t)+ => {}, 0_u64 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u64::MAX` not covered
|
||||
|
@ -359,7 +359,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u64` not covered
|
||||
|
@ -371,7 +371,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u64` not covered
|
||||
|
@ -383,7 +383,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:92:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:91:12
|
||||
|
|
||||
LL | m!(0, ..u128::MAX);
|
||||
| ^ pattern `u128::MAX` not covered
|
||||
|
@ -395,7 +395,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_u128..` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:92:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `340282366920938463463374607431768211454_u128..` not covered
|
||||
|
@ -407,7 +407,7 @@ LL | match $s { $($t)+ => {}, 340282366920938463463374607431768211454_u1
|
|||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u128` not covered
|
||||
|
@ -419,7 +419,7 @@ LL | match $s { $($t)+ => {}, 0_u128 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u128::MAX` not covered
|
||||
|
@ -431,7 +431,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u128` not covered
|
||||
|
@ -443,7 +443,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u128` not covered
|
||||
|
@ -455,7 +455,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:108:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:107:12
|
||||
|
|
||||
LL | m!(0, ..i8::MAX);
|
||||
| ^ pattern `i8::MAX` not covered
|
||||
|
@ -467,7 +467,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:108:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `126_i8..=i8::MAX` not covered
|
||||
|
@ -479,7 +479,7 @@ LL | match $s { $($t)+ => {}, 126_i8..=i8::MAX => todo!() }
|
|||
| +++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i8::MIN` not covered
|
||||
|
@ -491,7 +491,7 @@ LL | match $s { $($t)+ => {}, i8::MIN => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i8::MAX` not covered
|
||||
|
@ -503,7 +503,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i8` not covered
|
||||
|
@ -515,7 +515,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i8` not covered
|
||||
|
@ -527,7 +527,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:121:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:120:12
|
||||
|
|
||||
LL | m!(0, ..i16::MAX);
|
||||
| ^ pattern `i16::MAX` not covered
|
||||
|
@ -539,7 +539,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:121:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `32766_i16..=i16::MAX` not covered
|
||||
|
@ -551,7 +551,7 @@ LL | match $s { $($t)+ => {}, 32766_i16..=i16::MAX => todo!() }
|
|||
| +++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i16::MIN` not covered
|
||||
|
@ -563,7 +563,7 @@ LL | match $s { $($t)+ => {}, i16::MIN => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i16::MAX` not covered
|
||||
|
@ -575,7 +575,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i16` not covered
|
||||
|
@ -587,7 +587,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i16` not covered
|
||||
|
@ -599,7 +599,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:134:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:133:12
|
||||
|
|
||||
LL | m!(0, ..i32::MAX);
|
||||
| ^ pattern `i32::MAX` not covered
|
||||
|
@ -611,7 +611,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:134:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `2147483646_i32..=i32::MAX` not covered
|
||||
|
@ -623,7 +623,7 @@ LL | match $s { $($t)+ => {}, 2147483646_i32..=i32::MAX => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i32::MIN` not covered
|
||||
|
@ -635,7 +635,7 @@ LL | match $s { $($t)+ => {}, i32::MIN => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i32::MAX` not covered
|
||||
|
@ -647,7 +647,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i32` not covered
|
||||
|
@ -659,7 +659,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i32` not covered
|
||||
|
@ -671,7 +671,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:147:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:146:12
|
||||
|
|
||||
LL | m!(0, ..i64::MAX);
|
||||
| ^ pattern `i64::MAX` not covered
|
||||
|
@ -683,7 +683,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:147:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `9223372036854775806_i64..=i64::MAX` not covered
|
||||
|
@ -695,7 +695,7 @@ LL | match $s { $($t)+ => {}, 9223372036854775806_i64..=i64::MAX => todo
|
|||
| +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i64::MIN` not covered
|
||||
|
@ -707,7 +707,7 @@ LL | match $s { $($t)+ => {}, i64::MIN => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i64::MAX` not covered
|
||||
|
@ -719,7 +719,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i64` not covered
|
||||
|
@ -731,7 +731,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i64` not covered
|
||||
|
@ -743,7 +743,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:160:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:159:12
|
||||
|
|
||||
LL | m!(0, ..i128::MAX);
|
||||
| ^ pattern `i128::MAX` not covered
|
||||
|
@ -755,7 +755,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_i128..` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:160:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `170141183460469231731687303715884105726_i128..` not covered
|
||||
|
@ -767,7 +767,7 @@ LL | match $s { $($t)+ => {}, 170141183460469231731687303715884105726_i1
|
|||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i128::MIN` not covered
|
||||
|
@ -779,7 +779,7 @@ LL | match $s { $($t)+ => {}, i128::MIN => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i128::MAX` not covered
|
||||
|
@ -791,7 +791,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i128` not covered
|
||||
|
@ -803,7 +803,7 @@ LL | match $s { $($t)+ => {}, 43_i128 => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i128` not covered
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
// Test various exhaustive matches for `X..`, `..=X` and `..X` ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
macro_rules! m {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// Test half-open range patterns against their expression equivalents
|
||||
// via `.contains(...)` and make sure the dynamic semantics match.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unreachable_patterns)]
|
||||
|
||||
macro_rules! yes {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
// Test the parsing of half-open ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
#[cfg(FALSE)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
macro_rules! m {
|
||||
($s:expr, $($t:tt)+) => {
|
||||
match $s { $($t)+ => {} }
|
||||
|
|
|
@ -1,77 +1,77 @@
|
|||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:10:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:8:11
|
||||
|
|
||||
LL | m!(0, ..u8::MIN);
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:10:11
|
||||
|
|
||||
LL | m!(0, ..u16::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
|
||||
|
|
||||
LL | m!(0, ..u32::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:16:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
|
||||
|
|
||||
LL | m!(0, ..u64::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:18:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:16:11
|
||||
|
|
||||
LL | m!(0, ..u128::MIN);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:19:11
|
||||
|
|
||||
LL | m!(0, ..i8::MIN);
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
|
||||
|
|
||||
LL | m!(0, ..i16::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:25:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
|
||||
|
|
||||
LL | m!(0, ..i32::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:25:11
|
||||
|
|
||||
LL | m!(0, ..i64::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:29:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
|
||||
|
|
||||
LL | m!(0, ..i128::MIN);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:32:14
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:30:14
|
||||
|
|
||||
LL | m!(0f32, ..f32::NEG_INFINITY);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:34:14
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:32:14
|
||||
|
|
||||
LL | m!(0f64, ..f64::NEG_INFINITY);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:37:13
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:35:13
|
||||
|
|
||||
LL | m!('a', ..'\u{0}');
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
const PAT: u8 = 1;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
const PAT: u8 = 1;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/pat-tuple-5.rs:7:10
|
||||
--> $DIR/pat-tuple-5.rs:5:10
|
||||
|
|
||||
LL | match (0, 1) {
|
||||
| ------ this expression has type `({integer}, {integer})`
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//@ run-pass
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -9,26 +9,19 @@ fn main() {
|
|||
for x in -9 + 1..=(9 - 2) {
|
||||
if let n @ 2..3|4 = x {
|
||||
//~^ error: variable `n` is not bound in all patterns
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
errors_only.push(x);
|
||||
} else if let 2..3 | 4 = x {
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
if_lettable.push(x);
|
||||
}
|
||||
match x as i32 {
|
||||
0..5+1 => errors_only.push(x),
|
||||
//~^ error: expected a pattern range bound, found an expression
|
||||
//~| error: exclusive range pattern syntax is experimental
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
//~| error: inline-const in pattern position is experimental
|
||||
//~^ error: inline-const in pattern position is experimental [E0658]
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: expected a pattern range bound, found an expression
|
||||
--> $DIR/range_pat_interactions1.rs:19:16
|
||||
--> $DIR/range_pat_interactions1.rs:17:16
|
||||
|
|
||||
LL | 0..5+1 => errors_only.push(x),
|
||||
| ^^^ arbitrary expressions are not allowed in patterns
|
||||
|
@ -13,7 +13,7 @@ LL | if let n @ 2..3|4 = x {
|
|||
| variable not in all patterns
|
||||
|
||||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:26:20
|
||||
--> $DIR/range_pat_interactions1.rs:21:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
|
@ -22,84 +22,7 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
|||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:10:20
|
||||
|
|
||||
LL | if let n @ 2..3|4 = x {
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:14:23
|
||||
|
|
||||
LL | } else if let 2..3 | 4 = x {
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:19:13
|
||||
|
|
||||
LL | 0..5+1 => errors_only.push(x),
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:22:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:24:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:26:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:30:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0408, E0658.
|
||||
For more information about an error, try `rustc --explain E0408`.
|
||||
|
|
|
@ -11,15 +11,11 @@ fn main() {
|
|||
//~^ error: expected a pattern range bound, found an expression
|
||||
//~| error: range pattern bounds cannot have parentheses
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ error: inline-const in pattern position is experimental
|
||||
//~| error: exclusive range pattern syntax is experimental
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ LL + 0..=5+1 => errors_only.push(x),
|
|||
|
|
||||
|
||||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:17:20
|
||||
--> $DIR/range_pat_interactions2.rs:15:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
|
@ -26,50 +26,6 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
|||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:13:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:15:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:17:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:21:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
@ -8,15 +8,11 @@ fn main() {
|
|||
match x as i32 {
|
||||
8.. => bottom.push(x),
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ inline-const in pattern position is experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:14:20
|
||||
--> $DIR/range_pat_interactions3.rs:12:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
|
@ -8,50 +8,6 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
|||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:10:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:12:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:14:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:18:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0527]: pattern requires 2 elements but array has 8
|
||||
--> $DIR/slice_pattern_syntax_problem0.rs:11:9
|
||||
--> $DIR/slice_pattern_syntax_problem0.rs:10:9
|
||||
|
|
||||
LL | let [first_three @ ..3, rest @ 2..] = xs;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 8 elements
|
||||
|
|
|
@ -3,7 +3,5 @@ fn main() {
|
|||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
//~^ `X..` patterns in slices are experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
//~| ERROR: refutable pattern
|
||||
}
|
||||
|
|
|
@ -8,28 +8,6 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
|||
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:23
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:32
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:9
|
||||
|
|
||||
|
@ -44,7 +22,7 @@ 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 4 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0005, E0658.
|
||||
For more information about an error, try `rustc --explain E0005`.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//@ build-pass
|
||||
|
||||
#![feature(inline_const_pat, exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
|
||||
fn main() {
|
||||
const N: u32 = 10;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match 5 {
|
||||
6 ..= 1 => { }
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/match-range-fail-2.rs:5:9
|
||||
--> $DIR/match-range-fail-2.rs:3:9
|
||||
|
|
||||
LL | 6 ..= 1 => { }
|
||||
| ^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/match-range-fail-2.rs:11:9
|
||||
--> $DIR/match-range-fail-2.rs:9:9
|
||||
|
|
||||
LL | 0 .. 0 => { }
|
||||
| ^^^^^^
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/match-range-fail-2.rs:17:9
|
||||
--> $DIR/match-range-fail-2.rs:15:9
|
||||
|
|
||||
LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
error: literal out of range for `u8`
|
||||
--> $DIR/validate-range-endpoints.rs:8:12
|
||||
--> $DIR/validate-range-endpoints.rs:7:12
|
||||
|
|
||||
LL | 1..257 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/validate-range-endpoints.rs:10:13
|
||||
--> $DIR/validate-range-endpoints.rs:9:13
|
||||
|
|
||||
LL | 1..=256 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/validate-range-endpoints.rs:19:9
|
||||
--> $DIR/validate-range-endpoints.rs:18:9
|
||||
|
|
||||
LL | 1..=TOO_BIG => {}
|
||||
| ^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/validate-range-endpoints.rs:21:9
|
||||
--> $DIR/validate-range-endpoints.rs:20:9
|
||||
|
|
||||
LL | 1..=const { 256 } => {}
|
||||
| ^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: literal out of range for `u64`
|
||||
--> $DIR/validate-range-endpoints.rs:27:32
|
||||
--> $DIR/validate-range-endpoints.rs:26:32
|
||||
|
|
||||
LL | 10000000000000000000..=99999999999999999999 => {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^ this value does not fit into the type `u64` whose range is `0..=18446744073709551615`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:33:12
|
||||
--> $DIR/validate-range-endpoints.rs:32:12
|
||||
|
|
||||
LL | 0..129 => {}
|
||||
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:35:13
|
||||
--> $DIR/validate-range-endpoints.rs:34:13
|
||||
|
|
||||
LL | 0..=128 => {}
|
||||
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:37:9
|
||||
--> $DIR/validate-range-endpoints.rs:36:9
|
||||
|
|
||||
LL | -129..0 => {}
|
||||
| ^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:39:9
|
||||
--> $DIR/validate-range-endpoints.rs:38:9
|
||||
|
|
||||
LL | -10000..=-20 => {}
|
||||
| ^^^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
||||
--> $DIR/validate-range-endpoints.rs:50:11
|
||||
--> $DIR/validate-range-endpoints.rs:49:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ patterns `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
||||
|
@ -66,7 +66,7 @@ LL + i8::MIN..=-17_i8 | 1_i8..=i8::MAX => todo!()
|
|||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` not covered
|
||||
--> $DIR/validate-range-endpoints.rs:54:11
|
||||
--> $DIR/validate-range-endpoints.rs:53:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ pattern `i8::MIN..=-17_i8` not covered
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
#![allow(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// 1. Things parse as they should.
|
||||
// 2. Or at least we have parser recovery if they don't.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:21:12
|
||||
--> $DIR/recover-range-pats.rs:20:12
|
||||
|
|
||||
LL | if let .0..Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:23:16
|
||||
--> $DIR/recover-range-pats.rs:22:16
|
||||
|
|
||||
LL | if let X.. .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:34:12
|
||||
--> $DIR/recover-range-pats.rs:33:12
|
||||
|
|
||||
LL | if let .0..=Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:36:16
|
||||
--> $DIR/recover-range-pats.rs:35:16
|
||||
|
|
||||
LL | if let X..=.0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:59:12
|
||||
--> $DIR/recover-range-pats.rs:58:12
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:63:17
|
||||
--> $DIR/recover-range-pats.rs:62:17
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:74:12
|
||||
--> $DIR/recover-range-pats.rs:73:12
|
||||
|
|
||||
LL | if let .0.. = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:80:13
|
||||
--> $DIR/recover-range-pats.rs:79:13
|
||||
|
|
||||
LL | if let 0..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -49,7 +49,7 @@ LL | if let 0..= = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:81:13
|
||||
--> $DIR/recover-range-pats.rs:80:13
|
||||
|
|
||||
LL | if let X..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -57,7 +57,7 @@ LL | if let X..= = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:82:16
|
||||
--> $DIR/recover-range-pats.rs:81:16
|
||||
|
|
||||
LL | if let true..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -65,13 +65,13 @@ LL | if let true..= = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:84:12
|
||||
--> $DIR/recover-range-pats.rs:83:12
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:84:14
|
||||
--> $DIR/recover-range-pats.rs:83:14
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -79,7 +79,7 @@ LL | if let .0..= = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:90:13
|
||||
--> $DIR/recover-range-pats.rs:89:13
|
||||
|
|
||||
LL | if let 0... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -87,7 +87,7 @@ LL | if let 0... = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:91:13
|
||||
--> $DIR/recover-range-pats.rs:90:13
|
||||
|
|
||||
LL | if let X... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -95,7 +95,7 @@ LL | if let X... = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:92:16
|
||||
--> $DIR/recover-range-pats.rs:91:16
|
||||
|
|
||||
LL | if let true... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -103,13 +103,13 @@ LL | if let true... = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:94:12
|
||||
--> $DIR/recover-range-pats.rs:93:12
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:94:14
|
||||
--> $DIR/recover-range-pats.rs:93:14
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -117,49 +117,49 @@ LL | if let .0... = 0 {}
|
|||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:104:15
|
||||
--> $DIR/recover-range-pats.rs:103:15
|
||||
|
|
||||
LL | if let .. .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:114:15
|
||||
--> $DIR/recover-range-pats.rs:113:15
|
||||
|
|
||||
LL | if let ..=.0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:120:12
|
||||
--> $DIR/recover-range-pats.rs:119:12
|
||||
|
|
||||
LL | if let ...3 = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:122:12
|
||||
--> $DIR/recover-range-pats.rs:121:12
|
||||
|
|
||||
LL | if let ...Y = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:124:12
|
||||
--> $DIR/recover-range-pats.rs:123:12
|
||||
|
|
||||
LL | if let ...true = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:127:15
|
||||
--> $DIR/recover-range-pats.rs:126:15
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.3`
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:127:12
|
||||
--> $DIR/recover-range-pats.rs:126:12
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:153:17
|
||||
--> $DIR/recover-range-pats.rs:152:17
|
||||
|
|
||||
LL | let ...$e;
|
||||
| ^^^ help: use `..=` instead
|
||||
|
@ -170,7 +170,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:160:19
|
||||
--> $DIR/recover-range-pats.rs:159:19
|
||||
|
|
||||
LL | let $e...;
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -182,7 +182,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:162:19
|
||||
--> $DIR/recover-range-pats.rs:161:19
|
||||
|
|
||||
LL | let $e..=;
|
||||
| ^^^ help: use `..` instead
|
||||
|
@ -194,7 +194,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:41:13
|
||||
--> $DIR/recover-range-pats.rs:40:13
|
||||
|
|
||||
LL | if let 0...3 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -202,13 +202,13 @@ LL | if let 0...3 = 0 {}
|
|||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/recover-range-pats.rs:7:9
|
||||
--> $DIR/recover-range-pats.rs:6:9
|
||||
|
|
||||
LL | #![deny(ellipsis_inclusive_range_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:44:13
|
||||
--> $DIR/recover-range-pats.rs:43:13
|
||||
|
|
||||
LL | if let 0...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -217,7 +217,7 @@ LL | if let 0...Y = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:47:13
|
||||
--> $DIR/recover-range-pats.rs:46:13
|
||||
|
|
||||
LL | if let X...3 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -226,7 +226,7 @@ LL | if let X...3 = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:50:13
|
||||
--> $DIR/recover-range-pats.rs:49:13
|
||||
|
|
||||
LL | if let X...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -235,7 +235,7 @@ LL | if let X...Y = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:53:16
|
||||
--> $DIR/recover-range-pats.rs:52:16
|
||||
|
|
||||
LL | if let true...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -244,7 +244,7 @@ LL | if let true...Y = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:56:13
|
||||
--> $DIR/recover-range-pats.rs:55:13
|
||||
|
|
||||
LL | if let X...true = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -253,7 +253,7 @@ LL | if let X...true = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:59:14
|
||||
--> $DIR/recover-range-pats.rs:58:14
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -262,7 +262,7 @@ LL | if let .0...Y = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:63:13
|
||||
--> $DIR/recover-range-pats.rs:62:13
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -271,7 +271,7 @@ LL | if let X... .0 = 0 {}
|
|||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:138:20
|
||||
--> $DIR/recover-range-pats.rs:137:20
|
||||
|
|
||||
LL | let $e1...$e2;
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
|
@ -284,7 +284,7 @@ LL | mac2!(0, 1);
|
|||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:19:12
|
||||
--> $DIR/recover-range-pats.rs:18:12
|
||||
|
|
||||
LL | if let true..Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
|
@ -292,7 +292,7 @@ LL | if let true..Y = 0 {}
|
|||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:20:15
|
||||
--> $DIR/recover-range-pats.rs:19:15
|
||||
|
|
||||
LL | if let X..true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
@ -300,7 +300,7 @@ LL | if let X..true = 0 {}
|
|||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:21:12
|
||||
--> $DIR/recover-range-pats.rs:20:12
|
||||
|
|
||||
LL | if let .0..Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
|
@ -309,7 +309,7 @@ LL | if let .0..Y = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:23:16
|
||||
--> $DIR/recover-range-pats.rs:22:16
|
||||
|
|
||||
LL | if let X.. .0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
|
@ -321,7 +321,7 @@ LL | if let X.. .0 = 0 {}
|
|||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:32:12
|
||||
--> $DIR/recover-range-pats.rs:31:12
|
||||
|
|
||||
LL | if let true..=Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
|
@ -329,7 +329,7 @@ LL | if let true..=Y = 0 {}
|
|||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:33:16
|
||||
--> $DIR/recover-range-pats.rs:32:16
|
||||
|
|
||||
LL | if let X..=true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
@ -337,7 +337,7 @@ LL | if let X..=true = 0 {}
|
|||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:34:12
|
||||
--> $DIR/recover-range-pats.rs:33:12
|
||||
|
|
||||
LL | if let .0..=Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
|
@ -346,7 +346,7 @@ LL | if let .0..=Y = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:36:16
|
||||
--> $DIR/recover-range-pats.rs:35:16
|
||||
|
|
||||
LL | if let X..=.0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
|
@ -358,7 +358,7 @@ LL | if let X..=.0 = 0 {}
|
|||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:53:12
|
||||
--> $DIR/recover-range-pats.rs:52:12
|
||||
|
|
||||
LL | if let true...Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
|
@ -366,7 +366,7 @@ LL | if let true...Y = 0 {}
|
|||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:56:16
|
||||
--> $DIR/recover-range-pats.rs:55:16
|
||||
|
|
||||
LL | if let X...true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
@ -374,7 +374,7 @@ LL | if let X...true = 0 {}
|
|||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:59:12
|
||||
--> $DIR/recover-range-pats.rs:58:12
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
|
@ -383,7 +383,7 @@ LL | if let .0...Y = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:63:17
|
||||
--> $DIR/recover-range-pats.rs:62:17
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
|
@ -395,13 +395,13 @@ LL | if let X... .0 = 0 {}
|
|||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:72:12
|
||||
--> $DIR/recover-range-pats.rs:71:12
|
||||
|
|
||||
LL | if let true.. = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:74:12
|
||||
--> $DIR/recover-range-pats.rs:73:12
|
||||
|
|
||||
LL | if let .0.. = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -409,13 +409,13 @@ LL | if let .0.. = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:82:12
|
||||
--> $DIR/recover-range-pats.rs:81:12
|
||||
|
|
||||
LL | if let true..= = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:84:12
|
||||
--> $DIR/recover-range-pats.rs:83:12
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -423,13 +423,13 @@ LL | if let .0..= = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:92:12
|
||||
--> $DIR/recover-range-pats.rs:91:12
|
||||
|
|
||||
LL | if let true... = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:94:12
|
||||
--> $DIR/recover-range-pats.rs:93:12
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -437,13 +437,13 @@ LL | if let .0... = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:102:14
|
||||
--> $DIR/recover-range-pats.rs:101:14
|
||||
|
|
||||
LL | if let ..true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:104:15
|
||||
--> $DIR/recover-range-pats.rs:103:15
|
||||
|
|
||||
LL | if let .. .0 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -451,13 +451,13 @@ LL | if let .. .0 = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:112:15
|
||||
--> $DIR/recover-range-pats.rs:111:15
|
||||
|
|
||||
LL | if let ..=true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:114:15
|
||||
--> $DIR/recover-range-pats.rs:113:15
|
||||
|
|
||||
LL | if let ..=.0 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -465,13 +465,13 @@ LL | if let ..=.0 = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:124:15
|
||||
--> $DIR/recover-range-pats.rs:123:15
|
||||
|
|
||||
LL | if let ...true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:127:15
|
||||
--> $DIR/recover-range-pats.rs:126:15
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
|
@ -479,7 +479,7 @@ LL | if let ....3 = 0 {}
|
|||
| expected integer, found floating-point number
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:136:17
|
||||
--> $DIR/recover-range-pats.rs:135:17
|
||||
|
|
||||
LL | let $e1..$e2;
|
||||
| ^^^^^^^^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
|
||||
|
@ -493,7 +493,7 @@ LL | mac2!(0, 1);
|
|||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:138:17
|
||||
--> $DIR/recover-range-pats.rs:137:17
|
||||
|
|
||||
LL | let $e1...$e2;
|
||||
| ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered
|
||||
|
@ -507,7 +507,7 @@ LL | mac2!(0, 1);
|
|||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:142:17
|
||||
--> $DIR/recover-range-pats.rs:141:17
|
||||
|
|
||||
LL | let $e1..=$e2;
|
||||
| ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered
|
||||
|
@ -521,7 +521,7 @@ LL | mac2!(0, 1);
|
|||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:151:17
|
||||
--> $DIR/recover-range-pats.rs:150:17
|
||||
|
|
||||
LL | let ..$e;
|
||||
| ^^^^ pattern `0_i32..=i32::MAX` not covered
|
||||
|
@ -535,7 +535,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:153:17
|
||||
--> $DIR/recover-range-pats.rs:152:17
|
||||
|
|
||||
LL | let ...$e;
|
||||
| ^^^^^ pattern `1_i32..=i32::MAX` not covered
|
||||
|
@ -549,7 +549,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:156:17
|
||||
--> $DIR/recover-range-pats.rs:155:17
|
||||
|
|
||||
LL | let ..=$e;
|
||||
| ^^^^^ pattern `1_i32..=i32::MAX` not covered
|
||||
|
@ -563,7 +563,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:158:17
|
||||
--> $DIR/recover-range-pats.rs:157:17
|
||||
|
|
||||
LL | let $e..;
|
||||
| ^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
|
@ -577,7 +577,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:160:17
|
||||
--> $DIR/recover-range-pats.rs:159:17
|
||||
|
|
||||
LL | let $e...;
|
||||
| ^^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
|
@ -591,7 +591,7 @@ LL | mac!(0);
|
|||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:162:17
|
||||
--> $DIR/recover-range-pats.rs:161:17
|
||||
|
|
||||
LL | let $e..=;
|
||||
| ^^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
|
|
|
@ -11,7 +11,6 @@ fn main() {
|
|||
[_, ..tail] => println!("{tail}"),
|
||||
//~^ ERROR cannot find value `tail` in this scope
|
||||
//~| ERROR cannot find value `tail` in this scope
|
||||
//~| ERROR exclusive range pattern syntax is experimental
|
||||
}
|
||||
match &[7, 8, 9][..] {
|
||||
[] => {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:13
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:13
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^ help: use `..=` instead
|
||||
|
@ -39,7 +39,7 @@ LL | [_, ..tail] => println!("{tail}"),
|
|||
| ^^^^ not found in this scope
|
||||
|
||||
error[E0425]: cannot find value `tail` in this scope
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:16
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:16
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^^ not found in this scope
|
||||
|
@ -50,7 +50,7 @@ LL | [_, tail @ ..] => println!("{tail}"),
|
|||
| ~~~~~~~~~
|
||||
|
||||
error[E0425]: cannot find value `tail` in this scope
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:36
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:36
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^^ not found in this scope
|
||||
|
@ -65,18 +65,7 @@ LL | [1, rest..] => println!("{rest}"),
|
|||
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:13
|
||||
|
|
||||
LL | [_, ..tail] => println!("{tail}"),
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0425, E0658.
|
||||
For more information about an error, try `rustc --explain E0425`.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/floats.rs:10:11
|
||||
--> $DIR/floats.rs:9:11
|
||||
|
|
||||
LL | match 0.0 {
|
||||
| ^^^ pattern `_` not covered
|
||||
|
@ -12,49 +12,49 @@ LL + _ => todo!()
|
|||
|
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:18:9
|
||||
--> $DIR/floats.rs:17:9
|
||||
|
|
||||
LL | 0.01f64 => {}
|
||||
| ^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/floats.rs:2:9
|
||||
--> $DIR/floats.rs:1:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:19:9
|
||||
--> $DIR/floats.rs:18:9
|
||||
|
|
||||
LL | 0.02f64 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:20:9
|
||||
--> $DIR/floats.rs:19:9
|
||||
|
|
||||
LL | 6.5f64 => {}
|
||||
| ^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:22:9
|
||||
--> $DIR/floats.rs:21:9
|
||||
|
|
||||
LL | 1.0f64..=4.0f64 => {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:34:9
|
||||
--> $DIR/floats.rs:33:9
|
||||
|
|
||||
LL | 0.01f32 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:35:9
|
||||
--> $DIR/floats.rs:34:9
|
||||
|
|
||||
LL | 0.02f32 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:36:9
|
||||
--> $DIR/floats.rs:35:9
|
||||
|
|
||||
LL | 6.5f32 => {}
|
||||
| ^^^^^^
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
enum Q { R(Option<usize>) }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0004]: non-exhaustive patterns: `128_u8..=u8::MAX` not covered
|
||||
--> $DIR/guards.rs:12:11
|
||||
--> $DIR/guards.rs:11:11
|
||||
|
|
||||
LL | match 0u8 {
|
||||
| ^^^ pattern `128_u8..=u8::MAX` not covered
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:48:8
|
||||
--> $DIR/exhaustiveness.rs:47:8
|
||||
|
|
||||
LL | m!(0u8, 0..255);
|
||||
| ^^^ pattern `u8::MAX` not covered
|
||||
|
@ -11,7 +11,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:49:8
|
||||
--> $DIR/exhaustiveness.rs:48:8
|
||||
|
|
||||
LL | m!(0u8, 0..=254);
|
||||
| ^^^ pattern `u8::MAX` not covered
|
||||
|
@ -23,7 +23,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u8` not covered
|
||||
--> $DIR/exhaustiveness.rs:50:8
|
||||
--> $DIR/exhaustiveness.rs:49:8
|
||||
|
|
||||
LL | m!(0u8, 1..=255);
|
||||
| ^^^ pattern `0_u8` not covered
|
||||
|
@ -35,7 +35,7 @@ LL | match $s { $($t)+ => {}, 0_u8 => todo!() }
|
|||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `42_u8` not covered
|
||||
--> $DIR/exhaustiveness.rs:51:8
|
||||
--> $DIR/exhaustiveness.rs:50:8
|
||||
|
|
||||
LL | m!(0u8, 0..42 | 43..=255);
|
||||
| ^^^ pattern `42_u8` not covered
|
||||
|
@ -47,7 +47,7 @@ LL | match $s { $($t)+ => {}, 42_u8 => todo!() }
|
|||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:52:8
|
||||
--> $DIR/exhaustiveness.rs:51:8
|
||||
|
|
||||
LL | m!(0i8, -128..127);
|
||||
| ^^^ pattern `i8::MAX` not covered
|
||||
|
@ -59,7 +59,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:53:8
|
||||
--> $DIR/exhaustiveness.rs:52:8
|
||||
|
|
||||
LL | m!(0i8, -128..=126);
|
||||
| ^^^ pattern `i8::MAX` not covered
|
||||
|
@ -71,7 +71,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
|
||||
--> $DIR/exhaustiveness.rs:54:8
|
||||
--> $DIR/exhaustiveness.rs:53:8
|
||||
|
|
||||
LL | m!(0i8, -127..=127);
|
||||
| ^^^ pattern `i8::MIN` not covered
|
||||
|
@ -83,7 +83,7 @@ LL | match $s { $($t)+ => {}, i8::MIN => todo!() }
|
|||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_i8` not covered
|
||||
--> $DIR/exhaustiveness.rs:55:11
|
||||
--> $DIR/exhaustiveness.rs:54:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ pattern `0_i8` not covered
|
||||
|
@ -96,7 +96,7 @@ LL + 0_i8 => todo!()
|
|||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:60:8
|
||||
--> $DIR/exhaustiveness.rs:59:8
|
||||
|
|
||||
LL | m!(0u128, 0..=ALMOST_MAX);
|
||||
| ^^^^^ pattern `u128::MAX` not covered
|
||||
|
@ -108,7 +108,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
|||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `5_u128..` not covered
|
||||
--> $DIR/exhaustiveness.rs:61:8
|
||||
--> $DIR/exhaustiveness.rs:60:8
|
||||
|
|
||||
LL | m!(0u128, 0..=4);
|
||||
| ^^^^^ pattern `5_u128..` not covered
|
||||
|
@ -120,7 +120,7 @@ LL | match $s { $($t)+ => {}, 5_u128.. => todo!() }
|
|||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u128` not covered
|
||||
--> $DIR/exhaustiveness.rs:62:8
|
||||
--> $DIR/exhaustiveness.rs:61:8
|
||||
|
|
||||
LL | m!(0u128, 1..=u128::MAX);
|
||||
| ^^^^^ pattern `0_u128` not covered
|
||||
|
@ -132,7 +132,7 @@ LL | match $s { $($t)+ => {}, 0_u128 => todo!() }
|
|||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
|
||||
--> $DIR/exhaustiveness.rs:70:11
|
||||
--> $DIR/exhaustiveness.rs:69:11
|
||||
|
|
||||
LL | match (0u8, true) {
|
||||
| ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(non_contiguous_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:16:9
|
||||
--> $DIR/gap_between_ranges.rs:15:9
|
||||
|
|
||||
LL | 20..30 => {}
|
||||
| ^^^^^^
|
||||
|
@ -10,13 +10,13 @@ LL | 31..=40 => {}
|
|||
| ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/gap_between_ranges.rs:2:9
|
||||
--> $DIR/gap_between_ranges.rs:1:9
|
||||
|
|
||||
LL | #![deny(non_contiguous_range_endpoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:21:9
|
||||
--> $DIR/gap_between_ranges.rs:20:9
|
||||
|
|
||||
LL | 20..30 => {}
|
||||
| ^^^^^^
|
||||
|
@ -27,7 +27,7 @@ LL | 31 => {}
|
|||
| -- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:26:13
|
||||
--> $DIR/gap_between_ranges.rs:25:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=40);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
@ -36,7 +36,7 @@ LL | m!(0u8, 20..30, 31..=40);
|
|||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:27:22
|
||||
--> $DIR/gap_between_ranges.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 31..=40, 20..30);
|
||||
| ------- ^^^^^^
|
||||
|
@ -46,7 +46,7 @@ LL | m!(0u8, 31..=40, 20..30);
|
|||
| this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
||||
warning: multiple patterns overlap on their endpoints
|
||||
--> $DIR/gap_between_ranges.rs:28:21
|
||||
--> $DIR/gap_between_ranges.rs:27:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29..=40);
|
||||
| ------ ^^^^^^^ ... with this range
|
||||
|
@ -57,7 +57,7 @@ LL | m!(0u8, 20..30, 29..=40);
|
|||
= note: `#[warn(overlapping_range_endpoints)]` on by default
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:30:13
|
||||
--> $DIR/gap_between_ranges.rs:29:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=40);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
@ -66,7 +66,7 @@ LL | m!(0u8, 20..30, 31..=40);
|
|||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:32:13
|
||||
--> $DIR/gap_between_ranges.rs:31:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=32);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
@ -75,7 +75,7 @@ LL | m!(0u8, 20..30, 31..=32);
|
|||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: exclusive range missing `u8::MAX`
|
||||
--> $DIR/gap_between_ranges.rs:42:9
|
||||
--> $DIR/gap_between_ranges.rs:41:9
|
||||
|
|
||||
LL | 0..255 => {}
|
||||
| ^^^^^^
|
||||
|
@ -84,7 +84,7 @@ LL | 0..255 => {}
|
|||
| help: use an inclusive range instead: `0_u8..=u8::MAX`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:71:9
|
||||
--> $DIR/gap_between_ranges.rs:70:9
|
||||
|
|
||||
LL | 0..10 => {}
|
||||
| ^^^^^
|
||||
|
@ -97,7 +97,7 @@ LL | 11..30 => {}
|
|||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:77:9
|
||||
--> $DIR/gap_between_ranges.rs:76:9
|
||||
|
|
||||
LL | 0..10 => {}
|
||||
| ^^^^^
|
||||
|
@ -108,7 +108,7 @@ LL | 11..20 => {}
|
|||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:78:9
|
||||
--> $DIR/gap_between_ranges.rs:77:9
|
||||
|
|
||||
LL | 11..20 => {}
|
||||
| ^^^^^^
|
||||
|
@ -119,7 +119,7 @@ LL | 21..30 => {}
|
|||
| ------ this could appear to continue range `11_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:83:9
|
||||
--> $DIR/gap_between_ranges.rs:82:9
|
||||
|
|
||||
LL | 00..20 => {}
|
||||
| ^^^^^^
|
||||
|
@ -133,7 +133,7 @@ LL | 21..40 => {}
|
|||
| ------ this could appear to continue range `0_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:84:9
|
||||
--> $DIR/gap_between_ranges.rs:83:9
|
||||
|
|
||||
LL | 10..20 => {}
|
||||
| ^^^^^^
|
||||
|
@ -146,7 +146,7 @@ LL | 21..40 => {}
|
|||
| ------ this could appear to continue range `10_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:92:10
|
||||
--> $DIR/gap_between_ranges.rs:91:10
|
||||
|
|
||||
LL | (0..10, true) => {}
|
||||
| ^^^^^
|
||||
|
@ -157,7 +157,7 @@ LL | (11..20, true) => {}
|
|||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:97:16
|
||||
--> $DIR/gap_between_ranges.rs:96:16
|
||||
|
|
||||
LL | (true, 0..10) => {}
|
||||
| ^^^^^
|
||||
|
@ -168,7 +168,7 @@ LL | (true, 11..20) => {}
|
|||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:103:10
|
||||
--> $DIR/gap_between_ranges.rs:102:10
|
||||
|
|
||||
LL | (0..10, true) => {}
|
||||
| ^^^^^
|
||||
|
@ -179,7 +179,7 @@ LL | (11..20, false) => {}
|
|||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:113:14
|
||||
--> $DIR/gap_between_ranges.rs:112:14
|
||||
|
|
||||
LL | Some(0..10) => {}
|
||||
| ^^^^^
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(overlapping_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:15:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:14:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30..=40);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
|
@ -8,13 +8,13 @@ LL | m!(0u8, 20..=30, 30..=40);
|
|||
|
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
note: the lint level is defined here
|
||||
--> $DIR/overlapping_range_endpoints.rs:2:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:1:9
|
||||
|
|
||||
LL | #![deny(overlapping_range_endpoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:16:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:15:22
|
||||
|
|
||||
LL | m!(0u8, 30..=40, 20..=30);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
|
@ -24,7 +24,7 @@ LL | m!(0u8, 30..=40, 20..=30);
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:19:21
|
||||
--> $DIR/overlapping_range_endpoints.rs:18:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29..=40);
|
||||
| ------ ^^^^^^^ ... with this range
|
||||
|
@ -34,7 +34,7 @@ LL | m!(0u8, 20..30, 29..=40);
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:23:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:22:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30..=31);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
|
@ -44,7 +44,7 @@ LL | m!(0u8, 20..=30, 30..=31);
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:27:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 19..=20);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
|
@ -54,7 +54,7 @@ LL | m!(0u8, 20..=30, 19..=20);
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:39:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:38:9
|
||||
|
|
||||
LL | 0..=10 => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
|
@ -65,7 +65,7 @@ LL | 10..=20 => {}
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:39:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:38:9
|
||||
|
|
||||
LL | 20..=30 => {}
|
||||
| ------- this range overlaps on `20_u8`...
|
||||
|
@ -75,7 +75,7 @@ LL | 10..=20 => {}
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:46:10
|
||||
--> $DIR/overlapping_range_endpoints.rs:45:10
|
||||
|
|
||||
LL | (0..=10, true) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
|
@ -85,7 +85,7 @@ LL | (10..20, true) => {}
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:52:16
|
||||
--> $DIR/overlapping_range_endpoints.rs:51:16
|
||||
|
|
||||
LL | (true, 0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
|
@ -95,7 +95,7 @@ LL | (true, 10..20) => {}
|
|||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:58:14
|
||||
--> $DIR/overlapping_range_endpoints.rs:57:14
|
||||
|
|
||||
LL | Some(0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:13:11
|
||||
--> $DIR/pointer-sized-int.rs:12:11
|
||||
|
|
||||
LL | match 0usize {
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
|
@ -13,7 +13,7 @@ LL + usize::MAX.. => todo!()
|
|||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:18:11
|
||||
--> $DIR/pointer-sized-int.rs:17:11
|
||||
|
|
||||
LL | match 0isize {
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
|
@ -27,7 +27,7 @@ LL + ..isize::MIN | isize::MAX.. => todo!()
|
|||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:23:8
|
||||
--> $DIR/pointer-sized-int.rs:22:8
|
||||
|
|
||||
LL | m!(0usize, 0..=usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
|
@ -40,7 +40,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
|||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:25:8
|
||||
--> $DIR/pointer-sized-int.rs:24:8
|
||||
|
|
||||
LL | m!(0usize, 0..5 | 5..=usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
|
@ -53,7 +53,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
|||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:27:8
|
||||
--> $DIR/pointer-sized-int.rs:26:8
|
||||
|
|
||||
LL | m!(0usize, 0..usize::MAX | usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
|
@ -66,7 +66,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
|||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(usize::MAX.., _)` not covered
|
||||
--> $DIR/pointer-sized-int.rs:29:8
|
||||
--> $DIR/pointer-sized-int.rs:28:8
|
||||
|
|
||||
LL | m!((0usize, true), (0..5, true) | (5..=usize::MAX, true) | (0..=usize::MAX, false));
|
||||
| ^^^^^^^^^^^^^^ pattern `(usize::MAX.., _)` not covered
|
||||
|
@ -79,7 +79,7 @@ LL | match $s { $($t)+ => {}, (usize::MAX.., _) => todo!() }
|
|||
| ++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:38:8
|
||||
--> $DIR/pointer-sized-int.rs:37:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
|
@ -92,7 +92,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:40:8
|
||||
--> $DIR/pointer-sized-int.rs:39:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..5 | 5..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
|
@ -105,7 +105,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:42:8
|
||||
--> $DIR/pointer-sized-int.rs:41:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..=-1 | 0 | 1..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
|
@ -118,7 +118,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:44:8
|
||||
--> $DIR/pointer-sized-int.rs:43:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..isize::MAX | isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
|
@ -131,7 +131,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
|||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
|
||||
--> $DIR/pointer-sized-int.rs:47:9
|
||||
--> $DIR/pointer-sized-int.rs:46:9
|
||||
|
|
||||
LL | (0isize, true),
|
||||
| ^^^^^^^^^^^^^^ patterns `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
|
||||
|
@ -144,7 +144,7 @@ LL | match $s { $($t)+ => {}, (..isize::MIN, _) | (isize::MAX.., _) => t
|
|||
| ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: type `usize` is non-empty
|
||||
--> $DIR/pointer-sized-int.rs:58:11
|
||||
--> $DIR/pointer-sized-int.rs:57:11
|
||||
|
|
||||
LL | match 7usize {}
|
||||
| ^^^^^^
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//@ revisions: deny
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
|
|
@ -1,137 +1,137 @@
|
|||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:19:17
|
||||
--> $DIR/reachability.rs:18:17
|
||||
|
|
||||
LL | m!(0u8, 42, 42);
|
||||
| ^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/reachability.rs:4:9
|
||||
--> $DIR/reachability.rs:3:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:23:22
|
||||
--> $DIR/reachability.rs:22:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:24:22
|
||||
--> $DIR/reachability.rs:23:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 21);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:25:22
|
||||
--> $DIR/reachability.rs:24:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 25);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:26:22
|
||||
--> $DIR/reachability.rs:25:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 29);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:27:22
|
||||
--> $DIR/reachability.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:30:21
|
||||
--> $DIR/reachability.rs:29:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 20);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:31:21
|
||||
--> $DIR/reachability.rs:30:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 21);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:32:21
|
||||
--> $DIR/reachability.rs:31:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 25);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:33:21
|
||||
--> $DIR/reachability.rs:32:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:37:22
|
||||
--> $DIR/reachability.rs:36:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20..=30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:38:22
|
||||
--> $DIR/reachability.rs:37:22
|
||||
|
|
||||
LL | m!(0u8, 20.. 30, 20.. 30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:39:22
|
||||
--> $DIR/reachability.rs:38:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20.. 30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:41:22
|
||||
--> $DIR/reachability.rs:40:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 21..=30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:42:22
|
||||
--> $DIR/reachability.rs:41:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20..=29);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:44:24
|
||||
--> $DIR/reachability.rs:43:24
|
||||
|
|
||||
LL | m!('a', 'A'..='z', 'a'..='z');
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:51:9
|
||||
--> $DIR/reachability.rs:50:9
|
||||
|
|
||||
LL | 5..=8 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:57:9
|
||||
--> $DIR/reachability.rs:56:9
|
||||
|
|
||||
LL | 5..15 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:64:9
|
||||
--> $DIR/reachability.rs:63:9
|
||||
|
|
||||
LL | 5..25 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:72:9
|
||||
--> $DIR/reachability.rs:71:9
|
||||
|
|
||||
LL | 5..25 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:78:9
|
||||
--> $DIR/reachability.rs:77:9
|
||||
|
|
||||
LL | 5..15 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:85:9
|
||||
--> $DIR/reachability.rs:84:9
|
||||
|
|
||||
LL | _ => {},
|
||||
| - matches any value
|
||||
|
@ -139,19 +139,19 @@ LL | '\u{D7FF}'..='\u{E000}' => {},
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^ unreachable pattern
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:90:9
|
||||
--> $DIR/reachability.rs:89:9
|
||||
|
|
||||
LL | '\u{D7FF}'..='\u{E000}' => {},
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:106:9
|
||||
--> $DIR/reachability.rs:105:9
|
||||
|
|
||||
LL | &FOO => {}
|
||||
| ^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:107:9
|
||||
--> $DIR/reachability.rs:106:9
|
||||
|
|
||||
LL | BAR => {}
|
||||
| ^^^
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unreachable_patterns)]
|
||||
fn main() {
|
||||
match 0u8 {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error: literal out of range for `u8`
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:5:14
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:4:14
|
||||
|
|
||||
LL | 251..257 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:7:15
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:6:15
|
||||
|
|
||||
LL | 251..=256 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Matching against NaN should result in an error
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unused)]
|
||||
|
||||
const NAN: f64 = f64::NAN;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:15:9
|
||||
--> $DIR/issue-6804-nan-match.rs:14:9
|
||||
|
|
||||
LL | NAN => {},
|
||||
| ^^^
|
||||
|
@ -8,7 +8,7 @@ LL | NAN => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:20:10
|
||||
--> $DIR/issue-6804-nan-match.rs:19:10
|
||||
|
|
||||
LL | [NAN, _] => {},
|
||||
| ^^^
|
||||
|
@ -17,7 +17,7 @@ LL | [NAN, _] => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:25:9
|
||||
--> $DIR/issue-6804-nan-match.rs:24:9
|
||||
|
|
||||
LL | C => {},
|
||||
| ^
|
||||
|
@ -26,7 +26,7 @@ LL | C => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:31:9
|
||||
--> $DIR/issue-6804-nan-match.rs:30:9
|
||||
|
|
||||
LL | NAN..=1.0 => {},
|
||||
| ^^^
|
||||
|
@ -35,13 +35,13 @@ LL | NAN..=1.0 => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:31:9
|
||||
--> $DIR/issue-6804-nan-match.rs:30:9
|
||||
|
|
||||
LL | NAN..=1.0 => {},
|
||||
| ^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:33:16
|
||||
--> $DIR/issue-6804-nan-match.rs:32:16
|
||||
|
|
||||
LL | -1.0..=NAN => {},
|
||||
| ^^^
|
||||
|
@ -50,13 +50,13 @@ LL | -1.0..=NAN => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:33:9
|
||||
--> $DIR/issue-6804-nan-match.rs:32:9
|
||||
|
|
||||
LL | -1.0..=NAN => {},
|
||||
| ^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:35:9
|
||||
--> $DIR/issue-6804-nan-match.rs:34:9
|
||||
|
|
||||
LL | NAN.. => {},
|
||||
| ^^^
|
||||
|
@ -65,13 +65,13 @@ LL | NAN.. => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:35:9
|
||||
--> $DIR/issue-6804-nan-match.rs:34:9
|
||||
|
|
||||
LL | NAN.. => {},
|
||||
| ^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:37:11
|
||||
--> $DIR/issue-6804-nan-match.rs:36:11
|
||||
|
|
||||
LL | ..NAN => {},
|
||||
| ^^^
|
||||
|
@ -80,7 +80,7 @@ LL | ..NAN => {},
|
|||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/issue-6804-nan-match.rs:37:9
|
||||
--> $DIR/issue-6804-nan-match.rs:36:9
|
||||
|
|
||||
LL | ..NAN => {},
|
||||
| ^^^^^
|
||||
|
|
Loading…
Add table
Reference in a new issue