diff --git a/tests/ui/const-generics/issues/issue-72352.full.stderr b/tests/ui/const-generics/issues/issue-72352.full.stderr index cc46e7951f0ad..16a14d7f48079 100644 --- a/tests/ui/const-generics/issues/issue-72352.full.stderr +++ b/tests/ui/const-generics/issues/issue-72352.full.stderr @@ -1,7 +1,7 @@ error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-72352.rs:7:42 + --> $DIR/issue-72352.rs:8:42 | -LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { +LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const c_char) -> usize { | ^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-72352.min.stderr b/tests/ui/const-generics/issues/issue-72352.min.stderr index cd009c973aeb2..ede0faec7c67c 100644 --- a/tests/ui/const-generics/issues/issue-72352.min.stderr +++ b/tests/ui/const-generics/issues/issue-72352.min.stderr @@ -1,7 +1,7 @@ error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-72352.rs:7:42 + --> $DIR/issue-72352.rs:8:42 | -LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { +LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const c_char) -> usize { | ^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` diff --git a/tests/ui/const-generics/issues/issue-72352.rs b/tests/ui/const-generics/issues/issue-72352.rs index 2fa1d7a533783..0cab6e8ebfa8d 100644 --- a/tests/ui/const-generics/issues/issue-72352.rs +++ b/tests/ui/const-generics/issues/issue-72352.rs @@ -1,10 +1,11 @@ // revisions: full min + #![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] -use std::ffi::{CStr, CString}; +use std::ffi::{c_char, CStr, CString}; -unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { +unsafe fn unsafely_do_the_thing usize>(ptr: *const c_char) -> usize { //~^ ERROR: using function pointers as const generic parameters is forbidden F(CStr::from_ptr(ptr)) } @@ -16,7 +17,5 @@ fn safely_do_the_thing(s: &CStr) -> usize { fn main() { let baguette = CString::new("baguette").unwrap(); let ptr = baguette.as_ptr(); - println!("{}", unsafe { - unsafely_do_the_thing::(ptr) - }); + println!("{}", unsafe { unsafely_do_the_thing::(ptr) }); }