Resolve field, struct and function renaming

Addresses the errors produced by (re)moving, merging or renaming
structs, fields and methods by rust-lang/rust#48149 and rust-lang/rust#51580
This commit is contained in:
flip1995
2018-06-24 15:32:40 +02:00
parent 5f5fa084ec
commit d9a80d2f84
22 changed files with 106 additions and 94 deletions

View File

@@ -76,7 +76,7 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
match (&left.node, &right.node) {
(&ExprAddrOf(l_mut, ref le), &ExprAddrOf(r_mut, ref re)) => l_mut == r_mut && self.eq_expr(le, re),
(&ExprAgain(li), &ExprAgain(ri)) => {
(&ExprContinue(li), &ExprContinue(ri)) => {
both(&li.label, &ri.label, |l, r| l.name.as_str() == r.name.as_str())
},
(&ExprAssign(ref ll, ref lr), &ExprAssign(ref rl, ref rr)) => self.eq_expr(ll, rl) && self.eq_expr(lr, rr),
@@ -201,7 +201,7 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
&& over(&left.segments, &right.segments, |l, r| self.eq_path_segment(l, r))
}
fn eq_path_parameters(&mut self, left: &PathParameters, right: &PathParameters) -> bool {
fn eq_path_parameters(&mut self, left: &GenericArgs, right: &GenericArgs) -> bool {
if !(left.parenthesized || right.parenthesized) {
over(&left.lifetimes, &right.lifetimes, |l, r| self.eq_lifetime(l, r))
&& over(&left.types, &right.types, |l, r| self.eq_ty(l, r))
@@ -224,7 +224,7 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
if left.name.as_str() != right.name.as_str() {
return false;
}
match (&left.parameters, &right.parameters) {
match (&left.args, &right.args) {
(&None, &None) => true,
(&Some(ref l), &Some(ref r)) => self.eq_path_parameters(l, r),
_ => false,
@@ -345,8 +345,8 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
m.hash(&mut self.s);
self.hash_expr(e);
},
ExprAgain(i) => {
let c: fn(_) -> _ = ExprAgain;
ExprContinue(i) => {
let c: fn(_) -> _ = ExprContinue;
c.hash(&mut self.s);
if let Some(i) = i.label {
self.hash_name(i.name);