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:
commit
c610aeb592
57 changed files with 93 additions and 97 deletions
|
@ -369,8 +369,8 @@ impl AddToDiagnostic for AddLifetimeParamsSuggestion<'_> {
|
|||
{
|
||||
let mut mk_suggestion = || {
|
||||
let (
|
||||
hir::Ty { kind: hir::TyKind::Rptr(lifetime_sub, _), .. },
|
||||
hir::Ty { kind: hir::TyKind::Rptr(lifetime_sup, _), .. },
|
||||
hir::Ty { kind: hir::TyKind::Ref(lifetime_sub, _), .. },
|
||||
hir::Ty { kind: hir::TyKind::Ref(lifetime_sup, _), .. },
|
||||
) = (self.ty_sub, self.ty_sup) else {
|
||||
return false;
|
||||
};
|
||||
|
|
|
@ -96,8 +96,8 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
hir::TyKind::Rptr(ref lifetime, _) => {
|
||||
// the lifetime of the TyRptr
|
||||
hir::TyKind::Ref(ref lifetime, _) => {
|
||||
// the lifetime of the Ref
|
||||
let hir_id = lifetime.hir_id;
|
||||
match (self.tcx.named_region(hir_id), self.bound_region) {
|
||||
// Find the index of the named region that was part of the
|
||||
|
|
|
@ -147,7 +147,7 @@ impl<'tcx> Visitor<'tcx> for TypeParamSpanVisitor<'tcx> {
|
|||
|
||||
fn visit_ty(&mut self, arg: &'tcx hir::Ty<'tcx>) {
|
||||
match arg.kind {
|
||||
hir::TyKind::Rptr(_, ref mut_ty) => {
|
||||
hir::TyKind::Ref(_, ref mut_ty) => {
|
||||
// We don't want to suggest looking into borrowing `&T` or `&Self`.
|
||||
hir::intravisit::walk_ty(self, mut_ty.ty);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue