Skip to content

Commit 5e7205f

Browse files
committed
---
yaml --- r: 160863 b: refs/heads/auto c: 6f7cb8c h: refs/heads/master i: 160861: ab44f82 160859: a846cbe 160855: 4485fa2 160847: 497604a 160831: 2c10440 v: v3
1 parent 0f410e8 commit 5e7205f

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1217b829e85ec4720ba9a1c43c173d4015eae651
13+
refs/heads/auto: 6f7cb8c6185878d6e4ad0cf354652158a73c0b72
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/borrowck/mod.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,33 @@ impl<'tcx> Loan<'tcx> {
282282
}
283283
}
284284

285-
#[deriving(PartialEq, Eq, Hash, Show)]
285+
#[deriving(Eq, Hash, Show)]
286286
pub struct LoanPath<'tcx> {
287287
kind: LoanPathKind<'tcx>,
288288
ty: ty::Ty<'tcx>,
289289
}
290290

291+
impl<'tcx> LoanPath<'tcx> {
292+
pub fn eq_debug(&self, that: &LoanPath<'tcx>, tcx: &ty::ctxt<'tcx>) -> bool {
293+
let r = self.kind == that.kind;
294+
if r && self.ty != that.ty {
295+
panic!("eq variants ineq types: {} == {}, {} != {}",
296+
self.repr(tcx), that.repr(tcx),
297+
self.ty.repr(tcx), that.ty.repr(tcx));
298+
}
299+
r
300+
}
301+
}
302+
303+
impl<'tcx> PartialEq for LoanPath<'tcx> {
304+
fn eq(&self, that: &LoanPath<'tcx>) -> bool {
305+
let r = self.kind == that.kind;
306+
debug_assert!(self.ty == that.ty || !r,
307+
"Somehow loan paths are equal though their tys are not.");
308+
r
309+
}
310+
}
311+
291312
#[deriving(PartialEq, Eq, Hash, Show)]
292313
pub enum LoanPathKind<'tcx> {
293314
LpVar(ast::NodeId), // `x` in doc.rs

0 commit comments

Comments
 (0)