From 5d91e9e941a069cc715d630b9b9826de6275f0a9 Mon Sep 17 00:00:00 2001 From: Ellen Date: Fri, 10 Jun 2022 21:26:53 +0100 Subject: [PATCH] a --- compiler/rustc_infer/src/infer/at.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/rustc_infer/src/infer/at.rs b/compiler/rustc_infer/src/infer/at.rs index 39f7d30e81a..b901cc443a0 100644 --- a/compiler/rustc_infer/src/infer/at.rs +++ b/compiler/rustc_infer/src/infer/at.rs @@ -111,6 +111,9 @@ pub fn eq_impl_headers( } /// Makes `a <: b`, where `a` may or may not be expected. + /// + /// See [`At::trace_exp`] and [`Trace::sub`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn sub_exp(self, a_is_expected: bool, a: T, b: T) -> InferResult<'tcx, ()> where T: ToTrace<'tcx>, @@ -122,6 +125,9 @@ pub fn sub_exp(self, a_is_expected: bool, a: T, b: T) -> InferResult<'tcx, () /// call like `foo(x)`, where `foo: fn(i32)`, you might have /// `sup(i32, x)`, since the "expected" type is the type that /// appears in the signature. + /// + /// See [`At::trace`] and [`Trace::sub`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn sup(self, expected: T, actual: T) -> InferResult<'tcx, ()> where T: ToTrace<'tcx>, @@ -130,6 +136,9 @@ pub fn sup(self, expected: T, actual: T) -> InferResult<'tcx, ()> } /// Makes `expected <: actual`. + /// + /// See [`At::trace`] and [`Trace::sub`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn sub(self, expected: T, actual: T) -> InferResult<'tcx, ()> where T: ToTrace<'tcx>, @@ -138,6 +147,9 @@ pub fn sub(self, expected: T, actual: T) -> InferResult<'tcx, ()> } /// Makes `expected <: actual`. + /// + /// See [`At::trace_exp`] and [`Trace::eq`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn eq_exp(self, a_is_expected: bool, a: T, b: T) -> InferResult<'tcx, ()> where T: ToTrace<'tcx>, @@ -146,6 +158,9 @@ pub fn eq_exp(self, a_is_expected: bool, a: T, b: T) -> InferResult<'tcx, ()> } /// Makes `expected <: actual`. + /// + /// See [`At::trace`] and [`Trace::eq`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn eq(self, expected: T, actual: T) -> InferResult<'tcx, ()> where T: ToTrace<'tcx>, @@ -176,6 +191,9 @@ pub fn relate(self, expected: T, variance: ty::Variance, actual: T) -> InferR /// this can result in an error (e.g., if asked to compute LUB of /// u32 and i32), it is meaningful to call one of them the /// "expected type". + /// + /// See [`At::trace`] and [`Trace::lub`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn lub(self, expected: T, actual: T) -> InferResult<'tcx, T> where T: ToTrace<'tcx>, @@ -186,6 +204,9 @@ pub fn lub(self, expected: T, actual: T) -> InferResult<'tcx, T> /// Computes the greatest-lower-bound, or mutual subtype, of two /// values. As with `lub` order doesn't matter, except for error /// cases. + /// + /// See [`At::trace`] and [`Trace::glb`] for a version of + /// this method that only requires `T: Relate<'tcx>` pub fn glb(self, expected: T, actual: T) -> InferResult<'tcx, T> where T: ToTrace<'tcx>,