ast: Fix naming conventions in AST structures
TraitKind -> Trait TyAliasKind -> TyAlias ImplKind -> Impl FnKind -> Fn All `*Kind`s in AST are supposed to be enums. Tuple structs are converted to braced structs for the types above, and fields are reordered in syntactic order. Also, mutable AST visitor now correctly visit spans in defaultness, unsafety, impl polarity and constness.
This commit is contained in:
parent
90a273b785
commit
2834f57c45
28 changed files with 429 additions and 292 deletions
|
@ -313,13 +313,13 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> {
|
|||
|
||||
let decl = ecx.fn_decl(vec![], ast::FnRetTy::Ty(main_ret_ty));
|
||||
let sig = ast::FnSig { decl, header: ast::FnHeader::default(), span: sp };
|
||||
let def = ast::Defaultness::Final;
|
||||
let main = ast::ItemKind::Fn(Box::new(ast::FnKind(
|
||||
def,
|
||||
let defaultness = ast::Defaultness::Final;
|
||||
let main = ast::ItemKind::Fn(Box::new(ast::Fn {
|
||||
defaultness,
|
||||
sig,
|
||||
ast::Generics::default(),
|
||||
Some(main_body),
|
||||
)));
|
||||
generics: ast::Generics::default(),
|
||||
body: Some(main_body),
|
||||
}));
|
||||
|
||||
// Honor the reexport_test_harness_main attribute
|
||||
let main_id = match cx.reexport_test_harness_main {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue