File tree Expand file tree Collapse file tree
compiler/rustc_type_ir/src/sty Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,14 +661,17 @@ where
661661 I :: Region : TypeVisitable < I > ,
662662 I :: Tys : TypeVisitable < I > ,
663663{
664- // // It would be nicer if this returned the value instead of a reference,
665- // // like how `Predicate::kind` and `Region::kind` do. (It would result in
666- // // many fewer subsequent dereferences.) But that gives a small but
667- // // noticeable performance hit. See #126069 for details.
668- // #[inline(always)]
669- // pub fn kind(&self) -> &TyKind<I> {
670- // &self.0
671- // }
664+ // It would be nicer if this returned the value instead of a reference,
665+ // like how `Predicate::kind` and `Region::kind` do. (It would result in
666+ // many fewer subsequent dereferences.) But that gives a small but
667+ // noticeable performance hit. See #126069 for details.
668+ // Using `rustc::disallowed_pass_by_ref` otherwise we need to import the
669+ // `IntoKind` trait everywhere and deference which is a lot of noise
670+ #[ expect( rustc:: disallowed_pass_by_ref) ]
671+ #[ inline( always) ]
672+ pub fn kind ( & self ) -> & TyKind < I > {
673+ & self . 0
674+ }
672675
673676 // FIXME(compiler-errors): Think about removing this.
674677 #[ inline( always) ]
You can’t perform that action at this time.
0 commit comments