diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/make.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 0ff69bc2d..509e8ae7a 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -64,18 +64,18 @@ pub fn use_item(use_tree: ast::UseTree) -> ast::Use { | |||
64 | ast_from_text(&format!("use {};", use_tree)) | 64 | ast_from_text(&format!("use {};", use_tree)) |
65 | } | 65 | } |
66 | 66 | ||
67 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { | 67 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordExprField { |
68 | return match expr { | 68 | return match expr { |
69 | Some(expr) => from_text(&format!("{}: {}", name, expr)), | 69 | Some(expr) => from_text(&format!("{}: {}", name, expr)), |
70 | None => from_text(&name.to_string()), | 70 | None => from_text(&name.to_string()), |
71 | }; | 71 | }; |
72 | 72 | ||
73 | fn from_text(text: &str) -> ast::RecordField { | 73 | fn from_text(text: &str) -> ast::RecordExprField { |
74 | ast_from_text(&format!("fn f() {{ S {{ {}, }} }}", text)) | 74 | ast_from_text(&format!("fn f() {{ S {{ {}, }} }}", text)) |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | pub fn record_field_def(name: ast::NameRef, ty: ast::TypeRef) -> ast::RecordFieldDef { | 78 | pub fn record_field_def(name: ast::NameRef, ty: ast::TypeRef) -> ast::RecordField { |
79 | ast_from_text(&format!("struct S {{ {}: {}, }}", name, ty)) | 79 | ast_from_text(&format!("struct S {{ {}: {}, }}", name, ty)) |
80 | } | 80 | } |
81 | 81 | ||
@@ -291,10 +291,10 @@ pub fn visibility_pub_crate() -> ast::Visibility { | |||
291 | pub fn fn_def( | 291 | pub fn fn_def( |
292 | visibility: Option<ast::Visibility>, | 292 | visibility: Option<ast::Visibility>, |
293 | fn_name: ast::Name, | 293 | fn_name: ast::Name, |
294 | type_params: Option<ast::TypeParamList>, | 294 | type_params: Option<ast::GenericParamList>, |
295 | params: ast::ParamList, | 295 | params: ast::ParamList, |
296 | body: ast::BlockExpr, | 296 | body: ast::BlockExpr, |
297 | ) -> ast::FnDef { | 297 | ) -> ast::Fn { |
298 | let type_params = | 298 | let type_params = |
299 | if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() }; | 299 | if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() }; |
300 | let visibility = match visibility { | 300 | let visibility = match visibility { |