Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errors
Avoid ICE by accounting for missing type Fix #105330
This commit is contained in:
commit
07fd8089a4
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