File tree 1 file changed +9
-5
lines changed
src/librustc_borrowck/borrowck
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ use rustc::ty::{self, TyCtxt};
41
41
use std:: fmt;
42
42
use std:: mem;
43
43
use std:: rc:: Rc ;
44
+ use std:: hash:: { Hash , Hasher } ;
44
45
use syntax:: ast;
45
46
use syntax:: attr:: AttrMetaMethods ;
46
47
use syntax_pos:: { MultiSpan , Span } ;
@@ -345,18 +346,21 @@ impl<'tcx> Loan<'tcx> {
345
346
}
346
347
}
347
348
348
- #[ derive( Eq , Hash ) ]
349
+ #[ derive( Eq ) ]
349
350
pub struct LoanPath < ' tcx > {
350
351
kind : LoanPathKind < ' tcx > ,
351
352
ty : ty:: Ty < ' tcx > ,
352
353
}
353
354
354
355
impl < ' tcx > PartialEq for LoanPath < ' tcx > {
355
356
fn eq ( & self , that : & LoanPath < ' tcx > ) -> bool {
356
- let r = self . kind == that. kind ;
357
- debug_assert ! ( self . ty == that. ty || !r,
358
- "Somehow loan paths are equal though their tys are not." ) ;
359
- r
357
+ self . kind == that. kind
358
+ }
359
+ }
360
+
361
+ impl < ' tcx > Hash for LoanPath < ' tcx > {
362
+ fn hash < H : Hasher > ( & self , state : & mut H ) {
363
+ self . kind . hash ( state) ;
360
364
}
361
365
}
362
366
You can’t perform that action at this time.
0 commit comments