We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a851da commit 9aec5c5Copy full SHA for 9aec5c5
tests/ui/mir/auxiliary/static_fnptr.rs
@@ -0,0 +1,10 @@
1
+//@ compile-flags:-O
2
+
3
+fn foo() {}
4
5
+pub static ADDR: fn() = foo;
6
7
+#[inline(always)]
8
+pub fn bar(x: fn()) -> bool {
9
+ x == ADDR
10
+}
tests/ui/mir/static_fnptr.rs
@@ -0,0 +1,14 @@
+//@ run-pass
+//@ compile-flags:-Cno-prepopulate-passes -Copt-level=0
+//@ aux-build:static_fnptr.rs
+extern crate static_fnptr;
+use static_fnptr::{ADDR, bar};
+fn baz() -> bool {
+ bar(ADDR)
11
12
+fn main() {
13
+ assert!(baz())
14
0 commit comments