Skip to content

Commit

Permalink
Unrolled build for rust-lang#129110
Browse files Browse the repository at this point in the history
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````
  • Loading branch information
rust-timer authored Aug 16, 2024
2 parents be0ea0c + 99aad72 commit 5ea985a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,10 @@ impl<'tcx> rustc_type_ir::inherent::Ty<TyCtxt<'tcx>> for Ty<'tcx> {

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

0 comments on commit 5ea985a

Please sign in to comment.