diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2025-09-25 08:06:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-25 08:06:08 +0000 |
| commit | 4a39e597d20567578bfd2611e4da19ee68fd3a0b (patch) | |
| tree | 55c911d2d78d931ca075823ecb457bfa5117daf8 /tests/ui/function-pointer | |
| parent | da9831cc04b85faf584318e79dea00b4aa16ec59 (diff) | |
| parent | 13d512f2d57a4ad1b97cb0f543b3d85c4cbd1962 (diff) | |
| download | rust-4a39e597d20567578bfd2611e4da19ee68fd3a0b.tar.gz rust-4a39e597d20567578bfd2611e4da19ee68fd3a0b.zip | |
Merge pull request #20740 from rust-lang/rustc-pull
Rustc pull update
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())); +} |
