suggestion for ptr_arg

This commit is contained in:
Andre Bogus
2017-09-10 19:32:24 +02:00
parent b0b60558c5
commit e7e8e79020
3 changed files with 39 additions and 12 deletions

View File

@@ -645,6 +645,15 @@ pub fn multispan_sugg(db: &mut DiagnosticBuilder, help_msg: String, sugg: Vec<(S
db.suggestions.push(sugg);
}
/// Return the base type for HIR references and pointers.
pub fn walk_ptrs_hir_ty(ty: &hir::Ty) -> &hir::Ty {
match ty.node {
TyPtr(ref mut_ty) |
TyRptr(_, ref mut_ty) => walk_ptrs_hir_ty(&mut_ty.ty),
_ => ty
}
}
/// Return the base type for references and raw pointers.
pub fn walk_ptrs_ty(ty: Ty) -> Ty {
match ty.sty {