Support evaluating dyn Trait methods

This commit is contained in:
hkalbasi 2023-03-14 12:14:02 +03:30
parent a063f000ff
commit 7525a38af5
4 changed files with 197 additions and 60 deletions

View file

@ -230,7 +230,14 @@ impl MirLowerCtx<'_> {
self.lower_const(c, current, place, expr_id.into())?;
return Ok(Some(current))
},
_ => not_supported!("associated functions and types"),
hir_def::AssocItemId::FunctionId(_) => {
// FnDefs are zero sized, no action is needed.
return Ok(Some(current))
}
hir_def::AssocItemId::TypeAliasId(_) => {
// FIXME: If it is unreachable, use proper error instead of `not_supported`.
not_supported!("associated functions and types")
},
}
} else if let Some(variant) = self
.infer