about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorouz-a <ouz.agz@gmail.com>2023-10-02 11:22:48 +0300
committerouz-a <ouz.agz@gmail.com>2023-10-02 23:39:45 +0300
commit5d753abb300eebfb6492dc2b47bd32052a322b71 (patch)
tree2209d4af7e8fb773bbe592d11e2428a1c3f52bb6 /compiler/rustc_const_eval
parent6f0c5ee2d4c9ced0fa9d0e698b6a136cfdc51949 (diff)
downloadrust-5d753abb300eebfb6492dc2b47bd32052a322b71.tar.gz
rust-5d753abb300eebfb6492dc2b47bd32052a322b71.zip
have better explanation for `relate_types`
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/util/compare_types.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/util/compare_types.rs b/compiler/rustc_const_eval/src/util/compare_types.rs
index dd4c67e8d6b..265ca0c7884 100644
--- a/compiler/rustc_const_eval/src/util/compare_types.rs
+++ b/compiler/rustc_const_eval/src/util/compare_types.rs
@@ -30,9 +30,9 @@ pub fn is_equal_up_to_subtyping<'tcx>(
 
 /// Returns whether `src` is a subtype of `dest`, i.e. `src <: dest`.
 ///
-/// For almost all of the use cases variance should be `Covariant`,
-/// in `MirPhase` >= `MirPhase::Runtime(RuntimePhase::Initial` variance should
-/// be `Invariant`.
+/// When validating assignments, the variance should be `Covariant`. When checking
+/// during `MirPhase` >= `MirPhase::Runtime(RuntimePhase::Initial)` variance should be `Invariant`
+/// because we want to check for type equality.
 ///
 /// This mostly ignores opaque types as it can be used in constraining contexts
 /// while still computing the final underlying type.