diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-03-17 11:53:15 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-03-30 07:55:29 -0400 |
| commit | 52e524a3578b7661d6430735c7cd51eeccdacb0b (patch) | |
| tree | e291cd52b0a2ca8279ab607d293aeeb9da033140 | |
| parent | cecccd9bef2ce56b91b7ac3b067f0afa2e7846db (diff) | |
| download | rust-52e524a3578b7661d6430735c7cd51eeccdacb0b.tar.gz rust-52e524a3578b7661d6430735c7cd51eeccdacb0b.zip | |
make `try_find_coercion_lub` private; we always use `CoerceMany`
| -rw-r--r-- | src/librustc_typeck/check/coercion.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index a08faf2610e..c420449cea0 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -715,13 +715,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// Given some expressions, their known unified type and another expression, /// tries to unify the types, potentially inserting coercions on any of the /// provided expressions and returns their LUB (aka "common supertype"). - pub fn try_find_coercion_lub<'b, E, I>(&self, - cause: &ObligationCause<'tcx>, - exprs: E, - prev_ty: Ty<'tcx>, - new: &'b hir::Expr, - new_ty: Ty<'tcx>) - -> RelateResult<'tcx, Ty<'tcx>> + /// + /// This is really an internal helper. From outside the coercion + /// module, you should instantiate a `CoerceMany` instance. + fn try_find_coercion_lub<'b, E, I>(&self, + cause: &ObligationCause<'tcx>, + exprs: E, + prev_ty: Ty<'tcx>, + new: &'b hir::Expr, + new_ty: Ty<'tcx>) + -> RelateResult<'tcx, Ty<'tcx>> where E: Fn() -> I, I: IntoIterator<Item = &'b hir::Expr> { |
