diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-19 22:00:36 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-19 23:54:49 +0000 |
| commit | 84baf2f6f8eda07661ab956659839af9b61cc46b (patch) | |
| tree | 9eca7fd67afad588d5b702cf45406f26284d6d50 /compiler | |
| parent | ccb1415eac3289b5ebf64691c0190dc52e0e3d0e (diff) | |
| download | rust-84baf2f6f8eda07661ab956659839af9b61cc46b.tar.gz rust-84baf2f6f8eda07661ab956659839af9b61cc46b.zip | |
return ty::Error when equating ty::Error
This helps iron out a difference between Sub and Equate
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/equate.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/infer/relate/equate.rs b/compiler/rustc_infer/src/infer/relate/equate.rs index cb62f258373..61d1302d816 100644 --- a/compiler/rustc_infer/src/infer/relate/equate.rs +++ b/compiler/rustc_infer/src/infer/relate/equate.rs @@ -89,6 +89,11 @@ impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> { self.fields.instantiate(a, ty::Invariant, b_id, self.a_is_expected)?; } + (&ty::Error(e), _) | (_, &ty::Error(e)) => { + infcx.set_tainted_by_errors(e); + return Ok(Ty::new_error(self.tcx(), e)); + } + ( &ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }), &ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }), |
