about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-03-24 11:51:02 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-03-30 07:56:58 -0400
commit127a7d643d70dea605ca479c12a32f450d985b09 (patch)
tree31fab63fab774f163f61cfa453f3f021d12e097b
parentd448329849bb2cef355cabfdc6cb4d8b5b76b80e (diff)
downloadrust-127a7d643d70dea605ca479c12a32f450d985b09.tar.gz
rust-127a7d643d70dea605ca479c12a32f450d985b09.zip
rename `only_has_type_or_fresh_var` to `coercion_target_type`
-rw-r--r--src/librustc_typeck/check/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 413d09117af..0a2cb94c591 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -314,7 +314,7 @@ impl<'a, 'gcx, 'tcx> Expectation<'tcx> {
 
     /// Like `only_has_type`, but instead of returning `None` if no
     /// hard constraint exists, creates a fresh type variable.
-    fn only_has_type_or_fresh_var(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, span: Span) -> Ty<'tcx> {
+    fn coercion_target_type(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, span: Span) -> Ty<'tcx> {
         self.only_has_type(fcx)
             .unwrap_or_else(|| fcx.next_ty_var(TypeVariableOrigin::MiscVariable(span)))
     }
@@ -2862,7 +2862,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
         // `expected` if it represents a *hard* constraint
         // (`only_has_type`); otherwise, we just go with a
         // fresh type variable.
-        let coerce_to_ty = expected.only_has_type_or_fresh_var(self, sp);
+        let coerce_to_ty = expected.coercion_target_type(self, sp);
         let mut coerce: DynamicCoerceMany = CoerceMany::new(coerce_to_ty);
 
         let if_cause = self.cause(sp, ObligationCauseCode::IfExpression);
@@ -3683,7 +3683,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
               let coerce = match source {
                   // you can only use break with a value from a normal `loop { }`
                   hir::LoopSource::Loop => {
-                      let coerce_to = expected.only_has_type_or_fresh_var(self, body.span);
+                      let coerce_to = expected.coercion_target_type(self, body.span);
                       Some(CoerceMany::new(coerce_to))
                   }