Rename structures in ast
This commit is contained in:
parent
f457b3d10a
commit
3bcb006fd9
23 changed files with 136 additions and 136 deletions
|
@ -21,8 +21,8 @@ use ast::EnumDef;
|
|||
use ast::{Expr, ExprKind, RangeLimits};
|
||||
use ast::{Field, FnDecl};
|
||||
use ast::{ForeignItem, ForeignItemKind, FunctionRetTy};
|
||||
use ast::{GenericParamAST, GenericParamKindAST};
|
||||
use ast::GenericArgAST;
|
||||
use ast::{GenericParam, GenericParamKind};
|
||||
use ast::GenericArg;
|
||||
use ast::{Ident, ImplItem, IsAuto, Item, ItemKind};
|
||||
use ast::{Label, Lifetime, Lit, LitKind};
|
||||
use ast::Local;
|
||||
|
@ -1246,7 +1246,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
/// parse a TyKind::BareFn type:
|
||||
fn parse_ty_bare_fn(&mut self, generic_params: Vec<GenericParamAST>) -> PResult<'a, TyKind> {
|
||||
fn parse_ty_bare_fn(&mut self, generic_params: Vec<GenericParam>) -> PResult<'a, TyKind> {
|
||||
/*
|
||||
|
||||
[unsafe] [extern "ABI"] fn (S) -> T
|
||||
|
@ -1563,7 +1563,7 @@ impl<'a> Parser<'a> {
|
|||
Ok(P(ty))
|
||||
}
|
||||
|
||||
fn parse_remaining_bounds(&mut self, generic_params: Vec<GenericParamAST>, path: ast::Path,
|
||||
fn parse_remaining_bounds(&mut self, generic_params: Vec<GenericParam>, path: ast::Path,
|
||||
lo: Span, parse_plus: bool) -> PResult<'a, TyKind> {
|
||||
let poly_trait_ref = PolyTraitRef::new(generic_params, path, lo.to(self.prev_span));
|
||||
let mut bounds = vec![TraitTyParamBound(poly_trait_ref, TraitBoundModifier::None)];
|
||||
|
@ -4805,7 +4805,7 @@ impl<'a> Parser<'a> {
|
|||
/// Matches typaram = IDENT (`?` unbound)? optbounds ( EQ ty )?
|
||||
fn parse_ty_param(&mut self,
|
||||
preceding_attrs: Vec<Attribute>)
|
||||
-> PResult<'a, GenericParamAST> {
|
||||
-> PResult<'a, GenericParam> {
|
||||
let ident = self.parse_ident()?;
|
||||
|
||||
// Parse optional colon and param bounds.
|
||||
|
@ -4821,11 +4821,11 @@ impl<'a> Parser<'a> {
|
|||
None
|
||||
};
|
||||
|
||||
Ok(GenericParamAST {
|
||||
Ok(GenericParam {
|
||||
ident,
|
||||
attrs: preceding_attrs.into(),
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
kind: GenericParamKindAST::Type {
|
||||
kind: GenericParamKind::Type {
|
||||
bounds,
|
||||
default,
|
||||
}
|
||||
|
@ -4859,7 +4859,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// Parses (possibly empty) list of lifetime and type parameters, possibly including
|
||||
/// trailing comma and erroneous trailing attributes.
|
||||
crate fn parse_generic_params(&mut self) -> PResult<'a, Vec<ast::GenericParamAST>> {
|
||||
crate fn parse_generic_params(&mut self) -> PResult<'a, Vec<ast::GenericParam>> {
|
||||
let mut params = Vec::new();
|
||||
let mut seen_ty_param = false;
|
||||
loop {
|
||||
|
@ -4872,11 +4872,11 @@ impl<'a> Parser<'a> {
|
|||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
params.push(ast::GenericParamAST {
|
||||
params.push(ast::GenericParam {
|
||||
ident: lifetime.ident,
|
||||
id: lifetime.id,
|
||||
attrs: attrs.into(),
|
||||
kind: ast::GenericParamKindAST::Lifetime {
|
||||
kind: ast::GenericParamKind::Lifetime {
|
||||
lifetime,
|
||||
bounds,
|
||||
}
|
||||
|
@ -4937,7 +4937,7 @@ impl<'a> Parser<'a> {
|
|||
/// Parses (possibly empty) list of lifetime and type arguments and associated type bindings,
|
||||
/// possibly including trailing comma.
|
||||
fn parse_generic_args(&mut self)
|
||||
-> PResult<'a, (Vec<GenericArgAST>, Vec<TypeBinding>)> {
|
||||
-> PResult<'a, (Vec<GenericArg>, Vec<TypeBinding>)> {
|
||||
let mut args = Vec::new();
|
||||
let mut bindings = Vec::new();
|
||||
let mut seen_type = false;
|
||||
|
@ -4945,7 +4945,7 @@ impl<'a> Parser<'a> {
|
|||
loop {
|
||||
if self.check_lifetime() && self.look_ahead(1, |t| !t.is_like_plus()) {
|
||||
// Parse lifetime argument.
|
||||
args.push(GenericArgAST::Lifetime(self.expect_lifetime()));
|
||||
args.push(GenericArg::Lifetime(self.expect_lifetime()));
|
||||
if seen_type || seen_binding {
|
||||
self.span_err(self.prev_span,
|
||||
"lifetime parameters must be declared prior to type parameters");
|
||||
|
@ -4970,7 +4970,7 @@ impl<'a> Parser<'a> {
|
|||
self.span_err(ty_param.span,
|
||||
"type parameters must be declared prior to associated type bindings");
|
||||
}
|
||||
args.push(GenericArgAST::Type(ty_param));
|
||||
args.push(GenericArg::Type(ty_param));
|
||||
seen_type = true;
|
||||
} else {
|
||||
break
|
||||
|
@ -5692,7 +5692,7 @@ impl<'a> Parser<'a> {
|
|||
Ok((keywords::Invalid.ident(), item_kind, Some(attrs)))
|
||||
}
|
||||
|
||||
fn parse_late_bound_lifetime_defs(&mut self) -> PResult<'a, Vec<GenericParamAST>> {
|
||||
fn parse_late_bound_lifetime_defs(&mut self) -> PResult<'a, Vec<GenericParam>> {
|
||||
if self.eat_keyword(keywords::For) {
|
||||
self.expect_lt()?;
|
||||
let params = self.parse_generic_params()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue