@@ -22,6 +22,7 @@ pub struct View<'tcx, T> {
2222impl < T > Copy for View < ' _ , T > { }
2323
2424impl < T > Clone for View < ' _ , T > {
25+ #[ inline]
2526 fn clone ( & self ) -> Self {
2627 View { ty : self . ty , _marker : PhantomData }
2728 }
4950 T : TyDeref < ' tcx > ,
5051{
5152 type Target = T ;
53+
54+ #[ inline]
5255 fn deref ( & self ) -> & Self :: Target {
5356 match T :: ty_deref ( self . ty ) {
5457 Some ( t) => t,
@@ -62,13 +65,15 @@ impl<'tcx, T> View<'tcx, T>
6265where
6366 T : TyDeref < ' tcx > ,
6467{
68+ #[ inline]
6569 pub fn new ( ty : Ty < ' tcx > ) -> Option < Self > {
6670 T :: ty_deref ( ty) ?;
6771 Some ( View { ty, _marker : PhantomData } )
6872 }
6973}
7074
7175impl < ' tcx , T > View < ' tcx , T > {
76+ #[ inline]
7277 pub fn as_ty ( & self ) -> Ty < ' tcx > {
7378 self . ty
7479 }
@@ -83,6 +88,7 @@ pub unsafe trait TyDeref<'tcx>: Sized + 'tcx {
8388macro_rules! impl_ty_deref {
8489 ( $ty: ty, $variant: ident) => {
8590 unsafe impl <' tcx> TyDeref <' tcx> for $ty {
91+ #[ inline]
8692 fn ty_deref( ty: Ty <' tcx>) -> Option <& ' tcx Self > {
8793 match & ty. kind {
8894 ty:: $variant( p) => Some ( p) ,
@@ -129,6 +135,7 @@ pub enum ViewKind<'tcx> {
129135}
130136
131137impl < ' tcx > From < Ty < ' tcx > > for ViewKind < ' tcx > {
138+ #[ inline]
132139 fn from ( ty : Ty < ' tcx > ) -> Self {
133140 match ty. kind {
134141 ty:: RawPtr ( tm) => Self :: RawPtr ( tm) ,
0 commit comments