diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-09-23 16:38:30 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-09-23 16:38:30 +0200 |
| commit | d486486afdb545e43a27326be07a92d5fc9ad387 (patch) | |
| tree | a2d0e875325233c8e1f551b8f646cf85626b2102 | |
| parent | 1b1b6eabaa9ea0090dd47e642b6bb6606cc52e8c (diff) | |
| download | rust-d486486afdb545e43a27326be07a92d5fc9ad387.tar.gz rust-d486486afdb545e43a27326be07a92d5fc9ad387.zip | |
Talk about unpredictable instead of "not deterministic"
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44333.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44333.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/rfc1445/issue-63479-match-fnptr.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/rfc1445/issue-63479-match-fnptr.stderr | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index 4a50bbca066..3c0dec64693 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -413,8 +413,8 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { 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, diff --git a/src/test/ui/issues/issue-44333.rs b/src/test/ui/issues/issue-44333.rs index 85f5ccbdb65..96e8795e52d 100644 --- a/src/test/ui/issues/issue-44333.rs +++ b/src/test/ui/issues/issue-44333.rs @@ -16,9 +16,9 @@ const BAR: Func = bar; 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!(), } diff --git a/src/test/ui/issues/issue-44333.stderr b/src/test/ui/issues/issue-44333.stderr index a9ee5fc4dd7..8302b09e533 100644 --- a/src/test/ui/issues/issue-44333.stderr +++ b/src/test/ui/issues/issue-44333.stderr @@ -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"), diff --git a/src/test/ui/rfc1445/issue-63479-match-fnptr.rs b/src/test/ui/rfc1445/issue-63479-match-fnptr.rs index 0984b1d480e..567685950e9 100644 --- a/src/test/ui/rfc1445/issue-63479-match-fnptr.rs +++ b/src/test/ui/rfc1445/issue-63479-match-fnptr.rs @@ -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") }; diff --git a/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr b/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr index 34b9c359ca8..8cf87cc85a1 100644 --- a/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr +++ b/src/test/ui/rfc1445/issue-63479-match-fnptr.stderr @@ -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"), |
