about summary refs log tree commit diff
path: root/tests/ui/function-pointer/function-pointer-comparison-54696.rs
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2025-08-30 07:07:41 +0000
committerGitHub <noreply@github.com>2025-08-30 07:07:41 +0000
commitc8d20ceb1be87bc35035328aa1925cb3d95ad10b (patch)
treef3ccfe3fdc0af4ed3cda4e0352ba5743c1c10536 /tests/ui/function-pointer/function-pointer-comparison-54696.rs
parentb00c449ef7330353c85e4b1bb4cd30cf5a10f919 (diff)
parentd269d234e033e2b52722ea78767fe10898184993 (diff)
downloadrust-c8d20ceb1be87bc35035328aa1925cb3d95ad10b.tar.gz
rust-c8d20ceb1be87bc35035328aa1925cb3d95ad10b.zip
Merge pull request #4548 from rust-lang/rustup-2025-08-30
Automatic Rustup
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()));
+}