Skip to content

Commit db94aed

Browse files
authored
Rollup merge of #102653 - lcnr:delay_span_bug, r=fee1-dead
resolve instance: missing value to `delay_span_bug`
2 parents 0dd0c6c + 93a17c8 commit db94aed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_ty_utils/src/instance.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,13 @@ fn resolve_associated_item<'tcx>(
171171
return Ok(None);
172172
}
173173

174-
// If the item does not have a value, then we cannot return an instance.
174+
// Any final impl is required to define all associated items.
175175
if !leaf_def.item.defaultness(tcx).has_value() {
176-
return Ok(None);
176+
let guard = tcx.sess.delay_span_bug(
177+
tcx.def_span(leaf_def.item.def_id),
178+
"missing value for assoc item in impl",
179+
);
180+
return Err(guard);
177181
}
178182

179183
let substs = tcx.erase_regions(substs);

0 commit comments

Comments
 (0)