suggest adding array lengths to references to arrays
This commit is contained in:
@@ -2396,6 +2396,14 @@ impl<'hir> Ty<'hir> {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn peel_refs(&self) -> &Self {
|
||||
let mut final_ty = self;
|
||||
while let TyKind::Rptr(_, MutTy { ty, .. }) = &final_ty.kind {
|
||||
final_ty = &ty;
|
||||
}
|
||||
final_ty
|
||||
}
|
||||
}
|
||||
|
||||
/// Not represented directly in the AST; referred to by name through a `ty_path`.
|
||||
|
||||
Reference in New Issue
Block a user