Skip to content

Commit 00a2f12

Browse files
committed
make try_find_coercion_lub private; we always use CoerceMany
1 parent 751e4d1 commit 00a2f12

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

0 commit comments

Comments
 (0)