Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, r=compiler-errors

Rename `Rptr` to `Ref` in AST and HIR

The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
This commit is contained in:
Matthias Krüger 2022-12-29 13:16:04 +01:00 committed by GitHub
commit c610aeb592
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 93 additions and 97 deletions

View file

@ -2431,7 +2431,7 @@ impl<'hir> Ty<'hir> {
pub fn peel_refs(&self) -> &Self {
let mut final_ty = self;
while let TyKind::Rptr(_, MutTy { ty, .. }) = &final_ty.kind {
while let TyKind::Ref(_, MutTy { ty, .. }) = &final_ty.kind {
final_ty = ty;
}
final_ty
@ -2588,7 +2588,7 @@ pub enum TyKind<'hir> {
/// A raw pointer (i.e., `*const T` or `*mut T`).
Ptr(MutTy<'hir>),
/// A reference (i.e., `&'a T` or `&'a mut T`).
Rptr(&'hir Lifetime, MutTy<'hir>),
Ref(&'hir Lifetime, MutTy<'hir>),
/// A bare function (e.g., `fn(usize) -> bool`).
BareFn(&'hir BareFnTy<'hir>),
/// The never type (`!`).