diff options
| author | Tshepang Mbambo <hopsi@tuta.io> | 2025-09-08 06:25:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-08 06:25:38 +0200 |
| commit | 177583d2c04005c94798399f5ddeeed21c79f768 (patch) | |
| tree | e3898e64dcb04dfabd6e758cf6a2fe07192af4be /tests/ui/function-pointer | |
| parent | e65952c779ebb5a0c3157625213aa70ae390c237 (diff) | |
| parent | 7dcb968a2e64dfc89c8edf2536be2d6818a43a09 (diff) | |
| download | rust-177583d2c04005c94798399f5ddeeed21c79f768.tar.gz rust-177583d2c04005c94798399f5ddeeed21c79f768.zip | |
Merge pull request #2582 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())); +} |
