about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2022-10-04 14:18:11 +0200
committerlcnr <rust@lcnr.de>2022-10-04 17:35:26 +0200
commit93a17c8aeade5ea650e6dc5c047d895e3afaa091 (patch)
treee781e6a8f01e5517abb2f325247f4fd39527b347 /compiler
parent6b139c5b3e2bad623bdbd8583bc4f2b0f763113a (diff)
downloadrust-93a17c8aeade5ea650e6dc5c047d895e3afaa091.tar.gz
rust-93a17c8aeade5ea650e6dc5c047d895e3afaa091.zip
missing value to delay_span_bug
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ty_utils/src/instance.rs8
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);