1
Fork 0

Make Ty::boxed_ty return an Option

This commit is contained in:
Pavel Grigorenko 2024-09-05 00:34:04 +03:00
parent 842d6fc32e
commit f6e8a84eea
21 changed files with 58 additions and 48 deletions

View file

@ -348,8 +348,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
}
}
if let Some(ty::error::ExpectedFound { found, .. }) = exp_found
&& ty.is_box()
&& ty.boxed_ty() == found
&& ty.boxed_ty() == Some(found)
&& let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span)
{
err.span_suggestion(