Make Ty::boxed_ty return an Option

This commit is contained in:
Pavel Grigorenko 2024-09-05 00:34:04 +03:00
parent 663f20086a
commit 0b8cb4a1eb
5 changed files with 11 additions and 13 deletions

View file

@ -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) => {