Skip to content

Commit 4fed659

Browse files
committed
---
yaml --- r: 273356 b: refs/heads/beta c: 00c9420 h: refs/heads/master
1 parent 0497454 commit 4fed659

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 1922041e7f69407e7fa40bf90e8ec47d49a97fd2
26+
refs/heads/beta: 00c942016033abb6dea1015c017bea5517af25a0
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/check/coercion.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
113113
}
114114

115115
/// Unify two types (using sub or lub) and produce a noop coercion.
116-
fn unify(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
116+
fn unify_and_identity(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
117117
let infcx = self.fcx.infcx();
118118
infcx.commit_if_ok(|_| {
119119
let trace = TypeTrace::types(self.origin, false, a, b);
@@ -187,7 +187,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
187187
}
188188
_ => {
189189
// Otherwise, just use unification rules.
190-
self.unify(a, b)
190+
self.unify_and_identity(a, b)
191191
}
192192
}
193193
}
@@ -219,7 +219,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
219219
try!(coerce_mutbls(mt_a.mutbl, mutbl_b));
220220
(r_a, mt_a.mutbl)
221221
}
222-
_ => return self.unify(a, b)
222+
_ => return self.unify_and_identity(a, b)
223223
};
224224

225225
let span = self.origin.span();
@@ -251,7 +251,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
251251
}
252252
let ty = self.tcx().mk_ref(r_borrow,
253253
TypeAndMut {ty: inner_ty, mutbl: mutbl_b});
254-
match self.unify(ty, b) {
254+
match self.unify_and_identity(ty, b) {
255255
Err(err) => {
256256
if first_error.is_none() {
257257
first_error = Some(err);
@@ -404,14 +404,14 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
404404
match (fn_ty_a.unsafety, fn_ty_b.unsafety) {
405405
(hir::Unsafety::Normal, hir::Unsafety::Unsafe) => {
406406
let unsafe_a = self.tcx().safe_to_unsafe_fn_ty(fn_ty_a);
407-
return self.unify(unsafe_a, b).map(|(ty, _)| {
407+
return self.unify_and_identity(unsafe_a, b).map(|(ty, _)| {
408408
(ty, AdjustUnsafeFnPointer)
409409
});
410410
}
411411
_ => {}
412412
}
413413
}
414-
self.unify(a, b)
414+
self.unify_and_identity(a, b)
415415
}
416416

417417
fn coerce_from_fn_item(&self,
@@ -430,11 +430,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
430430
match b.sty {
431431
ty::TyFnPtr(_) => {
432432
let a_fn_pointer = self.tcx().mk_ty(ty::TyFnPtr(fn_ty_a));
433-
self.unify(a_fn_pointer, b).map(|(ty, _)| {
433+
self.unify_and_identity(a_fn_pointer, b).map(|(ty, _)| {
434434
(ty, AdjustReifyFnPointer)
435435
})
436436
}
437-
_ => self.unify(a, b)
437+
_ => self.unify_and_identity(a, b)
438438
}
439439
}
440440

@@ -451,13 +451,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
451451
ty::TyRef(_, mt) => (true, mt),
452452
ty::TyRawPtr(mt) => (false, mt),
453453
_ => {
454-
return self.unify(a, b);
454+
return self.unify_and_identity(a, b);
455455
}
456456
};
457457

458458
// Check that the types which they point at are compatible.
459459
let a_unsafe = self.tcx().mk_ptr(ty::TypeAndMut{ mutbl: mutbl_b, ty: mt_a.ty });
460-
let (ty, noop) = try!(self.unify(a_unsafe, b));
460+
let (ty, noop) = try!(self.unify_and_identity(a_unsafe, b));
461461
try!(coerce_mutbls(mt_a.mutbl, mutbl_b));
462462

463463
// Although references and unsafe ptrs have the same

0 commit comments

Comments
 (0)