diff options
| author | Oneirical <manchot@videotron.ca> | 2025-08-20 14:02:44 -0400 |
|---|---|---|
| committer | Oneirical <manchot@videotron.ca> | 2025-08-27 15:06:05 -0400 |
| commit | 2dc4638c4637bf8ddb83577535317dad21abdf6d (patch) | |
| tree | 30a4419aabfa94d24825735bc504909189dcaa74 /tests/ui/function-pointer/function-pointer-comparison-54696.rs | |
| parent | e8a792daf500b5ff8097896ddb6cc037abe92487 (diff) | |
| download | rust-2dc4638c4637bf8ddb83577535317dad21abdf6d.tar.gz rust-2dc4638c4637bf8ddb83577535317dad21abdf6d.zip | |
Add test batch 2
Diffstat (limited to 'tests/ui/function-pointer/function-pointer-comparison-54696.rs')
| -rw-r--r-- | tests/ui/function-pointer/function-pointer-comparison-54696.rs | 11 |
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())); +} |
