Skip to content

Commit

Permalink
Rollup merge of #102653 - lcnr:delay_span_bug, r=fee1-dead
Browse files Browse the repository at this point in the history
resolve instance: missing value to `delay_span_bug`
  • Loading branch information
matthiaskrgr authored Oct 4, 2022
2 parents 0dd0c6c + 93a17c8 commit db94aed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/rustc_ty_utils/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit db94aed

Please sign in to comment.