about summary refs log tree commit diff
path: root/src/test/ui/feature-gates
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2020-11-20 19:03:56 +0000
committerNadrieril <nadrieril+git@gmail.com>2020-11-21 01:38:42 +0000
commit3213efcd9ab32cbe4e69c4322e6a992a9e64f0ff (patch)
tree19c5ec010eb470784cfab27165a8ef17cd548f8c /src/test/ui/feature-gates
parent82bf5b61cd8e03e463f7877d7b3a801c8ba60f13 (diff)
downloadrust-3213efcd9ab32cbe4e69c4322e6a992a9e64f0ff.tar.gz
rust-3213efcd9ab32cbe4e69c4322e6a992a9e64f0ff.zip
Improve integer range tests
Diffstat (limited to 'src/test/ui/feature-gates')
-rw-r--r--src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs21
-rw-r--r--src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr4
2 files changed, 15 insertions, 10 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs b/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
index 1208552d256..d42fbf22938 100644
--- a/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
+++ b/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
@@ -1,14 +1,19 @@
-#![feature(exclusive_range_pattern)]
-
-use std::usize::MAX;
+use std::{isize, usize};
 
 fn main() {
-    match 0usize { //~ERROR non-exhaustive patterns: `_` not covered
-        0..=MAX => {}
+    match 0usize {
+        //~^ ERROR non-exhaustive patterns: `_` not covered
+        //~| NOTE pattern `_` not covered
+        //~| NOTE the matched value is of type `usize`
+        //~| NOTE `usize` does not have a fixed maximum value
+        0..=usize::MAX => {}
     }
 
-    match 0isize { //~ERROR non-exhaustive patterns: `_` not covered
-        1..=20 => {}
-        -5..3 => {}
+    match 0isize {
+        //~^ ERROR non-exhaustive patterns: `_` not covered
+        //~| NOTE pattern `_` not covered
+        //~| NOTE the matched value is of type `isize`
+        //~| NOTE `isize` does not have a fixed maximum value
+        isize::MIN..=isize::MAX => {}
     }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr b/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
index c7a63e5d502..da308c292df 100644
--- a/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
+++ b/src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/feature-gate-precise_pointer_size_matching.rs:6:11
+  --> $DIR/feature-gate-precise_pointer_size_matching.rs:4:11
    |
 LL |     match 0usize {
    |           ^^^^^^ pattern `_` not covered
@@ -10,7 +10,7 @@ LL |     match 0usize {
    = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
 
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/feature-gate-precise_pointer_size_matching.rs:10:11
+  --> $DIR/feature-gate-precise_pointer_size_matching.rs:12:11
    |
 LL |     match 0isize {
    |           ^^^^^^ pattern `_` not covered