Diffstat (limited to 'src/any.rs')
-rw-r--r--src/any.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/any.rs b/src/any.rs
index 98fbf5c..e007f80 100644
--- a/src/any.rs
+++ b/src/any.rs
@@ -180,6 +180,7 @@ impl<'b, 'ctx: 'b> dyn AnyTrait<'ctx> + Send + Sync + 'b {
/// as it automatically downcasts the returned [`AnyTraitObject`].
///
/// If the returned [`AnyTraitObject`] is the wrong type, then a panic happens.
+ #[inline(always)]
pub fn upcast<'a, Trait: ?Sized + TypeName::MemberType>(
&'a self,
) -> Option<&'a TypeName::T<'a, 'ctx, Trait>> {
@@ -201,6 +202,7 @@ impl<'b, 'ctx: 'b> dyn AnyTrait<'ctx> + Send + Sync + 'b {
/// as it automatically downcasts the returned [`AnyTraitObject`].
///
/// If the returned [`AnyTraitObject`] is the wrong type, then a panic happens.
+ #[inline(always)]
pub fn upcast_mut<'a, Trait: ?Sized + TypeName::MemberType>(
&'a mut self,
) -> Option<&'a mut TypeName::T<'a, 'ctx, Trait>> {
@@ -239,7 +241,7 @@ macro_rules! any_trait {
impl<$lt $($generic)*> $crate::any::AnyTrait<$lt> for $name
$(where $($bound)*)?
{
- #[inline]
+ #[inline(always)]
fn upcast_to_id<'__>(
&'__ self,
id: $crate::any::TypeNameId
@@ -260,7 +262,7 @@ macro_rules! any_trait {
}
}
- #[inline]
+ #[inline(always)]
fn upcast_to_id_mut<'__>(
&'__ mut self,
id: $crate::any::TypeNameId