File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/librustc_borrowck/borrowck Expand file tree Collapse file tree 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};
4141use std:: fmt;
4242use std:: mem;
4343use std:: rc:: Rc ;
44+ use std:: hash:: { Hash , Hasher } ;
4445use syntax:: ast;
4546use syntax:: attr:: AttrMetaMethods ;
4647use syntax_pos:: { MultiSpan , Span } ;
@@ -345,18 +346,21 @@ impl<'tcx> Loan<'tcx> {
345346 }
346347}
347348
348- #[ derive( Eq , Hash ) ]
349+ #[ derive( Eq ) ]
349350pub struct LoanPath < ' tcx > {
350351 kind : LoanPathKind < ' tcx > ,
351352 ty : ty:: Ty < ' tcx > ,
352353}
353354
354355impl < ' tcx > PartialEq for LoanPath < ' tcx > {
355356 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) ;
360364 }
361365}
362366
You can’t perform that action at this time.
0 commit comments