have better explanation for relate_types

This commit is contained in:
ouz-a
2023-10-02 11:22:48 +03:00
parent 6f0c5ee2d4
commit 5d753abb30
13 changed files with 40 additions and 34 deletions

View File

@@ -1077,9 +1077,12 @@ pub enum ProjectionElem<V, T> {
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
/// type of lvalue doesn't match the type of rvalue, the primary goal is making subtyping
/// explicit during optimizations and codegen.
///
/// This projection doesn't impact the runtime behavior of the program except for potentially changing
/// some type metadata of the interpreter or codegen backend.
///
/// 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`.