Add docs, remove code, change subtyper code

This commit is contained in:
ouz-a
2023-08-28 11:19:19 +03:00
parent 3148e6a993
commit cd7f471931
24 changed files with 106 additions and 363 deletions

View File

@@ -1076,6 +1076,13 @@ pub enum ProjectionElem<V, T> {
/// requiring an intermediate variable.
OpaqueCast(T),
/// A `Subtype(T)` projection is applied to any `StatementKind::Assign` where
/// type of lvalue doesn't match type of rvalue, primary goal being making subtyping
/// explicit during optimizations and codegen.
///
/// This goal is achieved with mir_transform pass `Subtyper`, which runs right after
/// borrowchecker, as we only care about subtyping that can affect trait selection and
/// `TypeId`.
Subtype(T),
}