Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bdd592a

Browse files
authoredAug 16, 2024
Rollup merge of rust-lang#129110 - nnethercote:Ty-kind-ret-ty-comment, r=jieyouxu
Add a comment explaining the return type of `Ty::kind`. At least we'll get a useful comment out of rust-lang#126069 :) r? ``@lcnr``
2 parents 8fd4899 + 99aad72 commit bdd592a

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+4
-0
lines changed
 

‎compiler/rustc_middle/src/ty/sty.rs

+4
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,10 @@ impl<'tcx> rustc_type_ir::inherent::Ty<TyCtxt<'tcx>> for Ty<'tcx> {
970970

971971
/// Type utilities
972972
impl<'tcx> Ty<'tcx> {
973+
// It would be nicer if this returned the value instead of a reference,
974+
// like how `Predicate::kind` and `Region::kind` do. (It would result in
975+
// many fewer subsequent dereferences.) But that gives a small but
976+
// noticeable performance hit. See #126069 for details.
973977
#[inline(always)]
974978
pub fn kind(self) -> &'tcx TyKind<'tcx> {
975979
self.0.0

0 commit comments

Comments
 (0)
Please sign in to comment.