1
Fork 0

Do not resolve associated const when there is no provided value

This commit is contained in:
Michael Goulet 2022-07-15 05:37:32 +00:00
parent 22d25f21dc
commit 22b2aae737
9 changed files with 50 additions and 43 deletions

View file

@ -280,6 +280,11 @@ fn resolve_associated_item<'tcx>(
return Ok(None);
}
// If the item does not have a value, then we cannot return an instance.
if !leaf_def.item.defaultness.has_value() {
return Ok(None);
}
let substs = tcx.erase_regions(substs);
// Check if we just resolved an associated `const` declaration from