Skip to content

Commit d91ab9a

Browse files
committed
fix ptr comparison test
1 parent 93cf2e5 commit d91ab9a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/run-pass/function_pointers.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
fn f() -> i32 {
2-
42
1+
trait Answer {
2+
fn answer() -> Self;
3+
}
4+
5+
impl Answer for i32 {
6+
fn answer() -> i32 {
7+
42
8+
}
9+
}
10+
11+
// A generic function, to make its address unstable
12+
fn f<T: Answer>() -> T {
13+
Answer::answer()
314
}
415

516
fn g(i: i32) -> i32 {

0 commit comments

Comments
 (0)