Make Ty::boxed_ty
return an Option
This commit is contained in:
parent
842d6fc32e
commit
f6e8a84eea
21 changed files with 58 additions and 48 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue