Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/ui/traits/fmt-pointer-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ use std::ptr;
use std::rc::Rc;
use std::sync::Arc;

/// Regression test for <https://github.com/rust-lang/rust/issues/50280#issuecomment-626035934>
fn show(a: fn () -> f32, b: fn (&Vec<i8>)->f32) {
println!("the two pointers: {:p} {:p}", a, b);
}

fn main() {
let p: *const u8 = ptr::null();
let rc = Rc::new(1usize);
Expand All @@ -21,4 +26,6 @@ fn main() {
}
assert_eq!(format!("{:p}", p),
"0x0");

show(|| 1.0, |_| 2.0);
}
Loading