Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d486486

Browse files
committed
Talk about unpredictable instead of "not deterministic"
1 parent 1b1b6ea commit d486486

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
413413
ty::FnPtr(..) | ty::RawPtr(..) => {
414414
if self.include_lint_checks && !self.saw_const_match_error.get() {
415415
self.saw_const_match_error.set(true);
416-
let msg = "function pointers and unsized pointers in patterns do not behave \
417-
deterministically. \
416+
let msg = "function pointers and unsized pointers in patterns behave \
417+
unpredictably and should not be relied upon. \
418418
See https://github.com/rust-lang/rust/issues/70861 for details.";
419419
tcx.struct_span_lint_hir(
420420
lint::builtin::POINTER_STRUCTURAL_MATCH,

src/test/ui/issues/issue-44333.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const BAR: Func = bar;
1616

1717
fn main() {
1818
match test(std::env::consts::ARCH.len()) {
19-
FOO => println!("foo"), //~ WARN pointers in patterns do not behave deterministically
19+
FOO => println!("foo"), //~ WARN pointers in patterns behave unpredictably
2020
//~^ WARN will become a hard error
21-
BAR => println!("bar"), //~ WARN pointers in patterns do not behave deterministically
21+
BAR => println!("bar"), //~ WARN pointers in patterns behave unpredictably
2222
//~^ WARN will become a hard error
2323
_ => unreachable!(),
2424
}

src/test/ui/issues/issue-44333.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
1+
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.
22
--> $DIR/issue-44333.rs:19:9
33
|
44
LL | FOO => println!("foo"),
@@ -12,7 +12,7 @@ LL | #![warn(pointer_structural_match)]
1212
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1313
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
1414

15-
warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
15+
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.
1616
--> $DIR/issue-44333.rs:21:9
1717
|
1818
LL | BAR => println!("bar"),

src/test/ui/rfc1445/issue-63479-match-fnptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn main() {
3333
let s = B(my_fn);
3434
match s {
3535
B(TEST) => println!("matched"),
36-
//~^ WARN pointers in patterns do not behave deterministically
36+
//~^ WARN pointers in patterns behave unpredictably
3737
//~| WARN this was previously accepted by the compiler but is being phased out
3838
_ => panic!("didn't match")
3939
};

src/test/ui/rfc1445/issue-63479-match-fnptr.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: function pointers and unsized pointers in patterns do not behave deterministically. See https://github.com/rust-lang/rust/issues/70861 for details.
1+
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.
22
--> $DIR/issue-63479-match-fnptr.rs:35:7
33
|
44
LL | B(TEST) => println!("matched"),

0 commit comments

Comments
 (0)