]> git.lizzy.rs Git - rust.git/commitdiff
missing value to delay_span_bug
authorlcnr <rust@lcnr.de>
Tue, 4 Oct 2022 12:18:11 +0000 (14:18 +0200)
committerlcnr <rust@lcnr.de>
Tue, 4 Oct 2022 15:35:26 +0000 (17:35 +0200)
compiler/rustc_ty_utils/src/instance.rs

index fa1dc90e4a24bc32e3d353a4d923c39200d587cb..81ca8b646fff1bf0379a2bd5b17e4628a412ea2f 100644 (file)
@@ -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);