From 28a249b53e0874e87ba53f491acf11bbddff0789 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 15 Oct 2021 06:25:11 +0200 Subject: [PATCH] Add unbounded pats to `match_overlapping_arm` tests --- tests/ui/match_overlapping_arm.rs | 11 ++++------- tests/ui/match_overlapping_arm.stderr | 14 +++++++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/ui/match_overlapping_arm.rs b/tests/ui/match_overlapping_arm.rs index d8a65496b258..ff91c4498ec6 100644 --- a/tests/ui/match_overlapping_arm.rs +++ b/tests/ui/match_overlapping_arm.rs @@ -88,20 +88,17 @@ fn overlapping() { _ => (), } - /* - // FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns match 42 { - 0.. => println!("0 .. 42"), - 3.. => println!("3 .. 42"), + 3.. => println!("3.."), + 0.. => println!("0.."), _ => (), } match 42 { - ..=23 => println!("0 ... 23"), - ..26 => println!("0 .. 26"), + ..=23 => println!("..=23"), + ..26 => println!("..26"), _ => (), } - */ if let None = Some(42) { // nothing diff --git a/tests/ui/match_overlapping_arm.stderr b/tests/ui/match_overlapping_arm.stderr index 5d3f1637e941..c2b3f173c2b8 100644 --- a/tests/ui/match_overlapping_arm.stderr +++ b/tests/ui/match_overlapping_arm.stderr @@ -59,5 +59,17 @@ note: overlaps with this LL | 0..=10 => println!("0..=10"), | ^^^^^^ -error: aborting due to 5 previous errors +error: some ranges overlap + --> $DIR/match_overlapping_arm.rs:98:9 + | +LL | ..=23 => println!("..=23"), + | ^^^^^ + | +note: overlaps with this + --> $DIR/match_overlapping_arm.rs:99:9 + | +LL | ..26 => println!("..26"), + | ^^^^ + +error: aborting due to 6 previous errors