about summary refs log tree commit diff
path: root/tests/ui/function-pointer/function-pointer-comparison-54696.rs
diff options
context:
space:
mode:
authorThe rustc-josh-sync Cronjob Bot <github-actions@github.com>2025-09-25 04:16:26 +0000
committerThe rustc-josh-sync Cronjob Bot <github-actions@github.com>2025-09-25 04:16:26 +0000
commitff7e7319837d5029ed4f522601debc2a7bc33274 (patch)
tree42dbcb2d8c347a2e7c97c7e4361b1c361143da0b /tests/ui/function-pointer/function-pointer-comparison-54696.rs
parent3280c210dd6e5f26595ff4857572f8feba678992 (diff)
parentd226e7aa93425ba2090f423642341a99ab047838 (diff)
downloadrust-ff7e7319837d5029ed4f522601debc2a7bc33274.tar.gz
rust-ff7e7319837d5029ed4f522601debc2a7bc33274.zip
Merge ref 'caccb4d0368b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: caccb4d0368bd918ef6668af8e13834d07040417
Filtered ref: 0f345ed05d559bbfb754f1403b16199366cda2e0
Upstream diff: https://github.com/rust-lang/rust/compare/21a19c297d4f5a03501d92ca251bd7a17073c08a...caccb4d0368bd918ef6668af8e13834d07040417

This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'tests/ui/function-pointer/function-pointer-comparison-54696.rs')
-rw-r--r--tests/ui/function-pointer/function-pointer-comparison-54696.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/function-pointer/function-pointer-comparison-54696.rs b/tests/ui/function-pointer/function-pointer-comparison-54696.rs
new file mode 100644
index 00000000000..2e28dfeaaf8
--- /dev/null
+++ b/tests/ui/function-pointer/function-pointer-comparison-54696.rs
@@ -0,0 +1,11 @@
+// https://github.com/rust-lang/rust/issues/54696
+//@ run-pass
+
+#![allow(unpredictable_function_pointer_comparisons)]
+
+fn main() {
+    // We shouldn't promote this
+    let _ = &(main as fn() == main as fn());
+    // Also check nested case
+    let _ = &(&(main as fn()) == &(main as fn()));
+}