fix: make Type::of supported unsized types

This commit is contained in:
BD103 2026-01-12 14:42:00 -05:00
parent 137716908d
commit b57c249333

View file

@ -31,7 +31,7 @@ impl Type {
#[unstable(feature = "type_info", issue = "146922")]
#[rustc_const_unstable(feature = "type_info", issue = "146922")]
// FIXME(reflection): don't require the 'static bound
pub const fn of<T: 'static>() -> Self {
pub const fn of<T: ?Sized + 'static>() -> Self {
const { TypeId::of::<T>().info() }
}
}