Box ExprKind::{Closure,MethodCall}
, and QSelf
in expressions, types, and patterns.
This commit is contained in:
parent
bebd57a960
commit
6b7ca2fcf2
37 changed files with 409 additions and 318 deletions
|
@ -65,7 +65,7 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
|
|||
pub(super) trait RecoverQPath: Sized + 'static {
|
||||
const PATH_STYLE: PathStyle = PathStyle::Expr;
|
||||
fn to_ty(&self) -> Option<P<Ty>>;
|
||||
fn recovered(qself: Option<QSelf>, path: ast::Path) -> Self;
|
||||
fn recovered(qself: Option<P<QSelf>>, path: ast::Path) -> Self;
|
||||
}
|
||||
|
||||
impl RecoverQPath for Ty {
|
||||
|
@ -73,7 +73,7 @@ impl RecoverQPath for Ty {
|
|||
fn to_ty(&self) -> Option<P<Ty>> {
|
||||
Some(P(self.clone()))
|
||||
}
|
||||
fn recovered(qself: Option<QSelf>, path: ast::Path) -> Self {
|
||||
fn recovered(qself: Option<P<QSelf>>, path: ast::Path) -> Self {
|
||||
Self {
|
||||
span: path.span,
|
||||
kind: TyKind::Path(qself, path),
|
||||
|
@ -87,7 +87,7 @@ impl RecoverQPath for Pat {
|
|||
fn to_ty(&self) -> Option<P<Ty>> {
|
||||
self.to_ty()
|
||||
}
|
||||
fn recovered(qself: Option<QSelf>, path: ast::Path) -> Self {
|
||||
fn recovered(qself: Option<P<QSelf>>, path: ast::Path) -> Self {
|
||||
Self {
|
||||
span: path.span,
|
||||
kind: PatKind::Path(qself, path),
|
||||
|
@ -101,7 +101,7 @@ impl RecoverQPath for Expr {
|
|||
fn to_ty(&self) -> Option<P<Ty>> {
|
||||
self.to_ty()
|
||||
}
|
||||
fn recovered(qself: Option<QSelf>, path: ast::Path) -> Self {
|
||||
fn recovered(qself: Option<P<QSelf>>, path: ast::Path) -> Self {
|
||||
Self {
|
||||
span: path.span,
|
||||
kind: ExprKind::Path(qself, path),
|
||||
|
@ -1437,7 +1437,7 @@ impl<'a> Parser<'a> {
|
|||
});
|
||||
|
||||
let path_span = ty_span.shrink_to_hi(); // Use an empty path since `position == 0`.
|
||||
Ok(P(T::recovered(Some(QSelf { ty, path_span, position: 0 }), path)))
|
||||
Ok(P(T::recovered(Some(P(QSelf { ty, path_span, position: 0 })), path)))
|
||||
}
|
||||
|
||||
pub fn maybe_consume_incorrect_semicolon(&mut self, items: &[P<Item>]) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue