`T: ?Sized` bound in where cuase got compile time error: unexpect `?`

#1
// error version: unexpected `?`
fn get_tydesc_var<T>(var: &T) -> std::intrinsics::TyDesc where T: ?Sized {
    unsafe { *std::intrinsics::get_tydesc::<T>() }
}

// no error
fn get_tydesc_var<T: ?Sized>(var: &T) -> std::intrinsics::TyDesc {
     unsafe { *std::intrinsics::get_tydesc::<T>() }
}

?Sized as type bound like other types should avilable in where cause, is this a bug?

#2
2 Likes
closed #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.