parent
203c8765ea
commit
eff76455fd
3 changed files with 131 additions and 1 deletions
|
@ -1607,7 +1607,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
| ObligationCauseCode::ObjectCastObligation(..)
|
||||
| ObligationCauseCode::OpaqueType
|
||||
);
|
||||
let expected_ty = data.term.ty().unwrap();
|
||||
let expected_ty = data.term.ty().unwrap_or_else(|| self.tcx.ty_error());
|
||||
|
||||
// constrain inference variables a bit more to nested obligations from normalize so
|
||||
// we can have more helpful errors.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue