[breaking-change] don't pub export ast::Ty_ variants
This commit is contained in:
@@ -367,7 +367,7 @@ impl DummyResult {
|
||||
pub fn raw_ty(sp: Span) -> P<ast::Ty> {
|
||||
P(ast::Ty {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
node: ast::TyInfer,
|
||||
node: ast::TyKind::Infer,
|
||||
span: sp
|
||||
})
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ pub trait AstBuilder {
|
||||
// types
|
||||
fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy;
|
||||
|
||||
fn ty(&self, span: Span, ty: ast::Ty_) -> P<ast::Ty>;
|
||||
fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty>;
|
||||
fn ty_path(&self, ast::Path) -> P<ast::Ty>;
|
||||
fn ty_sum(&self, ast::Path, ast::TyParamBounds) -> P<ast::Ty>;
|
||||
fn ty_ident(&self, span: Span, idents: ast::Ident) -> P<ast::Ty>;
|
||||
@@ -385,7 +385,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn ty(&self, span: Span, ty: ast::Ty_) -> P<ast::Ty> {
|
||||
fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> {
|
||||
P(ast::Ty {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
span: span,
|
||||
@@ -394,12 +394,12 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||
}
|
||||
|
||||
fn ty_path(&self, path: ast::Path) -> P<ast::Ty> {
|
||||
self.ty(path.span, ast::TyPath(None, path))
|
||||
self.ty(path.span, ast::TyKind::Path(None, path))
|
||||
}
|
||||
|
||||
fn ty_sum(&self, path: ast::Path, bounds: ast::TyParamBounds) -> P<ast::Ty> {
|
||||
self.ty(path.span,
|
||||
ast::TyObjectSum(self.ty_path(path),
|
||||
ast::TyKind::ObjectSum(self.ty_path(path),
|
||||
bounds))
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||
mutbl: ast::Mutability)
|
||||
-> P<ast::Ty> {
|
||||
self.ty(span,
|
||||
ast::TyRptr(lifetime, self.ty_mt(ty, mutbl)))
|
||||
ast::TyKind::Rptr(lifetime, self.ty_mt(ty, mutbl)))
|
||||
}
|
||||
|
||||
fn ty_ptr(&self,
|
||||
@@ -426,7 +426,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||
mutbl: ast::Mutability)
|
||||
-> P<ast::Ty> {
|
||||
self.ty(span,
|
||||
ast::TyPtr(self.ty_mt(ty, mutbl)))
|
||||
ast::TyKind::Ptr(self.ty_mt(ty, mutbl)))
|
||||
}
|
||||
|
||||
fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty> {
|
||||
@@ -440,7 +440,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||
}
|
||||
|
||||
fn ty_infer(&self, span: Span) -> P<ast::Ty> {
|
||||
self.ty(span, ast::TyInfer)
|
||||
self.ty(span, ast::TyKind::Infer)
|
||||
}
|
||||
|
||||
fn typaram(&self,
|
||||
|
||||
@@ -562,7 +562,7 @@ fn expand_non_macro_stmt(Spanned {node, span: stmt_span}: Stmt, fld: &mut MacroE
|
||||
DeclKind::Local(local) => {
|
||||
// take it apart:
|
||||
let rewritten_local = local.map(|Local {id, pat, ty, init, span, attrs}| {
|
||||
// expand the ty since TyFixedLengthVec contains an Expr
|
||||
// expand the ty since TyKind::FixedLengthVec contains an Expr
|
||||
// and thus may have a macro use
|
||||
let expanded_ty = ty.map(|t| fld.fold_ty(t));
|
||||
// expand the pat (it might contain macro uses):
|
||||
@@ -1133,7 +1133,7 @@ fn expand_and_rename_method(sig: ast::MethodSig, body: P<ast::Block>,
|
||||
|
||||
pub fn expand_type(t: P<ast::Ty>, fld: &mut MacroExpander) -> P<ast::Ty> {
|
||||
let t = match t.node.clone() {
|
||||
ast::Ty_::TyMac(mac) => {
|
||||
ast::TyKind::Mac(mac) => {
|
||||
if fld.cx.ecfg.features.unwrap().type_macros {
|
||||
let expanded_ty = match expand_mac_invoc(mac, t.span,
|
||||
|r| r.make_ty(),
|
||||
|
||||
Reference in New Issue
Block a user