suggest adding array lengths to references to arrays
This commit is contained in:
parent
b44197abb0
commit
1e384423a9
5 changed files with 120 additions and 29 deletions
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue