-
Notifications
You must be signed in to change notification settings - Fork 135
Description
A Place is currently either Place::Unbound, Place::Type(type, Boundness::PossiblyUnbound or Place::Type(type, Boundness::Bound):
pub(crate) enum Boundness {
Bound,
PossiblyUnbound,
}
pub(crate) enum Place<'db> {
Type(Type<'db>, Boundness),
Unbound,
}There is currently no way of tracking if a Place originated from a declaration or if its type has been inferred. However, we still use e.g. Place::Type(type, Boundness::Bound) to mean "definitely declared" in various places. For example, the place_from_declarations query also returns a Place (wrapped in PlaceFromDeclarationsResult -> PlaceAndQualifiers -> Place).
Similarly, the Member return type of various member-access functions currently tracks the "declared vs inferred" information separately.
We should attempt to refactor Place to generally contain metadata about the origin of a particular type.
Related issue: #1051