diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-10-04 18:26:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-04 18:26:41 +0200 |
| commit | db94aeda38a9afe42b3b89bbffabb222b289ab72 (patch) | |
| tree | 23235ea28be06dd55fb8e04ffc1b9dd3ea02e193 | |
| parent | 0dd0c6c1e63eccb244b43549240d86450fe26641 (diff) | |
| parent | 93a17c8aeade5ea650e6dc5c047d895e3afaa091 (diff) | |
Rollup merge of #102653 - lcnr:delay_span_bug, r=fee1-dead
resolve instance: missing value to `delay_span_bug`
| -rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index fa1dc90e4a2..81ca8b646ff 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -171,9 +171,13 @@ fn resolve_associated_item<'tcx>( return Ok(None); } - // If the item does not have a value, then we cannot return an instance. + // Any final impl is required to define all associated items. if !leaf_def.item.defaultness(tcx).has_value() { - return Ok(None); + let guard = tcx.sess.delay_span_bug( + tcx.def_span(leaf_def.item.def_id), + "missing value for assoc item in impl", + ); + return Err(guard); } let substs = tcx.erase_regions(substs); |
