We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0dd0c6c + 93a17c8 commit db94aedCopy full SHA for db94aed
compiler/rustc_ty_utils/src/instance.rs
@@ -171,9 +171,13 @@ fn resolve_associated_item<'tcx>(
171
return Ok(None);
172
}
173
174
- // If the item does not have a value, then we cannot return an instance.
+ // Any final impl is required to define all associated items.
175
if !leaf_def.item.defaultness(tcx).has_value() {
176
- return Ok(None);
+ 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);
181
182
183
let substs = tcx.erase_regions(substs);
0 commit comments