diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2025-08-30 07:07:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-30 07:07:41 +0000 |
| commit | c8d20ceb1be87bc35035328aa1925cb3d95ad10b (patch) | |
| tree | f3ccfe3fdc0af4ed3cda4e0352ba5743c1c10536 /tests/ui/function-pointer | |
| parent | b00c449ef7330353c85e4b1bb4cd30cf5a10f919 (diff) | |
| parent | d269d234e033e2b52722ea78767fe10898184993 (diff) | |
| download | rust-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')
| -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())); +} |
