diff --git a/src/impls.rs b/src/impls.rs index 8fa8e606..feb4e5dd 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -29,6 +29,7 @@ use crate::prelude::{ Range, RangeInclusive, }, + rc::Rc, string::String, sync::Arc, time::Duration, @@ -299,6 +300,17 @@ where } } +impl TypeInfo for Rc +where + T: TypeInfo + ?Sized + 'static, +{ + type Identity = T; + + fn type_info() -> Type { + Self::Identity::type_info() + } +} + impl TypeInfo for Arc where T: TypeInfo + ?Sized + 'static, diff --git a/src/prelude.rs b/src/prelude.rs index 7b7ea3c9..fadf05b2 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -40,6 +40,7 @@ cfg_if! { sync, time, vec, + rc }; } else { pub use alloc::{ @@ -50,6 +51,7 @@ cfg_if! { string, sync, vec, + rc }; pub use core::{