diff options
Diffstat (limited to 'tests/ui/binop/binary-op-on-fn-ptr-eq.rs')
-rw-r--r-- | tests/ui/binop/binary-op-on-fn-ptr-eq.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/binop/binary-op-on-fn-ptr-eq.rs b/tests/ui/binop/binary-op-on-fn-ptr-eq.rs new file mode 100644 index 000000000..8e20640b5 --- /dev/null +++ b/tests/ui/binop/binary-op-on-fn-ptr-eq.rs @@ -0,0 +1,9 @@ +// run-pass +// Tests equality between supertype and subtype of a function +// See the issue #91636 +fn foo(_a: &str) {} + +fn main() { + let x = foo as fn(&'static str); + let _ = x == foo; +} |