Skip to content

Commit 127a7d6

Browse files
committed
rename only_has_type_or_fresh_var to coercion_target_type
1 parent d448329 commit 127a7d6

File tree

1 file changed

+3
-3
lines changed
  • src/librustc_typeck/check

1 file changed

+3
-3
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl<'a, 'gcx, 'tcx> Expectation<'tcx> {
314314

315315
/// Like `only_has_type`, but instead of returning `None` if no
316316
/// hard constraint exists, creates a fresh type variable.
317-
fn only_has_type_or_fresh_var(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, span: Span) -> Ty<'tcx> {
317+
fn coercion_target_type(self, fcx: &FnCtxt<'a, 'gcx, 'tcx>, span: Span) -> Ty<'tcx> {
318318
self.only_has_type(fcx)
319319
.unwrap_or_else(|| fcx.next_ty_var(TypeVariableOrigin::MiscVariable(span)))
320320
}
@@ -2862,7 +2862,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
28622862
// `expected` if it represents a *hard* constraint
28632863
// (`only_has_type`); otherwise, we just go with a
28642864
// fresh type variable.
2865-
let coerce_to_ty = expected.only_has_type_or_fresh_var(self, sp);
2865+
let coerce_to_ty = expected.coercion_target_type(self, sp);
28662866
let mut coerce: DynamicCoerceMany = CoerceMany::new(coerce_to_ty);
28672867

28682868
let if_cause = self.cause(sp, ObligationCauseCode::IfExpression);
@@ -3683,7 +3683,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
36833683
let coerce = match source {
36843684
// you can only use break with a value from a normal `loop { }`
36853685
hir::LoopSource::Loop => {
3686-
let coerce_to = expected.only_has_type_or_fresh_var(self, body.span);
3686+
let coerce_to = expected.coercion_target_type(self, body.span);
36873687
Some(CoerceMany::new(coerce_to))
36883688
}
36893689

0 commit comments

Comments
 (0)