diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr index 359725a41c1..237b26db7c0 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr @@ -1,8 +1,24 @@ -error: unexpected token: `,` - --> $DIR/exclusive_range_pattern_syntax_collision.rs:5:17 +error: `X..` range patterns are not supported + --> $DIR/exclusive_range_pattern_syntax_collision.rs:5:13 | LL | [_, 99.., _] => {}, - | ^ + | ^^^^ help: try using the maximum value for the type: `99..MAX` -error: aborting due to previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/exclusive_range_pattern_syntax_collision.rs:5:13 + | +LL | [_, 99.., _] => {}, + | ^^^^ +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/exclusive_range_pattern_syntax_collision.rs:5:13 + | +LL | [_, 99.., _] => {}, + | ^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: [type error] + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0029`. diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr index 8f849d7b3f8..b7a64a0ba67 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr @@ -1,8 +1,31 @@ -error: unexpected token: `]` - --> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:17 +error: `X..` range patterns are not supported + --> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:13 | LL | [_, 99..] => {}, - | ^ + | ^^^^ help: try using the maximum value for the type: `99..MAX` -error: aborting due to previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:13 + | +LL | [_, 99..] => {}, + | ^^^^ +error[E0527]: pattern requires 2 elements but array has 3 + --> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:9 + | +LL | [_, 99..] => {}, + | ^^^^^^^^^ expected 3 elements + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:13 + | +LL | [_, 99..] => {}, + | ^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: [type error] + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0029, E0527. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr index a09ba3562e0..7cc1976def4 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr @@ -1,8 +1,36 @@ -error: expected one of `,` or `]`, found `9` - --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:12 +error: `..X` range patterns are not supported + --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:10 | LL | [..9, 99..100, _] => {}, - | ^ expected one of `,` or `]` here + | ^^^ help: try using the minimum value for the type: `MIN..9` -error: aborting due to previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:10 + | +LL | [..9, 99..100, _] => {}, + | ^^^ +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:10 + | +LL | [..9, 99..100, _] => {}, + | ^^^ ranges require char or numeric types + | + = note: start type: [type error] + = note: end type: {integer} + +error[E0308]: mismatched types + --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:15 + | +LL | match [5..4, 99..105, 43..44] { + | ----------------------- this match expression has type `std::ops::Range<{integer}>` +LL | [..9, 99..100, _] => {}, + | ^^^^^^^ expected struct `std::ops::Range`, found integer + | + = note: expected type `std::ops::Range<{integer}>` + found type `{integer}` + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0029, E0308. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index 26b92fae313..2e1c167b871 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -1,8 +1,40 @@ -error: expected one of `)` or `,`, found `pat` +error: `..X` range patterns are not supported + --> $DIR/pat-tuple-4.rs:3:10 + | +LL | (.. pat) => {} + | ^^^^^^ help: try using the minimum value for the type: `MIN..pat` + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/pat-tuple-4.rs:3:10 + | +LL | (.. pat) => {} + | ^^^^^^ + +error[E0425]: cannot find value `pat` in this scope --> $DIR/pat-tuple-4.rs:3:13 | LL | (.. pat) => {} - | ^^^ expected one of `)` or `,` here + | ^^^ not found in this scope -error: aborting due to previous error +error[E0658]: exclusive range pattern syntax is experimental + --> $DIR/pat-tuple-4.rs:3:10 + | +LL | (.. pat) => {} + | ^^^^^^ + | + = note: for more information, see https://github.com/rust-lang/rust/issues/37854 + = help: add #![feature(exclusive_range_pattern)] to the crate attributes to enable +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/pat-tuple-4.rs:3:10 + | +LL | (.. pat) => {} + | ^^^^^^ ranges require char or numeric types + | + = note: start type: [type error] + = note: end type: [type error] + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0029, E0425, E0658. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/ui/parser/pat-tuple-5.stderr b/src/test/ui/parser/pat-tuple-5.stderr index f9832214c68..9f0118e9573 100644 --- a/src/test/ui/parser/pat-tuple-5.stderr +++ b/src/test/ui/parser/pat-tuple-5.stderr @@ -1,8 +1,40 @@ -error: unexpected token: `)` - --> $DIR/pat-tuple-5.rs:3:16 +error: `X..` range patterns are not supported + --> $DIR/pat-tuple-5.rs:3:10 | LL | (pat ..) => {} - | ^ + | ^^^^^^ help: try using the maximum value for the type: `pat..MAX` -error: aborting due to previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/pat-tuple-5.rs:3:10 + | +LL | (pat ..) => {} + | ^^^^^^ +error[E0425]: cannot find value `pat` in this scope + --> $DIR/pat-tuple-5.rs:3:10 + | +LL | (pat ..) => {} + | ^^^ not found in this scope + +error[E0658]: exclusive range pattern syntax is experimental + --> $DIR/pat-tuple-5.rs:3:10 + | +LL | (pat ..) => {} + | ^^^^^^ + | + = note: for more information, see https://github.com/rust-lang/rust/issues/37854 + = help: add #![feature(exclusive_range_pattern)] to the crate attributes to enable + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/pat-tuple-5.rs:3:10 + | +LL | (pat ..) => {} + | ^^^^^^ ranges require char or numeric types + | + = note: start type: [type error] + = note: end type: [type error] + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0029, E0425, E0658. +For more information about an error, try `rustc --explain E0029`.