Do not resolve associated const when there is no provided value
This commit is contained in:
parent
22d25f21dc
commit
22b2aae737
9 changed files with 50 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue