Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#124459 - RossSmyth:stable_range, r=davidtwco
Browse files Browse the repository at this point in the history
Stabilize exclusive_range_pattern

Stabilization report: rust-lang#37854 (comment)
FCP: rust-lang#37854 (comment)

Stabilization was blocked by a lint that was merged here: rust-lang#118879

Documentation PR is here: rust-lang/reference#1484

`@rustbot` label +F-exclusive_range_pattern +T-lang
fmease authored May 5, 2024
2 parents add679b + 57f00ce commit 592068d
Showing 84 changed files with 366 additions and 691 deletions.
15 changes: 1 addition & 14 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
@@ -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");

1 change: 0 additions & 1 deletion compiler/rustc_error_codes/src/error_codes/E0579.md
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
@@ -844,7 +844,6 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// # #![feature(exclusive_range_pattern)]
/// let x = 123u32;
/// match x {
/// 0..100 => { println!("small"); }
1 change: 0 additions & 1 deletion compiler/rustc_pattern_analysis/src/usefulness.rs
Original file line number Diff line number Diff line change
@@ -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) => {},
2 changes: 1 addition & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/almost_complete_range.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@edition:2018
//@aux-build:proc_macros.rs

#![feature(exclusive_range_pattern)]
#![feature(stmt_expr_attributes)]
#![warn(clippy::almost_complete_range)]
#![allow(ellipsis_inclusive_range_patterns)]
1 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/almost_complete_range.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@edition:2018
//@aux-build:proc_macros.rs

#![feature(exclusive_range_pattern)]
#![feature(stmt_expr_attributes)]
#![warn(clippy::almost_complete_range)]
#![allow(ellipsis_inclusive_range_patterns)]
54 changes: 27 additions & 27 deletions src/tools/clippy/tests/ui/almost_complete_range.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:18:17
--> tests/ui/almost_complete_range.rs:17:17
|
LL | let _ = ('a') ..'z';
| ^^^^^^--^^^
@@ -10,119 +10,119 @@ LL | let _ = ('a') ..'z';
= help: to override `-D warnings` add `#[allow(clippy::almost_complete_range)]`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:19:17
--> tests/ui/almost_complete_range.rs:18:17
|
LL | let _ = 'A' .. ('Z');
| ^^^^--^^^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:20:17
--> tests/ui/almost_complete_range.rs:19:17
|
LL | let _ = ((('0'))) .. ('9');
| ^^^^^^^^^^--^^^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:27:13
--> tests/ui/almost_complete_range.rs:26:13
|
LL | let _ = (b'a')..(b'z');
| ^^^^^^--^^^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:28:13
--> tests/ui/almost_complete_range.rs:27:13
|
LL | let _ = b'A'..b'Z';
| ^^^^--^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:29:13
--> tests/ui/almost_complete_range.rs:28:13
|
LL | let _ = b'0'..b'9';
| ^^^^--^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:35:13
--> tests/ui/almost_complete_range.rs:34:13
|
LL | let _ = inline!('a')..'z';
| ^^^^^^^^^^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:36:13
--> tests/ui/almost_complete_range.rs:35:13
|
LL | let _ = inline!('A')..'Z';
| ^^^^^^^^^^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:37:13
--> tests/ui/almost_complete_range.rs:36:13
|
LL | let _ = inline!('0')..'9';
| ^^^^^^^^^^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:40:9
--> tests/ui/almost_complete_range.rs:39:9
|
LL | b'a'..b'z' if true => 1,
| ^^^^--^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:41:9
--> tests/ui/almost_complete_range.rs:40:9
|
LL | b'A'..b'Z' if true => 2,
| ^^^^--^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:42:9
--> tests/ui/almost_complete_range.rs:41:9
|
LL | b'0'..b'9' if true => 3,
| ^^^^--^^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:50:9
--> tests/ui/almost_complete_range.rs:49:9
|
LL | 'a'..'z' if true => 1,
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:51:9
--> tests/ui/almost_complete_range.rs:50:9
|
LL | 'A'..'Z' if true => 2,
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:52:9
--> tests/ui/almost_complete_range.rs:51:9
|
LL | '0'..'9' if true => 3,
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:65:17
--> tests/ui/almost_complete_range.rs:64:17
|
LL | let _ = 'a'..'z';
| ^^^--^^^
@@ -132,7 +132,7 @@ LL | let _ = 'a'..'z';
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:66:17
--> tests/ui/almost_complete_range.rs:65:17
|
LL | let _ = 'A'..'Z';
| ^^^--^^^
@@ -142,7 +142,7 @@ LL | let _ = 'A'..'Z';
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:67:17
--> tests/ui/almost_complete_range.rs:66:17
|
LL | let _ = '0'..'9';
| ^^^--^^^
@@ -152,71 +152,71 @@ LL | let _ = '0'..'9';
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:74:9
--> tests/ui/almost_complete_range.rs:73:9
|
LL | 'a'..'z' => 1,
| ^^^--^^^
| |
| help: use an inclusive range: `...`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:75:9
--> tests/ui/almost_complete_range.rs:74:9
|
LL | 'A'..'Z' => 2,
| ^^^--^^^
| |
| help: use an inclusive range: `...`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:76:9
--> tests/ui/almost_complete_range.rs:75:9
|
LL | '0'..'9' => 3,
| ^^^--^^^
| |
| help: use an inclusive range: `...`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:83:13
--> tests/ui/almost_complete_range.rs:82:13
|
LL | let _ = 'a'..'z';
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:84:13
--> tests/ui/almost_complete_range.rs:83:13
|
LL | let _ = 'A'..'Z';
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:85:13
--> tests/ui/almost_complete_range.rs:84:13
|
LL | let _ = '0'..'9';
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:87:9
--> tests/ui/almost_complete_range.rs:86:9
|
LL | 'a'..'z' => 1,
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:88:9
--> tests/ui/almost_complete_range.rs:87:9
|
LL | 'A'..'Z' => 1,
| ^^^--^^^
| |
| help: use an inclusive range: `..=`

error: almost complete ascii range
--> tests/ui/almost_complete_range.rs:89:9
--> tests/ui/almost_complete_range.rs:88:9
|
LL | '0'..'9' => 3,
| ^^^--^^^
1 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/manual_range_patterns.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(unused)]
#![allow(non_contiguous_range_endpoints)]
#![warn(clippy::manual_range_patterns)]
#![feature(exclusive_range_pattern)]

fn main() {
let f = 6;
1 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/manual_range_patterns.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(unused)]
#![allow(non_contiguous_range_endpoints)]
#![warn(clippy::manual_range_patterns)]
#![feature(exclusive_range_pattern)]

fn main() {
let f = 6;
38 changes: 19 additions & 19 deletions src/tools/clippy/tests/ui/manual_range_patterns.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:9:25
--> tests/ui/manual_range_patterns.rs:8:25
|
LL | let _ = matches!(f, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
@@ -8,109 +8,109 @@ LL | let _ = matches!(f, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10);
= help: to override `-D warnings` add `#[allow(clippy::manual_range_patterns)]`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:10:25
--> tests/ui/manual_range_patterns.rs:9:25
|
LL | let _ = matches!(f, 4 | 2 | 3 | 1 | 5 | 6 | 9 | 7 | 8 | 10);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:17:25
--> tests/ui/manual_range_patterns.rs:16:25
|
LL | let _ = matches!(f, 1 | (2..=4));
| ^^^^^^^^^^^ help: try: `1..=4`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:18:25
--> tests/ui/manual_range_patterns.rs:17:25
|
LL | let _ = matches!(f, 1 | (2..4));
| ^^^^^^^^^^ help: try: `1..4`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:19:25
--> tests/ui/manual_range_patterns.rs:18:25
|
LL | let _ = matches!(f, (1..=10) | (2..=13) | (14..=48324728) | 48324729);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=48324729`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:20:25
--> tests/ui/manual_range_patterns.rs:19:25
|
LL | let _ = matches!(f, 0 | (1..=10) | 48324730 | (2..=13) | (14..=48324728) | 48324729);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=48324730`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:21:25
--> tests/ui/manual_range_patterns.rs:20:25
|
LL | let _ = matches!(f, 0..=1 | 0..=2 | 0..=3);
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=3`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:24:9
--> tests/ui/manual_range_patterns.rs:23:9
|
LL | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 => true,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:27:25
--> tests/ui/manual_range_patterns.rs:26:25
|
LL | let _ = matches!(f, -1 | -5 | 3 | -2 | -4 | -3 | 0 | 1 | 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-5..=3`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:29:25
--> tests/ui/manual_range_patterns.rs:28:25
|
LL | let _ = matches!(f, -1_000_000..=1_000_000 | -1_000_001 | 1_000_001);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-1_000_001..=1_000_001`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:32:17
--> tests/ui/manual_range_patterns.rs:31:17
|
LL | matches!(f, 0x00 | 0x01 | 0x02 | 0x03);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x00..=0x03`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:33:17
--> tests/ui/manual_range_patterns.rs:32:17
|
LL | matches!(f, 0x00..=0x05 | 0x06 | 0x07);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x00..=0x07`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:34:17
--> tests/ui/manual_range_patterns.rs:33:17
|
LL | matches!(f, -0x09 | -0x08 | -0x07..=0x00);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-0x09..=0x00`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:36:17
--> tests/ui/manual_range_patterns.rs:35:17
|
LL | matches!(f, 0..5 | 5);
| ^^^^^^^^ help: try: `0..=5`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:37:17
--> tests/ui/manual_range_patterns.rs:36:17
|
LL | matches!(f, 0 | 1..5);
| ^^^^^^^^ help: try: `0..5`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:39:17
--> tests/ui/manual_range_patterns.rs:38:17
|
LL | matches!(f, 0..=5 | 6..10);
| ^^^^^^^^^^^^^ help: try: `0..10`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:40:17
--> tests/ui/manual_range_patterns.rs:39:17
|
LL | matches!(f, 0..5 | 5..=10);
| ^^^^^^^^^^^^^ help: try: `0..=10`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:41:17
--> tests/ui/manual_range_patterns.rs:40:17
|
LL | matches!(f, 5..=10 | 0..5);
| ^^^^^^^^^^^^^ help: try: `0..=10`

error: this OR pattern can be rewritten using a range
--> tests/ui/manual_range_patterns.rs:45:26
--> tests/ui/manual_range_patterns.rs:44:26
|
LL | matches!($e, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
1 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/match_overlapping_arm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![warn(clippy::match_overlapping_arm)]
#![allow(clippy::redundant_pattern_matching)]
#![allow(clippy::if_same_then_else, clippy::equatable_if_let, clippy::needless_if)]
32 changes: 16 additions & 16 deletions src/tools/clippy/tests/ui/match_overlapping_arm.stderr
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:12:9
--> tests/ui/match_overlapping_arm.rs:11:9
|
LL | 0..=10 => println!("0..=10"),
| ^^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:14:9
--> tests/ui/match_overlapping_arm.rs:13:9
|
LL | 0..=11 => println!("0..=11"),
| ^^^^^^
= note: `-D clippy::match-overlapping-arm` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::match_overlapping_arm)]`

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:19:9
--> tests/ui/match_overlapping_arm.rs:18:9
|
LL | 0..=5 => println!("0..=5"),
| ^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:22:9
--> tests/ui/match_overlapping_arm.rs:21:9
|
LL | FOO..=11 => println!("FOO..=11"),
| ^^^^^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:57:9
--> tests/ui/match_overlapping_arm.rs:56:9
|
LL | 0..11 => println!("0..11"),
| ^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:59:9
--> tests/ui/match_overlapping_arm.rs:58:9
|
LL | 0..=11 => println!("0..=11"),
| ^^^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:83:9
--> tests/ui/match_overlapping_arm.rs:82:9
|
LL | 0..=10 => println!("0..=10"),
| ^^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:82:9
--> tests/ui/match_overlapping_arm.rs:81:9
|
LL | 5..14 => println!("5..14"),
| ^^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:89:9
--> tests/ui/match_overlapping_arm.rs:88:9
|
LL | 0..7 => println!("0..7"),
| ^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:91:9
--> tests/ui/match_overlapping_arm.rs:90:9
|
LL | 0..=10 => println!("0..=10"),
| ^^^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:102:9
--> tests/ui/match_overlapping_arm.rs:101:9
|
LL | ..=23 => println!("..=23"),
| ^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:104:9
--> tests/ui/match_overlapping_arm.rs:103:9
|
LL | ..26 => println!("..26"),
| ^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:112:9
--> tests/ui/match_overlapping_arm.rs:111:9
|
LL | 21..=30 => (),
| ^^^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:114:9
--> tests/ui/match_overlapping_arm.rs:113:9
|
LL | 21..=40 => (),
| ^^^^^^^

error: some ranges overlap
--> tests/ui/match_overlapping_arm.rs:127:9
--> tests/ui/match_overlapping_arm.rs:126:9
|
LL | 0..=0x0000_0000_0000_00ff => (),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: overlaps with this
--> tests/ui/match_overlapping_arm.rs:129:9
--> tests/ui/match_overlapping_arm.rs:128:9
|
LL | 0..=0x0000_0000_0000_ffff => (),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1 change: 0 additions & 1 deletion src/tools/clippy/tests/ui/match_wild_err_arm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![allow(clippy::match_same_arms, dead_code)]
#![warn(clippy::match_wild_err_arm)]

8 changes: 4 additions & 4 deletions src/tools/clippy/tests/ui/match_wild_err_arm.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: `Err(_)` matches all errors
--> tests/ui/match_wild_err_arm.rs:24:9
--> tests/ui/match_wild_err_arm.rs:23:9
|
LL | Err(_) => panic!("err"),
| ^^^^^^
@@ -9,23 +9,23 @@ LL | Err(_) => panic!("err"),
= help: to override `-D warnings` add `#[allow(clippy::match_wild_err_arm)]`

error: `Err(_)` matches all errors
--> tests/ui/match_wild_err_arm.rs:32:9
--> tests/ui/match_wild_err_arm.rs:31:9
|
LL | Err(_) => panic!(),
| ^^^^^^
|
= note: match each error separately or use the error output, or use `.expect(msg)` if the error case is unreachable

error: `Err(_)` matches all errors
--> tests/ui/match_wild_err_arm.rs:40:9
--> tests/ui/match_wild_err_arm.rs:39:9
|
LL | Err(_) => {
| ^^^^^^
|
= note: match each error separately or use the error output, or use `.expect(msg)` if the error case is unreachable

error: `Err(_e)` matches all errors
--> tests/ui/match_wild_err_arm.rs:50:9
--> tests/ui/match_wild_err_arm.rs:49:9
|
LL | Err(_e) => panic!(),
| ^^^^^^^
1 change: 0 additions & 1 deletion tests/mir-opt/building/match/sort_candidates.rs
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/ui/binding/match-range.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
#![feature(exclusive_range_pattern)]

pub fn main() {
match 5_usize {
Original file line number Diff line number Diff line change
@@ -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;

This file was deleted.

14 changes: 0 additions & 14 deletions tests/ui/feature-gates/feature-gate-exclusive-range-pattern.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(half_open_range_patterns_in_slices)]
#![feature(exclusive_range_pattern)]

fn main() {
match [5..4, 99..105, 43..44] {
Original file line number Diff line number Diff line change
@@ -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]`
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(half_open_range_patterns_in_slices)]
#![feature(exclusive_range_pattern)]

fn main() {
match [5..4, 99..105, 43..44] {
Original file line number Diff line number Diff line change
@@ -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]`
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exclusive_range_pattern)]

fn main() {
match [5..4, 99..105, 43..44] {
[..9, 99..100, _] => {},
Original file line number Diff line number Diff line change
@@ -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]`
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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() {}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@

// Test various exhaustive matches for `X..`, `..=X` and `..X` ranges.

#![feature(exclusive_range_pattern)]

fn main() {}

macro_rules! m {
Original file line number Diff line number Diff line change
@@ -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 {
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@

// Test the parsing of half-open ranges.

#![feature(exclusive_range_pattern)]

fn main() {}

#[cfg(FALSE)]
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exclusive_range_pattern)]

macro_rules! m {
($s:expr, $($t:tt)+) => {
match $s { $($t)+ => {} }
Original file line number Diff line number Diff line change
@@ -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}');
| ^^^^^^^^^
2 changes: 0 additions & 2 deletions tests/ui/half-open-range-patterns/pat-tuple-4.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ check-pass

#![feature(exclusive_range_pattern)]

fn main() {
const PAT: u8 = 1;

2 changes: 0 additions & 2 deletions tests/ui/half-open-range-patterns/pat-tuple-5.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exclusive_range_pattern)]

fn main() {
const PAT: u8 = 1;

2 changes: 1 addition & 1 deletion tests/ui/half-open-range-patterns/pat-tuple-5.stderr
Original file line number Diff line number Diff line change
@@ -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})`
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
#![allow(non_contiguous_range_endpoints)]
#![feature(exclusive_range_pattern)]
#![feature(inline_const_pat)]

fn main() {
9 changes: 1 addition & 8 deletions tests/ui/half-open-range-patterns/range_pat_interactions1.rs
Original file line number Diff line number Diff line change
@@ -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),
}
}
83 changes: 3 additions & 80 deletions tests/ui/half-open-range-patterns/range_pat_interactions1.stderr
Original file line number Diff line number Diff line change
@@ -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`.
4 changes: 0 additions & 4 deletions tests/ui/half-open-range-patterns/range_pat_interactions2.rs
Original file line number Diff line number Diff line change
@@ -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),
}
}
48 changes: 2 additions & 46 deletions tests/ui/half-open-range-patterns/range_pat_interactions2.stderr
Original file line number Diff line number Diff line change
@@ -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`.
4 changes: 0 additions & 4 deletions tests/ui/half-open-range-patterns/range_pat_interactions3.rs
Original file line number Diff line number Diff line change
@@ -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),
}
}
48 changes: 2 additions & 46 deletions tests/ui/half-open-range-patterns/range_pat_interactions3.stderr
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -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];
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 1 addition & 1 deletion tests/ui/inline-const/const-match-pat-range.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-pass

#![feature(inline_const_pat, exclusive_range_pattern)]
#![feature(inline_const_pat)]

fn main() {
const N: u32 = 10;
2 changes: 0 additions & 2 deletions tests/ui/match/match-range-fail-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exclusive_range_pattern)]

fn main() {
match 5 {
6 ..= 1 => { }
6 changes: 3 additions & 3 deletions tests/ui/match/match-range-fail-2.stderr
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/ui/match/validate-range-endpoints.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![feature(inline_const_pat)]
#![allow(overlapping_range_endpoints)]

22 changes: 11 additions & 11 deletions tests/ui/match/validate-range-endpoints.stderr
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/ui/mir/mir_match_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![allow(overlapping_range_endpoints)]
#![allow(non_contiguous_range_endpoints)]

2 changes: 0 additions & 2 deletions tests/ui/parser/issues/issue-63115-range-pat-interpolated.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ check-pass

#![feature(exclusive_range_pattern)]

#![allow(ellipsis_inclusive_range_patterns)]

fn main() {
1 change: 0 additions & 1 deletion tests/ui/parser/recover/recover-range-pats.rs
Original file line number Diff line number Diff line change
@@ -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() {}
140 changes: 70 additions & 70 deletions tests/ui/parser/recover/recover-range-pats.stderr

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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][..] {
[] => {}
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/ui/pattern/usefulness/floats.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![deny(unreachable_patterns)]

fn main() {
18 changes: 9 additions & 9 deletions tests/ui/pattern/usefulness/floats.stderr
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/ui/pattern/usefulness/guards.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![deny(unreachable_patterns)]

enum Q { R(Option<usize>) }
2 changes: 1 addition & 1 deletion tests/ui/pattern/usefulness/guards.stderr
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![allow(overlapping_range_endpoints)]
#![allow(non_contiguous_range_endpoints)]
#![deny(unreachable_patterns)]
24 changes: 12 additions & 12 deletions tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![deny(non_contiguous_range_endpoints)]

macro_rules! m {
Original file line number Diff line number Diff line change
@@ -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) => {}
| ^^^^^
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![deny(overlapping_range_endpoints)]

macro_rules! m {
Original file line number Diff line number Diff line change
@@ -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`...
Original file line number Diff line number Diff line change
@@ -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 {}
| ^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ revisions: deny
#![feature(exclusive_range_pattern)]
#![allow(overlapping_range_endpoints)]

macro_rules! m {
1 change: 0 additions & 1 deletion tests/ui/pattern/usefulness/integer-ranges/reachability.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![allow(overlapping_range_endpoints)]
#![allow(non_contiguous_range_endpoints)]
#![deny(unreachable_patterns)]
52 changes: 26 additions & 26 deletions tests/ui/pattern/usefulness/integer-ranges/reachability.stderr
Original file line number Diff line number Diff line change
@@ -1,157 +1,157 @@
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
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 change: 0 additions & 1 deletion tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(exclusive_range_pattern)]
#![allow(unreachable_patterns)]
fn main() {
match 0u8 {
4 changes: 2 additions & 2 deletions tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr
Original file line number Diff line number Diff line change
@@ -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`
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Matching against NaN should result in an error
#![feature(exclusive_range_pattern)]
#![allow(unused)]

const NAN: f64 = f64::NAN;
Original file line number Diff line number Diff line change
@@ -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 => {},
| ^^^^^

0 comments on commit 592068d

Please sign in to comment.