]> git.lizzy.rs Git - rust.git/commitdiff
Talk about unpredictable instead of "not deterministic"
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 23 Sep 2020 14:38:30 +0000 (16:38 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 23 Sep 2020 14:38:30 +0000 (16:38 +0200)
compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
src/test/ui/issues/issue-44333.rs
src/test/ui/issues/issue-44333.stderr
src/test/ui/rfc1445/issue-63479-match-fnptr.rs
src/test/ui/rfc1445/issue-63479-match-fnptr.stderr

index 4a50bbca066749dd3761e944673e648a7ea625bb..3c0dec64693fe5a79a1d19357293e6afa36274e6 100644 (file)
@@ -413,8 +413,8 @@ fn recur(
             ty::FnPtr(..) | ty::RawPtr(..) => {
                 if self.include_lint_checks && !self.saw_const_match_error.get() {
                     self.saw_const_match_error.set(true);
-                    let msg = "function pointers and unsized pointers in patterns do not behave \
-                        deterministically. \
+                    let msg = "function pointers and unsized pointers in patterns behave \
+                        unpredictably and should not be relied upon. \
                         See https://github.com/rust-lang/rust/issues/70861 for details.";
                     tcx.struct_span_lint_hir(
                         lint::builtin::POINTER_STRUCTURAL_MATCH,
index 85f5ccbdb65612f569e4b5064390008a5eb11f1c..96e8795e52d56687ceb660c8d9a5bd1833f1e8e4 100644 (file)
@@ -16,9 +16,9 @@ fn test(x: usize) -> Func {
 
 fn main() {
     match test(std::env::consts::ARCH.len()) {
-        FOO => println!("foo"), //~ WARN pointers in patterns do not behave deterministically
+        FOO => println!("foo"), //~ WARN pointers in patterns behave unpredictably
         //~^ WARN will become a hard error
-        BAR => println!("bar"), //~ WARN pointers in patterns do not behave deterministically
+        BAR => println!("bar"), //~ WARN pointers in patterns behave unpredictably
         //~^ WARN will become a hard error
         _ => unreachable!(),
     }
index a9ee5fc4dd7b17efa5f323e9184926e4df572a58..8302b09e5334d0b62919327b4258d3bbc85b69a5 100644 (file)
@@ -1,4 +1,4 @@
-warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
+warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
   --> $DIR/issue-44333.rs:19:9
    |
 LL |         FOO => println!("foo"),
@@ -12,7 +12,7 @@ LL | #![warn(pointer_structural_match)]
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
 
-warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
+warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
   --> $DIR/issue-44333.rs:21:9
    |
 LL |         BAR => println!("bar"),
index 0984b1d480ecbc4ebea5eae5c4ad06313008ad40..567685950e9e4aaf7d77fbf0efc02123285fafe2 100644 (file)
@@ -33,7 +33,7 @@ fn main() {
   let s = B(my_fn);
   match s {
     B(TEST) => println!("matched"),
-    //~^ WARN pointers in patterns do not behave deterministically
+     //~^ WARN pointers in patterns behave unpredictably
     //~| WARN this was previously accepted by the compiler but is being phased out
     _ => panic!("didn't match")
   };
index 34b9c359ca85681b8405ec28dc0ac3b698a4d278..8cf87cc85a1d44e6eaf243e78e5ba214a80791fb 100644 (file)
@@ -1,4 +1,4 @@
-warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
+warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
   --> $DIR/issue-63479-match-fnptr.rs:35:7
    |
 LL |     B(TEST) => println!("matched"),