diff --git a/src/librustc_infer/infer/at.rs b/src/librustc_infer/infer/at.rs index 5c62a1298b9..d44b8f55414 100644 --- a/src/librustc_infer/infer/at.rs +++ b/src/librustc_infer/infer/at.rs @@ -186,7 +186,6 @@ impl<'a, 'tcx> At<'a, 'tcx> { impl<'a, 'tcx> Trace<'a, 'tcx> { /// Makes `a <: b` where `a` may or may not be expected (if /// `a_is_expected` is true, then `a` is expected). - /// Makes `expected <: actual`. pub fn sub(self, a: &T, b: &T) -> InferResult<'tcx, ()> where T: Relate<'tcx>, diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index 5d1a1a16485..e3b16eaaef2 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -107,6 +107,7 @@ fn coerce_mutbls<'tcx>( } } +/// Do not require any adjustments, i.e. coerce `x -> x`. fn identity(_: Ty<'_>) -> Vec> { vec![] } @@ -115,6 +116,7 @@ fn simple(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec> move |target| vec![Adjustment { kind, target }] } +/// This always returns `Ok(...)`. fn success<'tcx>( adj: Vec>, target: Ty<'tcx>, @@ -133,6 +135,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { } pub fn unify(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> InferResult<'tcx, Ty<'tcx>> { + debug!("unify(a: {:?}, b: {:?}, use_lub: {})", a, b, self.use_lub); self.commit_if_ok(|_| { if self.use_lub { self.at(&self.cause, self.fcx.param_env).lub(b, a)