summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/consts/min_const_fn
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/min_const_fn')
-rw-r--r--tests/ui/consts/min_const_fn/cmp_fn_pointers.rs2
-rw-r--r--tests/ui/consts/min_const_fn/cmp_fn_pointers.stderr14
2 files changed, 5 insertions, 11 deletions
diff --git a/tests/ui/consts/min_const_fn/cmp_fn_pointers.rs b/tests/ui/consts/min_const_fn/cmp_fn_pointers.rs
index 9a2775688..c5990a7f5 100644
--- a/tests/ui/consts/min_const_fn/cmp_fn_pointers.rs
+++ b/tests/ui/consts/min_const_fn/cmp_fn_pointers.rs
@@ -1,6 +1,6 @@
const fn cmp(x: fn(), y: fn()) -> bool {
unsafe { x == y }
- //~^ ERROR can't compare
+ //~^ ERROR pointers cannot
}
fn main() {}
diff --git a/tests/ui/consts/min_const_fn/cmp_fn_pointers.stderr b/tests/ui/consts/min_const_fn/cmp_fn_pointers.stderr
index 8a1b20a33..3845068d8 100644
--- a/tests/ui/consts/min_const_fn/cmp_fn_pointers.stderr
+++ b/tests/ui/consts/min_const_fn/cmp_fn_pointers.stderr
@@ -1,16 +1,10 @@
-error[E0277]: can't compare `fn()` with `_` in const contexts
- --> $DIR/cmp_fn_pointers.rs:2:16
+error: pointers cannot be reliably compared during const eval
+ --> $DIR/cmp_fn_pointers.rs:2:14
|
LL | unsafe { x == y }
- | ^^ no implementation for `fn() == _`
+ | ^^^^^^
|
- = help: the trait `~const PartialEq<_>` is not implemented for `fn()`
-note: the trait `PartialEq<_>` is implemented for `fn()`, but that implementation is not `const`
- --> $DIR/cmp_fn_pointers.rs:2:16
- |
-LL | unsafe { x == y }
- | ^^
+ = note: see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0277`.