Preserve whether Receiver was shorthand for error reporting
diff --git a/syntax/impls.rs b/syntax/impls.rs
index 657fdb3..acc99ab 100644
--- a/syntax/impls.rs
+++ b/syntax/impls.rs
@@ -194,6 +194,7 @@
mutability,
var: _,
ty,
+ shorthand: _,
} = self;
let Receiver {
ampersand: _,
@@ -201,6 +202,7 @@
mutability: mutability2,
var: _,
ty: ty2,
+ shorthand: _,
} = other;
lifetime == lifetime2 && mutability.is_some() == mutability2.is_some() && ty == ty2
}
@@ -214,6 +216,7 @@
mutability,
var: _,
ty,
+ shorthand: _,
} = self;
lifetime.hash(state);
mutability.is_some().hash(state);
diff --git a/syntax/mod.rs b/syntax/mod.rs
index cf811cf..ab5cecc 100644
--- a/syntax/mod.rs
+++ b/syntax/mod.rs
@@ -80,6 +80,7 @@
pub mutability: Option<Token![mut]>,
pub var: Token![self],
pub ty: Ident,
+ pub shorthand: bool,
}
pub enum Type {
diff --git a/syntax/parse.rs b/syntax/parse.rs
index aed77d8..71e0c76 100644
--- a/syntax/parse.rs
+++ b/syntax/parse.rs
@@ -184,6 +184,7 @@
mutability: arg.mutability,
var: Token),
ty: ety.ident.clone(),
+ shorthand: true,
});
continue;
}
@@ -211,6 +212,7 @@
mutability: reference.mutability,
var: Token),
ty: ident,
+ shorthand: false,
});
continue;
}