From 5d753abb300eebfb6492dc2b47bd32052a322b71 Mon Sep 17 00:00:00 2001 From: ouz-a Date: Mon, 2 Oct 2023 11:22:48 +0300 Subject: have better explanation for `relate_types` --- compiler/rustc_const_eval/src/util/compare_types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_const_eval/src') 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. -- cgit 1.4.1-3-g733a5