Skip to content

Commit 0cb5f5d

Browse files
committed
tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case
1 parent ec6f622 commit 0cb5f5d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/ui/traits/fmt-pointer-trait.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ use std::ptr;
33
use std::rc::Rc;
44
use std::sync::Arc;
55

6+
/// Regression test for <https://github.com/rust-lang/rust/issues/50280#issuecomment-626035934>
7+
fn show(a: fn () -> f32, b: fn (&Vec<i8>)->f32) {
8+
println!("the two pointers: {:p} {:p}", a, b);
9+
}
10+
611
fn main() {
712
let p: *const u8 = ptr::null();
813
let rc = Rc::new(1usize);
@@ -21,4 +26,6 @@ fn main() {
2126
}
2227
assert_eq!(format!("{:p}", p),
2328
"0x0");
29+
30+
show(|| 1.0, |_| 2.0);
2431
}

0 commit comments

Comments
 (0)