Skip to content

Commit 52e524a

Browse files
committed
make try_find_coercion_lub private; we always use CoerceMany
1 parent cecccd9 commit 52e524a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/librustc_typeck/check/coercion.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
715715
/// Given some expressions, their known unified type and another expression,
716716
/// tries to unify the types, potentially inserting coercions on any of the
717717
/// provided expressions and returns their LUB (aka "common supertype").
718-
pub fn try_find_coercion_lub<'b, E, I>(&self,
719-
cause: &ObligationCause<'tcx>,
720-
exprs: E,
721-
prev_ty: Ty<'tcx>,
722-
new: &'b hir::Expr,
723-
new_ty: Ty<'tcx>)
724-
-> RelateResult<'tcx, Ty<'tcx>>
718+
///
719+
/// This is really an internal helper. From outside the coercion
720+
/// module, you should instantiate a `CoerceMany` instance.
721+
fn try_find_coercion_lub<'b, E, I>(&self,
722+
cause: &ObligationCause<'tcx>,
723+
exprs: E,
724+
prev_ty: Ty<'tcx>,
725+
new: &'b hir::Expr,
726+
new_ty: Ty<'tcx>)
727+
-> RelateResult<'tcx, Ty<'tcx>>
725728
where E: Fn() -> I,
726729
I: IntoIterator<Item = &'b hir::Expr>
727730
{

0 commit comments

Comments
 (0)