Make Ty::boxed_ty return an Option
This commit is contained in:
parent
663f20086a
commit
0b8cb4a1eb
5 changed files with 11 additions and 13 deletions
|
|
@ -704,8 +704,8 @@ pub fn expr_sig<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>) -> Option<ExprFnS
|
|||
|
||||
/// If the type is function like, get the signature for it.
|
||||
pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'tcx>> {
|
||||
if ty.is_box() {
|
||||
return ty_sig(cx, ty.boxed_ty());
|
||||
if let Some(boxed_ty) = ty.boxed_ty() {
|
||||
return ty_sig(cx, boxed_ty);
|
||||
}
|
||||
match *ty.kind() {
|
||||
ty::Closure(id, subs) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue