@@ -117,6 +117,11 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
117
117
( & ExprPath ( ref lqself, ref lsubpath) , & ExprPath ( ref rqself, ref rsubpath) ) => {
118
118
both ( lqself, rqself, |l, r| self . eq_qself ( l, r) ) && self . eq_path ( lsubpath, rsubpath)
119
119
}
120
+ ( & ExprStruct ( ref lpath, ref lf, ref lo) , & ExprStruct ( ref rpath, ref rf, ref ro) ) => {
121
+ self . eq_path ( lpath, rpath) &&
122
+ both ( lo, ro, |l, r| self . eq_expr ( l, r) ) &&
123
+ over ( lf, rf, |l, r| self . eq_field ( l, r) )
124
+ }
120
125
( & ExprTup ( ref ltup) , & ExprTup ( ref rtup) ) => self . eq_exprs ( ltup, rtup) ,
121
126
( & ExprTupField ( ref le, li) , & ExprTupField ( ref re, ri) ) => li. node == ri. node && self . eq_expr ( le, re) ,
122
127
( & ExprUnary ( lop, ref le) , & ExprUnary ( rop, ref re) ) => lop == rop && self . eq_expr ( le, re) ,
@@ -132,6 +137,10 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
132
137
over ( left, right, |l, r| self . eq_expr ( l, r) )
133
138
}
134
139
140
+ fn eq_field ( & self , left : & Field , right : & Field ) -> bool {
141
+ left. name . node == right. name . node && self . eq_expr ( & left. expr , & right. expr )
142
+ }
143
+
135
144
/// Check whether two patterns are the same.
136
145
pub fn eq_pat ( & self , left : & Pat , right : & Pat ) -> bool {
137
146
match ( & left. node , & right. node ) {
0 commit comments