aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 14:26:15 +0100
committerGitHub <[email protected]>2020-07-30 14:26:15 +0100
commitee00679331b87dacc5fe608f153be160c1cb144c (patch)
treef80ef7823490a6904b3f7bf57a4609ca4c4743dc
parent96c3ff1c573f97e5089fc0ba01ede6fe43693668 (diff)
parenteb2f8063444b11257111f4f8ade990ec810e0361 (diff)
Merge #5591
5591: Rename TypeAliasDef -> TypeAlias r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/ra_assists/src/handlers/add_missing_impl_members.rs20
-rw-r--r--crates/ra_assists/src/handlers/change_return_type_to_result.rs2
-rw-r--r--crates/ra_assists/src/handlers/change_visibility.rs6
-rw-r--r--crates/ra_assists/src/handlers/early_return.rs4
-rw-r--r--crates/ra_assists/src/handlers/generate_function.rs2
-rw-r--r--crates/ra_assists/src/handlers/generate_new.rs2
-rw-r--r--crates/ra_assists/src/handlers/introduce_named_lifetime.rs4
-rw-r--r--crates/ra_assists/src/handlers/move_bounds.rs2
-rw-r--r--crates/ra_assists/src/utils.rs4
-rw-r--r--crates/ra_hir/src/has_source.rs8
-rw-r--r--crates/ra_hir/src/semantics.rs4
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs17
-rw-r--r--crates/ra_hir_def/src/body/lower.rs4
-rw-r--r--crates/ra_hir_def/src/item_tree.rs8
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs18
-rw-r--r--crates/ra_hir_def/src/item_tree/tests.rs26
-rw-r--r--crates/ra_hir_def/src/keys.rs4
-rw-r--r--crates/ra_hir_ty/src/tests.rs2
-rw-r--r--crates/ra_ide/src/call_hierarchy.rs54
-rw-r--r--crates/ra_ide/src/completion/complete_fn_param.rs10
-rw-r--r--crates/ra_ide/src/completion/complete_keyword.rs2
-rw-r--r--crates/ra_ide/src/completion/complete_trait_impl.rs10
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs4
-rw-r--r--crates/ra_ide/src/completion/patterns.rs2
-rw-r--r--crates/ra_ide/src/display.rs4
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs8
-rw-r--r--crates/ra_ide/src/display/short_label.rs4
-rw-r--r--crates/ra_ide/src/file_structure.rs16
-rw-r--r--crates/ra_ide/src/hover.rs2
-rw-r--r--crates/ra_ide/src/references.rs10
-rw-r--r--crates/ra_ide/src/references/rename.rs4
-rw-r--r--crates/ra_ide/src/runnables.rs40
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs6
-rw-r--r--crates/ra_ide/src/syntax_tree.rs14
-rw-r--r--crates/ra_ide_db/src/defs.rs4
-rw-r--r--crates/ra_ide_db/src/symbol_index.rs6
-rw-r--r--crates/ra_mbe/src/tests.rs2
-rw-r--r--crates/ra_parser/src/grammar/items.rs4
-rw-r--r--crates/ra_parser/src/syntax_kind/generated.rs4
-rw-r--r--crates/ra_syntax/src/ast/edit.rs8
-rw-r--r--crates/ra_syntax/src/ast/expr_ext.rs2
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs505
-rw-r--r--crates/ra_syntax/src/ast/make.rs2
-rw-r--r--crates/ra_syntax/src/ast/node_ext.rs4
-rw-r--r--crates/ra_syntax/src/lib.rs6
-rw-r--r--crates/ra_syntax/src/parsing/text_tree_sink.rs2
-rw-r--r--crates/ra_syntax/src/validation.rs4
-rw-r--r--crates/ra_syntax/src/validation/block.rs2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/err/0019_let_recover.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/err/0025_nope.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0029_field_completion.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0035_use_recover.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast10
-rw-r--r--crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast10
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0161_labeled_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0162_unsafe_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0012_visibility.rast10
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0030_traits.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0031_extern.rast24
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0032_where_for.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0033_label_break.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast38
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0049_async_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast26
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0060_as_range.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast10
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast6
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast12
-rw-r--r--crates/rust-analyzer/src/handlers.rs2
-rw-r--r--crates/rust-analyzer/src/to_proto.rs4
-rw-r--r--docs/dev/syntax.md4
-rw-r--r--xtask/src/ast_src.rs4
-rw-r--r--xtask/src/codegen/gen_syntax.rs7
-rw-r--r--xtask/src/codegen/rust.ungram58
272 files changed, 822 insertions, 823 deletions
<
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
index a2d9006e4..1e4d4748c 100644
--- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
@@ -118,8 +118,8 @@ fn add_missing_impl_members_inner(
118 118
119 let def_name = |item: &ast::AssocItem| -> Option<SmolStr> { 119 let def_name = |item: &ast::AssocItem| -> Option<SmolStr> {
120 match item { 120 match item {
121 ast::AssocItem::FnDef(def) => def.name(), 121 ast::AssocItem::Fn(def) => def.name(),
122 ast::AssocItem::TypeAliasDef(def) => def.name(), 122 ast::AssocItem::TypeAlias(def) => def.name(),
123 ast::AssocItem::ConstDef(def) => def.name(), 123 ast::AssocItem::ConstDef(def) => def.name(),
124 ast::AssocItem::MacroCall(_) => None, 124 ast::AssocItem::MacroCall(_) => None,
125 } 125 }
@@ -129,13 +129,13 @@ fn add_missing_impl_members_inner(
129 let missing_items = get_missing_assoc_items(&ctx.sema, &impl_def) 129 let missing_items = get_missing_assoc_items(&ctx.sema, &impl_def)
130 .iter() 130 .iter()
131 .map(|i| match i { 131 .map(|i| match i {
132 hir::AssocItem::Function(i) => ast::AssocItem::FnDef(i.source(ctx.db()).value), 132 hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source(ctx.db()).value),
133 hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAliasDef(i.source(ctx.db()).value), 133 hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAlias(i.source(ctx.db()).value),
134 hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value), 134 hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value),
135 }) 135 })
136 .filter(|t| def_name(&t).is_some()) 136 .filter(|t| def_name(&t).is_some())
137 .filter(|t| match t { 137 .filter(|t| match t {
138 ast::AssocItem::FnDef(def) => match mode { 138 ast::AssocItem::Fn(def) => match mode {
139 AddMissingImplMembersMode::DefaultMethodsOnly => def.body().is_some(), 139 AddMissingImplMembersMode::DefaultMethodsOnly => def.body().is_some(),
140 AddMissingImplMembersMode::NoDefaultMethods => def.body().is_none(), 140 AddMissingImplMembersMode::NoDefaultMethods => def.body().is_none(),
141 }, 141 },
@@ -158,10 +158,8 @@ fn add_missing_impl_members_inner(
158 .into_iter() 158 .into_iter()
159 .map(|it| ast_transform::apply(&*ast_transform, it)) 159 .map(|it| ast_transform::apply(&*ast_transform, it))
160 .map(|it| match it { 160 .map(|it| match it {
161 ast::AssocItem::FnDef(def) => ast::AssocItem::FnDef(add_body(def)), 161 ast::AssocItem::Fn(def) => ast::AssocItem::Fn(add_body(def)),
162 ast::AssocItem::TypeAliasDef(def) => { 162 ast::AssocItem::TypeAlias(def) => ast::AssocItem::TypeAlias(def.remove_bounds()),
163 ast::AssocItem::TypeAliasDef(def.remove_bounds())
164 }
165 _ => it, 163 _ => it,
166 }) 164 })
167 .map(|it| edit::remove_attrs_and_docs(&it)); 165 .map(|it| edit::remove_attrs_and_docs(&it));
@@ -174,7 +172,7 @@ fn add_missing_impl_members_inner(
174 Some(cap) => { 172 Some(cap) => {
175 let mut cursor = Cursor::Before(first_new_item.syntax()); 173 let mut cursor = Cursor::Before(first_new_item.syntax());
176 let placeholder; 174 let placeholder;
177 if let ast::AssocItem::FnDef(func) = &first_new_item { 175 if let ast::AssocItem::Fn(func) = &first_new_item {
178 if let Some(m) = func.syntax().descendants().find_map(ast::MacroCall::cast) { 176 if let Some(m) = func.syntax().descendants().find_map(ast::MacroCall::cast) {
179 if m.syntax().text() == "todo!()" { 177 if m.syntax().text() == "todo!()" {
180 placeholder = m; 178 placeholder = m;
@@ -192,7 +190,7 @@ fn add_missing_impl_members_inner(
192 }) 190 })
193} 191}
194 192
195fn add_body(fn_def: ast::FnDef) -> ast::FnDef { 193fn add_body(fn_def: ast::Fn) -> ast::Fn {
196 if fn_def.body().is_some() { 194 if fn_def.body().is_some() {
197 return fn_def; 195 return fn_def;
198 } 196 }
diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs
index def00f7d8..52e24af6c 100644
--- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs
+++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs
@@ -20,7 +20,7 @@ use test_utils::mark;
20pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { 20pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
21 let ret_type = ctx.find_node_at_offset::<ast::RetType>()?; 21 let ret_type = ctx.find_node_at_offset::<ast::RetType>()?;
22 // FIXME: extend to lambdas as well 22 // FIXME: extend to lambdas as well
23 let fn_def = ret_type.syntax().parent().and_then(ast::FnDef::cast)?; 23 let fn_def = ret_type.syntax().parent().and_then(ast::Fn::cast)?;
24 24
25 let type_ref = &ret_type.type_ref()?; 25 let type_ref = &ret_type.type_ref()?;
26 let ret_type_str = type_ref.syntax().text().to_string(); 26 let ret_type_str = type_ref.syntax().text().to_string();
diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs
index 4343b423c..c3e1f2803 100644
--- a/crates/ra_assists/src/handlers/change_visibility.rs
+++ b/crates/ra_assists/src/handlers/change_visibility.rs
@@ -1,9 +1,7 @@
1use ra_syntax::{ 1use ra_syntax::{
2 ast::{self, NameOwner, VisibilityOwner}, 2 ast::{self, NameOwner, VisibilityOwner},
3 AstNode, 3 AstNode,
4 SyntaxKind::{ 4 SyntaxKind::{CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY},
5 CONST_DEF, ENUM_DEF, FN_DEF, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY,
6 },
7 T, 5 T,
8}; 6};
9use test_utils::mark; 7use test_utils::mark;
@@ -38,7 +36,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
38 36
39 let (offset, target) = if let Some(keyword) = item_keyword { 37 let (offset, target) = if let Some(keyword) = item_keyword {
40 let parent = keyword.parent(); 38 let parent = keyword.parent();
41 let def_kws = vec![CONST_DEF, STATIC_DEF, FN_DEF, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; 39 let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF];
42 // Parent is not a definition, can't add visibility 40 // Parent is not a definition, can't add visibility
43 if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { 41 if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) {
44 return None; 42 return None;
diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs
index 330459f3c..3650289fd 100644
--- a/crates/ra_assists/src/handlers/early_return.rs
+++ b/crates/ra_assists/src/handlers/early_return.rs
@@ -8,7 +8,7 @@ use ra_syntax::{
8 make, 8 make,
9 }, 9 },
10 AstNode, 10 AstNode,
11 SyntaxKind::{FN_DEF, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE}, 11 SyntaxKind::{FN, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE},
12 SyntaxNode, 12 SyntaxNode,
13}; 13};
14 14
@@ -88,7 +88,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
88 88
89 let early_expression: ast::Expr = match parent_container.kind() { 89 let early_expression: ast::Expr = match parent_container.kind() {
90 WHILE_EXPR | LOOP_EXPR => make::expr_continue(), 90 WHILE_EXPR | LOOP_EXPR => make::expr_continue(),
91 FN_DEF => make::expr_return(), 91 FN => make::expr_return(),
92 _ => return None, 92 _ => return None,
93 }; 93 };
94 94
diff --git a/crates/ra_assists/src/handlers/generate_function.rs b/crates/ra_assists/src/handlers/generate_function.rs
index b721b96bb..006d0ffb2 100644
--- a/crates/ra_assists/src/handlers/generate_function.rs
+++ b/crates/ra_assists/src/handlers/generate_function.rs
@@ -82,7 +82,7 @@ struct FunctionTemplate {
82 insert_offset: TextSize, 82 insert_offset: TextSize,
83 placeholder_expr: ast::MacroCall, 83 placeholder_expr: ast::MacroCall,
84 leading_ws: String, 84 leading_ws: String,
85 fn_def: ast::FnDef, 85 fn_def: ast::Fn,
86 trailing_ws: String, 86 trailing_ws: String,
87 file: FileId, 87 file: FileId,
88} 88}
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs
index 25bc171bf..4dff0ae4d 100644
--- a/crates/ra_assists/src/handlers/generate_new.rs
+++ b/crates/ra_assists/src/handlers/generate_new.rs
@@ -160,7 +160,7 @@ fn find_struct_impl(ctx: &AssistContext, strukt: &ast::StructDef) -> Option<Opti
160fn has_new_fn(imp: &ast::ImplDef) -> bool { 160fn has_new_fn(imp: &ast::ImplDef) -> bool {
161 if let Some(il) = imp.assoc_item_list() { 161 if let Some(il) = imp.assoc_item_list() {
162 for item in il.assoc_items() { 162 for item in il.assoc_items() {
163 if let ast::AssocItem::FnDef(f) = item { 163 if let ast::AssocItem::Fn(f) = item {
164 if let Some(name) = f.name() { 164 if let Some(name) = f.name() {
165 if name.text().eq_ignore_ascii_case("new") { 165 if name.text().eq_ignore_ascii_case("new") {
166 return true; 166 return true;
diff --git a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs
index 967593031..f3774fab1 100644
--- a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs
+++ b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs
@@ -38,7 +38,7 @@ pub(crate) fn introduce_named_lifetime(acc: &mut Assists, ctx: &AssistContext) -
38 let lifetime_token = ctx 38 let lifetime_token = ctx
39 .find_token_at_offset(SyntaxKind::LIFETIME) 39 .find_token_at_offset(SyntaxKind::LIFETIME)
40 .filter(|lifetime| lifetime.text() == "'_")?; 40 .filter(|lifetime| lifetime.text() == "'_")?;
41 if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::FnDef::cast) { 41 if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::Fn::cast) {
42 generate_fn_def_assist(acc, &fn_def, lifetime_token.text_range()) 42 generate_fn_def_assist(acc, &fn_def, lifetime_token.text_range())
43 } else if let Some(impl_def) = lifetime_token.ancestors().find_map(ast::ImplDef::cast) { 43 } else if let Some(impl_def) = lifetime_token.ancestors().find_map(ast::ImplDef::cast) {
44 generate_impl_def_assist(acc, &impl_def, lifetime_token.text_range()) 44 generate_impl_def_assist(acc, &impl_def, lifetime_token.text_range())
@@ -50,7 +50,7 @@ pub(crate) fn introduce_named_lifetime(acc: &mut Assists, ctx: &AssistContext) -
50/// Generate the assist for the fn def case 50/// Generate the assist for the fn def case
51fn generate_fn_def_assist( 51fn generate_fn_def_assist(
52 acc: &mut Assists, 52 acc: &mut Assists,
53 fn_def: &ast::FnDef, 53 fn_def: &ast::Fn,
54 lifetime_loc: TextRange, 54 lifetime_loc: TextRange,
55) -> Option<()> { 55) -> Option<()> {
56 let param_list: ast::ParamList = fn_def.param_list()?; 56 let param_list: ast::ParamList = fn_def.param_list()?;
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs
index 6b73fff44..dae6198ed 100644
--- a/crates/ra_assists/src/handlers/move_bounds.rs
+++ b/crates/ra_assists/src/handlers/move_bounds.rs
@@ -37,7 +37,7 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext
37 37
38 let anchor = match_ast! { 38 let anchor = match_ast! {
39 match parent { 39 match parent {
40 ast::FnDef(it) => it.body()?.syntax().clone().into(), 40 ast::Fn(it) => it.body()?.syntax().clone().into(),
41 ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), 41 ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(),
42 ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), 42 ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(),
43 ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), 43 ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(),
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs
index 27c33df23..748be011b 100644
--- a/crates/ra_assists/src/utils.rs
+++ b/crates/ra_assists/src/utils.rs
@@ -66,13 +66,13 @@ pub fn get_missing_assoc_items(
66 if let Some(item_list) = impl_def.assoc_item_list() { 66 if let Some(item_list) = impl_def.assoc_item_list() {
67 for item in item_list.assoc_items() { 67 for item in item_list.assoc_items() {
68 match item { 68 match item {
69 ast::AssocItem::FnDef(f) => { 69 ast::AssocItem::Fn(f) => {
70 if let Some(n) = f.name() { 70 if let Some(n) = f.name() {
71 impl_fns_consts.insert(n.syntax().to_string()); 71 impl_fns_consts.insert(n.syntax().to_string());
72 } 72 }
73 } 73 }
74 74
75 ast::AssocItem::TypeAliasDef(t) => { 75 ast::AssocItem::TypeAlias(t) => {
76 if let Some(n) = t.name() { 76 if let Some(n) = t.name() {
77 impl_type.insert(n.syntax().to_string()); 77 impl_type.insert(n.syntax().to_string());
78 } 78 }
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs
index 76c32fc17..1557b7c83 100644
--- a/crates/ra_hir/src/has_source.rs
+++ b/crates/ra_hir/src/has_source.rs
@@ -81,8 +81,8 @@ impl HasSource for EnumVariant {
81 } 81 }
82} 82}
83impl HasSource for Function { 83impl HasSource for Function {
84 type Ast = ast::FnDef; 84 type Ast = ast::Fn;
85 fn source(self, db: &dyn HirDatabase) -> InFile<ast::FnDef> { 85 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Fn> {
86 self.id.lookup(db.upcast()).source(db.upcast()) 86 self.id.lookup(db.upcast()).source(db.upcast())
87 } 87 }
88} 88}
@@ -105,8 +105,8 @@ impl HasSource for Trait {
105 } 105 }
106} 106}
107impl HasSource for TypeAlias { 107impl HasSource for TypeAlias {
108 type Ast = ast::TypeAliasDef; 108 type Ast = ast::TypeAlias;
109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAliasDef> { 109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAlias> {
110 self.id.lookup(db.upcast()).source(db.upcast()) 110 self.id.lookup(db.upcast()).source(db.upcast())
111 } 111 }
112} 112}
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 1436b1afe..054405966 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -582,10 +582,10 @@ to_def_impls![
582 (crate::Union, ast::UnionDef, union_to_def), 582 (crate::Union, ast::UnionDef, union_to_def),
583 (crate::Trait, ast::TraitDef, trait_to_def), 583 (crate::Trait, ast::TraitDef, trait_to_def),
584 (crate::ImplDef, ast::ImplDef, impl_to_def), 584 (crate::ImplDef, ast::ImplDef, impl_to_def),
585 (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), 585 (crate::TypeAlias, ast::TypeAlias, type_alias_to_def),
586 (crate::Const, ast::ConstDef, const_to_def), 586 (crate::Const, ast::ConstDef, const_to_def),
587 (crate::Static, ast::StaticDef, static_to_def), 587 (crate::Static, ast::StaticDef, static_to_def),
588 (crate::Function, ast::FnDef, fn_to_def), 588 (crate::Function, ast::Fn, fn_to_def),
589 (crate::Field, ast::RecordFieldDef, record_field_to_def), 589 (crate::Field, ast::RecordFieldDef, record_field_to_def),
590 (crate::Field, ast::TupleFieldDef, tuple_field_to_def), 590 (crate::Field, ast::TupleFieldDef, tuple_field_to_def),
591 (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), 591 (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def),
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs
index 42e5a1bdb..d23a1974b 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/ra_hir/src/semantics/source_to_def.rs
@@ -71,7 +71,7 @@ impl SourceToDefCtx<'_, '_> {
71 pub(super) fn impl_to_def(&mut self, src: InFile<ast::ImplDef>) -> Option<ImplId> { 71 pub(super) fn impl_to_def(&mut self, src: InFile<ast::ImplDef>) -> Option<ImplId> {
72 self.to_def(src, keys::IMPL) 72 self.to_def(src, keys::IMPL)
73 } 73 }
74 pub(super) fn fn_to_def(&mut self, src: InFile<ast::FnDef>) -> Option<FunctionId> { 74 pub(super) fn fn_to_def(&mut self, src: InFile<ast::Fn>) -> Option<FunctionId> {
75 self.to_def(src, keys::FUNCTION) 75 self.to_def(src, keys::FUNCTION)
76 } 76 }
77 pub(super) fn struct_to_def(&mut self, src: InFile<ast::StructDef>) -> Option<StructId> { 77 pub(super) fn struct_to_def(&mut self, src: InFile<ast::StructDef>) -> Option<StructId> {
@@ -89,10 +89,7 @@ impl SourceToDefCtx<'_, '_> {
89 pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { 89 pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> {
90 self.to_def(src, keys::CONST) 90 self.to_def(src, keys::CONST)
91 } 91 }
92 pub(super) fn type_alias_to_def( 92 pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> {
93 &mut self,
94 src: InFile<ast::TypeAliasDef>,
95 ) -> Option<TypeAliasId> {
96 self.to_def(src, keys::TYPE_ALIAS) 93 self.to_def(src, keys::TYPE_ALIAS)
97 } 94 }
98 pub(super) fn record_field_to_def( 95 pub(super) fn record_field_to_def(
@@ -171,7 +168,7 @@ impl SourceToDefCtx<'_, '_> {
171 let def = self.impl_to_def(container.with_value(it))?; 168 let def = self.impl_to_def(container.with_value(it))?;
172 def.into() 169 def.into()
173 }, 170 },
174 ast::FnDef(it) => { 171 ast::Fn(it) => {
175 let def = self.fn_to_def(container.with_value(it))?; 172 let def = self.fn_to_def(container.with_value(it))?;
176 DefWithBodyId::from(def).into() 173 DefWithBodyId::from(def).into()
177 }, 174 },
@@ -195,7 +192,7 @@ impl SourceToDefCtx<'_, '_> {
195 let def = self.const_to_def(container.with_value(it))?; 192 let def = self.const_to_def(container.with_value(it))?;
196 DefWithBodyId::from(def).into() 193 DefWithBodyId::from(def).into()
197 }, 194 },
198 ast::TypeAliasDef(it) => { 195 ast::TypeAlias(it) => {
199 let def = self.type_alias_to_def(container.with_value(it))?; 196 let def = self.type_alias_to_def(container.with_value(it))?;
200 def.into() 197 def.into()
201 }, 198 },
@@ -213,11 +210,11 @@ impl SourceToDefCtx<'_, '_> {
213 for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { 210 for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) {
214 let res: GenericDefId = match_ast! { 211 let res: GenericDefId = match_ast! {
215 match (container.value) { 212 match (container.value) {
216 ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), 213 ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(),
217 ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), 214 ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(),
218 ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), 215 ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(),
219 ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), 216 ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(),
220 ast::TypeAliasDef(it) => self.type_alias_to_def(container.with_value(it))?.into(), 217 ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(),
221 ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), 218 ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(),
222 _ => continue, 219 _ => continue,
223 } 220 }
@@ -233,7 +230,7 @@ impl SourceToDefCtx<'_, '_> {
233 match (container.value) { 230 match (container.value) {
234 ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), 231 ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(),
235 ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), 232 ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(),
236 ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), 233 ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(),
237 _ => continue, 234 _ => continue,
238 } 235 }
239 }; 236 };
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 5c57d8bde..f463997e7 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -627,14 +627,14 @@ impl ExprCollector<'_> {
627 .items() 627 .items()
628 .filter_map(|item| { 628 .filter_map(|item| {
629 let (def, name): (ModuleDefId, Option<ast::Name>) = match item { 629 let (def, name): (ModuleDefId, Option<ast::Name>) = match item {
630 ast::Item::FnDef(def) => { 630 ast::Item::Fn(def) => {
631 let id = self.find_inner_item(&def)?; 631 let id = self.find_inner_item(&def)?;
632 ( 632 (
633 FunctionLoc { container: container.into(), id }.intern(self.db).into(), 633 FunctionLoc { container: container.into(), id }.intern(self.db).into(),
634 def.name(), 634 def.name(),
635 ) 635 )
636 } 636 }
637 ast::Item::TypeAliasDef(def) => { 637 ast::Item::TypeAlias(def) => {
638 let id = self.find_inner_item(&def)?; 638 let id = self.find_inner_item(&def)?;
639 ( 639 (
640 TypeAliasLoc { container: container.into(), id }.intern(self.db).into(), 640 TypeAliasLoc { container: container.into(), id }.intern(self.db).into(),
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 0bab9c6d8..ea61ac217 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -413,7 +413,7 @@ macro_rules! mod_items {
413mod_items! { 413mod_items! {
414 Import in imports -> ast::Use, 414 Import in imports -> ast::Use,
415 ExternCrate in extern_crates -> ast::ExternCrate, 415 ExternCrate in extern_crates -> ast::ExternCrate,
416 Function in functions -> ast::FnDef, 416 Function in functions -> ast::Fn,
417 Struct in structs -> ast::StructDef, 417 Struct in structs -> ast::StructDef,
418 Union in unions -> ast::UnionDef, 418 Union in unions -> ast::UnionDef,
419 Enum in enums -> ast::EnumDef, 419 Enum in enums -> ast::EnumDef,
@@ -421,7 +421,7 @@ mod_items! {
421 Static in statics -> ast::StaticDef, 421 Static in statics -> ast::StaticDef,
422 Trait in traits -> ast::TraitDef, 422 Trait in traits -> ast::TraitDef,
423 Impl in impls -> ast::ImplDef, 423 Impl in impls -> ast::ImplDef,
424 TypeAlias in type_aliases -> ast::TypeAliasDef, 424 TypeAlias in type_aliases -> ast::TypeAlias,
425 Mod in mods -> ast::Module, 425 Mod in mods -> ast::Module,
426 MacroCall in macro_calls -> ast::MacroCall, 426 MacroCall in macro_calls -> ast::MacroCall,
427} 427}
@@ -505,7 +505,7 @@ pub struct Function {
505 pub params: Box<[TypeRef]>, 505 pub params: Box<[TypeRef]>,
506 pub is_varargs: bool, 506 pub is_varargs: bool,
507 pub ret_type: TypeRef, 507 pub ret_type: TypeRef,
508 pub ast_id: FileAstId<ast::FnDef>, 508 pub ast_id: FileAstId<ast::Fn>,
509} 509}
510 510
511#[derive(Debug, Clone, Eq, PartialEq)] 511#[derive(Debug, Clone, Eq, PartialEq)]
@@ -592,7 +592,7 @@ pub struct TypeAlias {
592 pub bounds: Box<[TypeBound]>, 592 pub bounds: Box<[TypeBound]>,
593 pub generic_params: GenericParamsId, 593 pub generic_params: GenericParamsId,
594 pub type_ref: Option<TypeRef>, 594 pub type_ref: Option<TypeRef>,
595 pub ast_id: FileAstId<ast::TypeAliasDef>, 595 pub ast_id: FileAstId<ast::TypeAlias>,
596} 596}
597 597
598#[derive(Debug, Clone, Eq, PartialEq)] 598#[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index 8bd0362dc..4cfc68f53 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -78,8 +78,8 @@ impl Ctx {
78 ast::Item::StructDef(_) 78 ast::Item::StructDef(_)
79 | ast::Item::UnionDef(_) 79 | ast::Item::UnionDef(_)
80 | ast::Item::EnumDef(_) 80 | ast::Item::EnumDef(_)
81 | ast::Item::FnDef(_) 81 | ast::Item::Fn(_)
82 | ast::Item::TypeAliasDef(_) 82 | ast::Item::TypeAlias(_)
83 | ast::Item::ConstDef(_) 83 | ast::Item::ConstDef(_)
84 | ast::Item::StaticDef(_) 84 | ast::Item::StaticDef(_)
85 | ast::Item::MacroCall(_) => { 85 | ast::Item::MacroCall(_) => {
@@ -103,8 +103,8 @@ impl Ctx {
103 ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), 103 ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into),
104 ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into), 104 ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into),
105 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), 105 ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into),
106 ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), 106 ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into),
107 ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), 107 ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into),
108 ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), 108 ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into),
109 ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), 109 ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()),
110 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), 110 ast::Item::Module(ast) => self.lower_module(ast).map(Into::into),
@@ -155,8 +155,8 @@ impl Ctx {
155 155
156 fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { 156 fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> {
157 match item { 157 match item {
158 ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into), 158 ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into),
159 ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), 159 ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into),
160 ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), 160 ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()),
161 ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), 161 ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into),
162 } 162 }
@@ -277,7 +277,7 @@ impl Ctx {
277 Some(res) 277 Some(res)
278 } 278 }
279 279
280 fn lower_function(&mut self, func: &ast::FnDef) -> Option<FileItemTreeId<Function>> { 280 fn lower_function(&mut self, func: &ast::Fn) -> Option<FileItemTreeId<Function>> {
281 let visibility = self.lower_visibility(func); 281 let visibility = self.lower_visibility(func);
282 let name = func.name()?.as_name(); 282 let name = func.name()?.as_name();
283 283
@@ -348,7 +348,7 @@ impl Ctx {
348 348
349 fn lower_type_alias( 349 fn lower_type_alias(
350 &mut self, 350 &mut self,
351 type_alias: &ast::TypeAliasDef, 351 type_alias: &ast::TypeAlias,
352 ) -> Option<FileItemTreeId<TypeAlias>> { 352 ) -> Option<FileItemTreeId<TypeAlias>> {
353 let name = type_alias.name()?.as_name(); 353 let name = type_alias.name()?.as_name();
354 let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it)); 354 let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it));
@@ -547,7 +547,7 @@ impl Ctx {
547 self.collect_inner_items(item.syntax()); 547 self.collect_inner_items(item.syntax());
548 let attrs = Attrs::new(&item, &self.hygiene); 548 let attrs = Attrs::new(&item, &self.hygiene);
549 let id: ModItem = match item { 549 let id: ModItem = match item {
550 ast::ExternItem::FnDef(ast) => { 550 ast::ExternItem::Fn(ast) => {
551 let func = self.lower_function(&ast)?; 551 let func = self.lower_function(&ast)?;
552 self.data().functions[func.index].is_unsafe = true; 552 self.data().functions[func.index].is_unsafe = true;
553 func.into() 553 func.into()
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index 3f2e29d9e..a8f5da1c1 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_hir_def/src/item_tree/tests.rs
@@ -236,13 +236,13 @@ fn smoke() {
236 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] 236 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }]
237 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } 237 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) }
238 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] 238 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }]
239 > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAliasDef>(8) } 239 > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAlias>(8) }
240 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] 240 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }]
241 > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ConstDef>(9) } 241 > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ConstDef>(9) }
242 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] 242 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }]
243 > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(10) } 243 > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(10) }
244 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] 244 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }]
245 > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(11) } 245 > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(11) }
246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] 246 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }]
247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit } 247 Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit }
248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] 248 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }]
@@ -275,12 +275,12 @@ fn simple_inner_items() {
275 275
276 top-level items: 276 top-level items:
277 Impl { generic_params: GenericParamsId(0), target_trait: Some(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("D"))] }, generic_args: [None] })), target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Response"))] }, generic_args: [Some(GenericArgs { args: [Type(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("T"))] }, generic_args: [None] }))], has_self_type: false, bindings: [] })] }), is_negative: false, items: [Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } 277 Impl { generic_params: GenericParamsId(0), target_trait: Some(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("D"))] }, generic_args: [None] })), target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Response"))] }, generic_args: [Some(GenericArgs { args: [Type(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("T"))] }, generic_args: [None] }))], has_self_type: false, bindings: [] })] }), is_negative: false, items: [Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) }
278 > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(1) } 278 > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
279 279
280 inner items: 280 inner items:
281 281
282 for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(2): 282 for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(2):
283 Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(2) } 283 Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(2) }
284 284
285 "#]], 285 "#]],
286 ); 286 );
@@ -303,9 +303,9 @@ fn extern_attrs() {
303 303
304 top-level items: 304 top-level items:
305 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] 305 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }]
306 Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(1) } 306 Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
307 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] 307 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }]
308 Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(2) } 308 Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(2) }
309 "##]], 309 "##]],
310 ); 310 );
311} 311}
@@ -329,9 +329,9 @@ fn trait_attrs() {
329 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] 329 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }]
330 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(0) } 330 Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(0) }
331 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] 331 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }]
332 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(1) } 332 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
333 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] 333 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }]
334 > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(2) } 334 > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(2) }
335 "##]], 335 "##]],
336 ); 336 );
337} 337}
@@ -355,9 +355,9 @@ fn impl_attrs() {
355 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }] 355 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }]
356 Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Ty"))] }, generic_args: [None] }), is_negative: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } 356 Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Ty"))] }, generic_args: [None] }), is_negative: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) }
357 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] 357 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }]
358 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(1) } 358 > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
359 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] 359 > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }]
360 > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(2) } 360 > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(2) }
361 "##]], 361 "##]],
362 ); 362 );
363} 363}
@@ -408,13 +408,13 @@ fn inner_item_attrs() {
408 inner attrs: Attrs { entries: None } 408 inner attrs: Attrs { entries: None }
409 409
410 top-level items: 410 top-level items:
411 Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(0) } 411 Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(0) }
412 412
413 inner items: 413 inner items:
414 414
415 for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(1): 415 for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(1):
416 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }] 416 #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }]
417 Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::FnDef>(1) } 417 Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(1) }
418 418
419 "##]], 419 "##]],
420 ); 420 );
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs
index a7349a21d..f627eab1f 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/ra_hir_def/src/keys.rs
@@ -14,10 +14,10 @@ use crate::{
14 14
15pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>; 15pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>;
16 16
17pub const FUNCTION: Key<ast::FnDef, FunctionId> = Key::new(); 17pub const FUNCTION: Key<ast::Fn, FunctionId> = Key::new();
18pub const CONST: Key<ast::ConstDef, ConstId> = Key::new(); 18pub const CONST: Key<ast::ConstDef, ConstId> = Key::new();
19pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new(); 19pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new();
20pub const TYPE_ALIAS: Key<ast::TypeAliasDef, TypeAliasId> = Key::new(); 20pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new();
21pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); 21pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new();
22pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); 22pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new();
23pub const STRUCT: Key<ast::StructDef, StructId> = Key::new(); 23pub const STRUCT: Key<ast::StructDef, StructId> = Key::new();
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs
index 45bc14c37..016e689ff 100644
--- a/crates/ra_hir_ty/src/tests.rs
+++ b/crates/ra_hir_ty/src/tests.rs
@@ -81,7 +81,7 @@ fn check_types_impl(ra_fixture: &str, display_source: bool) {
81fn type_at_range(db: &TestDB, pos: FileRange) -> Ty { 81fn type_at_range(db: &TestDB, pos: FileRange) -> Ty {
82 let file = db.parse(pos.file_id).ok().unwrap(); 82 let file = db.parse(pos.file_id).ok().unwrap();
83 let expr = algo::find_node_at_range::<ast::Expr>(file.syntax(), pos.range).unwrap(); 83 let expr = algo::find_node_at_range::<ast::Expr>(file.syntax(), pos.range).unwrap();
84 let fn_def = expr.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); 84 let fn_def = expr.syntax().ancestors().find_map(ast::Fn::cast).unwrap();
85 let module = db.module_for_file(pos.file_id); 85 let module = db.module_for_file(pos.file_id);
86 let func = *module.child_by_source(db)[keys::FUNCTION] 86 let func = *module.child_by_source(db)[keys::FUNCTION]
87 .get(&InFile::new(pos.file_id.into(), fn_def)) 87 .get(&InFile::new(pos.file_id.into(), fn_def))
diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs
index c28af8ab3..1fcaf4a32 100644
--- a/crates/ra_ide/src/call_hierarchy.rs
+++ b/crates/ra_ide/src/call_hierarchy.rs
@@ -59,7 +59,7 @@ pub(crate) fn incoming_calls(db: &RootDatabase, position: FilePosition) -> Optio
59 if let Some(nav) = syntax.ancestors().find_map(|node| { 59 if let Some(nav) = syntax.ancestors().find_map(|node| {
60 match_ast! { 60 match_ast! {
61 match node { 61 match node {
62 ast::FnDef(it) => { 62 ast::Fn(it) => {
63 let def = sema.to_def(&it)?; 63 let def = sema.to_def(&it)?;
64 Some(def.to_nav(sema.db)) 64 Some(def.to_nav(sema.db))
65 }, 65 },
@@ -181,8 +181,8 @@ fn caller() {
181 call<|>ee(); 181 call<|>ee();
182} 182}
183"#, 183"#,
184 "callee FN_DEF FileId(1) 0..14 3..9", 184 "callee FN FileId(1) 0..14 3..9",
185 &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], 185 &["caller FN FileId(1) 15..44 18..24 : [33..39]"],
186 &[], 186 &[],
187 ); 187 );
188 } 188 }
@@ -197,8 +197,8 @@ fn caller() {
197 callee(); 197 callee();
198} 198}
199"#, 199"#,
200 "callee FN_DEF FileId(1) 0..14 3..9", 200 "callee FN FileId(1) 0..14 3..9",
201 &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], 201 &["caller FN FileId(1) 15..44 18..24 : [33..39]"],
202 &[], 202 &[],
203 ); 203 );
204 } 204 }
@@ -214,8 +214,8 @@ fn caller() {
214 callee(); 214 callee();
215} 215}
216"#, 216"#,
217 "callee FN_DEF FileId(1) 0..14 3..9", 217 "callee FN FileId(1) 0..14 3..9",
218 &["caller FN_DEF FileId(1) 15..58 18..24 : [33..39, 47..53]"], 218 &["caller FN FileId(1) 15..58 18..24 : [33..39, 47..53]"],
219 &[], 219 &[],
220 ); 220 );
221 } 221 }
@@ -234,10 +234,10 @@ fn caller2() {
234 callee(); 234 callee();
235} 235}
236"#, 236"#,
237 "callee FN_DEF FileId(1) 0..14 3..9", 237 "callee FN FileId(1) 0..14 3..9",
238 &[ 238 &[
239 "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", 239 "caller1 FN FileId(1) 15..45 18..25 : [34..40]",
240 "caller2 FN_DEF FileId(1) 47..77 50..57 : [66..72]", 240 "caller2 FN FileId(1) 47..77 50..57 : [66..72]",
241 ], 241 ],
242 &[], 242 &[],
243 ); 243 );
@@ -263,10 +263,10 @@ mod tests {
263 } 263 }
264} 264}
265"#, 265"#,
266 "callee FN_DEF FileId(1) 0..14 3..9", 266 "callee FN FileId(1) 0..14 3..9",
267 &[ 267 &[
268 "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", 268 "caller1 FN FileId(1) 15..45 18..25 : [34..40]",
269 "test_caller FN_DEF FileId(1) 95..149 110..121 : [134..140]", 269 "test_caller FN FileId(1) 95..149 110..121 : [134..140]",
270 ], 270 ],
271 &[], 271 &[],
272 ); 272 );
@@ -287,8 +287,8 @@ fn caller() {
287//- /foo/mod.rs 287//- /foo/mod.rs
288pub fn callee() {} 288pub fn callee() {}
289"#, 289"#,
290 "callee FN_DEF FileId(2) 0..18 7..13", 290 "callee FN FileId(2) 0..18 7..13",
291 &["caller FN_DEF FileId(1) 27..56 30..36 : [45..51]"], 291 &["caller FN FileId(1) 27..56 30..36 : [45..51]"],
292 &[], 292 &[],
293 ); 293 );
294 } 294 }
@@ -304,9 +304,9 @@ fn call<|>er() {
304 callee(); 304 callee();
305} 305}
306"#, 306"#,
307 "caller FN_DEF FileId(1) 15..58 18..24", 307 "caller FN FileId(1) 15..58 18..24",
308 &[], 308 &[],
309 &["callee FN_DEF FileId(1) 0..14 3..9 : [33..39, 47..53]"], 309 &["callee FN FileId(1) 0..14 3..9 : [33..39, 47..53]"],
310 ); 310 );
311 } 311 }
312 312
@@ -325,9 +325,9 @@ fn call<|>er() {
325//- /foo/mod.rs 325//- /foo/mod.rs
326pub fn callee() {} 326pub fn callee() {}
327"#, 327"#,
328 "caller FN_DEF FileId(1) 27..56 30..36", 328 "caller FN FileId(1) 27..56 30..36",
329 &[], 329 &[],
330 &["callee FN_DEF FileId(2) 0..18 7..13 : [45..51]"], 330 &["callee FN FileId(2) 0..18 7..13 : [45..51]"],
331 ); 331 );
332 } 332 }
333 333
@@ -348,9 +348,9 @@ fn caller3() {
348 348
349} 349}
350"#, 350"#,
351 "caller2 FN_DEF FileId(1) 33..64 36..43", 351 "caller2 FN FileId(1) 33..64 36..43",
352 &["caller1 FN_DEF FileId(1) 0..31 3..10 : [19..26]"], 352 &["caller1 FN FileId(1) 0..31 3..10 : [19..26]"],
353 &["caller3 FN_DEF FileId(1) 66..83 69..76 : [52..59]"], 353 &["caller3 FN FileId(1) 66..83 69..76 : [52..59]"],
354 ); 354 );
355 } 355 }
356 356
@@ -368,9 +368,9 @@ fn main() {
368 a<|>() 368 a<|>()
369} 369}
370"#, 370"#,
371 "a FN_DEF FileId(1) 0..18 3..4", 371 "a FN FileId(1) 0..18 3..4",
372 &["main FN_DEF FileId(1) 31..52 34..38 : [47..48]"], 372 &["main FN FileId(1) 31..52 34..38 : [47..48]"],
373 &["b FN_DEF FileId(1) 20..29 23..24 : [13..14]"], 373 &["b FN FileId(1) 20..29 23..24 : [13..14]"],
374 ); 374 );
375 375
376 check_hierarchy( 376 check_hierarchy(
@@ -385,8 +385,8 @@ fn main() {
385 a() 385 a()
386} 386}
387"#, 387"#,
388 "b FN_DEF FileId(1) 20..29 23..24", 388 "b FN FileId(1) 20..29 23..24",
389 &["a FN_DEF FileId(1) 0..18 3..4 : [13..14]"], 389 &["a FN FileId(1) 0..18 3..4 : [13..14]"],
390 &[], 390 &[],
391 ); 391 );
392 } 392 }
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs
index d4b6112a5..406334257 100644
--- a/crates/ra_ide/src/completion/complete_fn_param.rs
+++ b/crates/ra_ide/src/completion/complete_fn_param.rs
@@ -19,8 +19,8 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext)
19 19
20 let mut params = FxHashMap::default(); 20 let mut params = FxHashMap::default();
21 21
22 let me = ctx.token.ancestors().find_map(ast::FnDef::cast); 22 let me = ctx.token.ancestors().find_map(ast::Fn::cast);
23 let mut process_fn = |func: ast::FnDef| { 23 let mut process_fn = |func: ast::Fn| {
24 if Some(&func) == me.as_ref() { 24 if Some(&func) == me.as_ref() {
25 return; 25 return;
26 } 26 }
@@ -34,15 +34,15 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext)
34 match_ast! { 34 match_ast! {
35 match node { 35 match node {
36 ast::SourceFile(it) => it.items().filter_map(|item| match item { 36 ast::SourceFile(it) => it.items().filter_map(|item| match item {
37 ast::Item::FnDef(it) => Some(it), 37 ast::Item::Fn(it) => Some(it),
38 _ => None, 38 _ => None,
39 }).for_each(&mut process_fn), 39 }).for_each(&mut process_fn),
40 ast::ItemList(it) => it.items().filter_map(|item| match item { 40 ast::ItemList(it) => it.items().filter_map(|item| match item {
41 ast::Item::FnDef(it) => Some(it), 41 ast::Item::Fn(it) => Some(it),
42 _ => None, 42 _ => None,
43 }).for_each(&mut process_fn), 43 }).for_each(&mut process_fn),
44 ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { 44 ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item {
45 ast::AssocItem::FnDef(it) => Some(it), 45 ast::AssocItem::Fn(it) => Some(it),
46 _ => None, 46 _ => None,
47 }).for_each(&mut process_fn), 47 }).for_each(&mut process_fn),
48 _ => continue, 48 _ => continue,
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs
index 1581b2d5d..b62064797 100644
--- a/crates/ra_ide/src/completion/complete_keyword.rs
+++ b/crates/ra_ide/src/completion/complete_keyword.rs
@@ -169,7 +169,7 @@ fn add_keyword(ctx: &CompletionContext, acc: &mut Completions, kw: &str, snippet
169 169
170fn complete_return( 170fn complete_return(
171 ctx: &CompletionContext, 171 ctx: &CompletionContext,
172 fn_def: &ast::FnDef, 172 fn_def: &ast::Fn,
173 can_be_stmt: bool, 173 can_be_stmt: bool,
174) -> Option<CompletionItem> { 174) -> Option<CompletionItem> {
175 let snip = match (can_be_stmt, fn_def.ret_type().is_some()) { 175 let snip = match (can_be_stmt, fn_def.ret_type().is_some()) {
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs
index cf716540f..7d9050a6b 100644
--- a/crates/ra_ide/src/completion/complete_trait_impl.rs
+++ b/crates/ra_ide/src/completion/complete_trait_impl.rs
@@ -2,7 +2,7 @@
2//! 2//!
3//! This module adds the completion items related to implementing associated 3//! This module adds the completion items related to implementing associated
4//! items within a `impl Trait for Struct` block. The current context node 4//! items within a `impl Trait for Struct` block. The current context node
5//! must be within either a `FN_DEF`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node 5//! must be within either a `FN`, `TYPE_ALIAS`, or `CONST_DEF` node
6//! and an direct child of an `IMPL_DEF`. 6//! and an direct child of an `IMPL_DEF`.
7//! 7//!
8//! # Examples 8//! # Examples
@@ -63,7 +63,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
63 } 63 }
64 }), 64 }),
65 65
66 SyntaxKind::FN_DEF => { 66 SyntaxKind::FN => {
67 for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) 67 for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def)
68 .into_iter() 68 .into_iter()
69 .filter_map(|item| match item { 69 .filter_map(|item| match item {
@@ -75,7 +75,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
75 } 75 }
76 } 76 }
77 77
78 SyntaxKind::TYPE_ALIAS_DEF => { 78 SyntaxKind::TYPE_ALIAS => {
79 for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) 79 for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def)
80 .into_iter() 80 .into_iter()
81 .filter_map(|item| match item { 81 .filter_map(|item| match item {
@@ -106,8 +106,8 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
106 106
107fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> { 107fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> {
108 let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { 108 let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() {
109 SyntaxKind::FN_DEF 109 SyntaxKind::FN
110 | SyntaxKind::TYPE_ALIAS_DEF 110 | SyntaxKind::TYPE_ALIAS
111 | SyntaxKind::CONST_DEF 111 | SyntaxKind::CONST_DEF
112 | SyntaxKind::BLOCK_EXPR => Some((p, 2)), 112 | SyntaxKind::BLOCK_EXPR => Some((p, 2)),
113 SyntaxKind::NAME_REF => Some((p, 5)), 113 SyntaxKind::NAME_REF => Some((p, 5)),
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index cc55f6dd6..221d7847e 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -35,7 +35,7 @@ pub(crate) struct CompletionContext<'a> {
35 pub(super) krate: Option<hir::Crate>, 35 pub(super) krate: Option<hir::Crate>,
36 pub(super) expected_type: Option<Type>, 36 pub(super) expected_type: Option<Type>,
37 pub(super) name_ref_syntax: Option<ast::NameRef>, 37 pub(super) name_ref_syntax: Option<ast::NameRef>,
38 pub(super) function_syntax: Option<ast::FnDef>, 38 pub(super) function_syntax: Option<ast::Fn>,
39 pub(super) use_item_syntax: Option<ast::Use>, 39 pub(super) use_item_syntax: Option<ast::Use>,
40 pub(super) record_lit_syntax: Option<ast::RecordLit>, 40 pub(super) record_lit_syntax: Option<ast::RecordLit>,
41 pub(super) record_pat_syntax: Option<ast::RecordPat>, 41 pub(super) record_pat_syntax: Option<ast::RecordPat>,
@@ -349,7 +349,7 @@ impl<'a> CompletionContext<'a> {
349 .sema 349 .sema
350 .ancestors_with_macros(self.token.parent()) 350 .ancestors_with_macros(self.token.parent())
351 .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) 351 .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE)
352 .find_map(ast::FnDef::cast); 352 .find_map(ast::Fn::cast);
353 353
354 self.record_field_syntax = self 354 self.record_field_syntax = self
355 .sema 355 .sema
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs
index 175209d8a..b8408da4e 100644
--- a/crates/ra_ide/src/completion/patterns.rs
+++ b/crates/ra_ide/src/completion/patterns.rs
@@ -134,7 +134,7 @@ pub(crate) fn is_in_loop_body(element: SyntaxElement) -> bool {
134 NodeOrToken::Token(token) => token.parent(), 134 NodeOrToken::Token(token) => token.parent(),
135 }; 135 };
136 for node in leaf.ancestors() { 136 for node in leaf.ancestors() {
137 if node.kind() == FN_DEF || node.kind() == LAMBDA_EXPR { 137 if node.kind() == FN || node.kind() == LAMBDA_EXPR {
138 break; 138 break;
139 } 139 }
140 let loop_body = match_ast! { 140 let loop_body = match_ast! {
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs
index 6d4151dd8..6d93726bf 100644
--- a/crates/ra_ide/src/display.rs
+++ b/crates/ra_ide/src/display.rs
@@ -16,7 +16,7 @@ pub use navigation_target::NavigationTarget;
16pub(crate) use navigation_target::{ToNav, TryToNav}; 16pub(crate) use navigation_target::{ToNav, TryToNav};
17pub(crate) use short_label::ShortLabel; 17pub(crate) use short_label::ShortLabel;
18 18
19pub(crate) fn function_declaration(node: &ast::FnDef) -> String { 19pub(crate) fn function_declaration(node: &ast::Fn) -> String {
20 let mut buf = String::new(); 20 let mut buf = String::new();
21 if let Some(vis) = node.visibility() { 21 if let Some(vis) = node.visibility() {
22 format_to!(buf, "{} ", vis); 22 format_to!(buf, "{} ", vis);
@@ -65,7 +65,7 @@ pub(crate) fn const_label(node: &ast::ConstDef) -> String {
65 label.trim().to_owned() 65 label.trim().to_owned()
66} 66}
67 67
68pub(crate) fn type_label(node: &ast::TypeAliasDef) -> String { 68pub(crate) fn type_label(node: &ast::TypeAlias) -> String {
69 let label: String = node 69 let label: String = node
70 .syntax() 70 .syntax()
71 .children_with_tokens() 71 .children_with_tokens()
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index fd245705c..4f19c7ed4 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -379,12 +379,12 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option
379 379
380 match_ast! { 380 match_ast! {
381 match node { 381 match node {
382 ast::FnDef(it) => it.doc_comment_text(), 382 ast::Fn(it) => it.doc_comment_text(),
383 ast::StructDef(it) => it.doc_comment_text(), 383 ast::StructDef(it) => it.doc_comment_text(),
384 ast::EnumDef(it) => it.doc_comment_text(), 384 ast::EnumDef(it) => it.doc_comment_text(),
385 ast::TraitDef(it) => it.doc_comment_text(), 385 ast::TraitDef(it) => it.doc_comment_text(),
386 ast::Module(it) => it.doc_comment_text(), 386 ast::Module(it) => it.doc_comment_text(),
387 ast::TypeAliasDef(it) => it.doc_comment_text(), 387 ast::TypeAlias(it) => it.doc_comment_text(),
388 ast::ConstDef(it) => it.doc_comment_text(), 388 ast::ConstDef(it) => it.doc_comment_text(),
389 ast::StaticDef(it) => it.doc_comment_text(), 389 ast::StaticDef(it) => it.doc_comment_text(),
390 ast::RecordFieldDef(it) => it.doc_comment_text(), 390 ast::RecordFieldDef(it) => it.doc_comment_text(),
@@ -404,12 +404,12 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) ->
404 404
405 match_ast! { 405 match_ast! {
406 match node { 406 match node {
407 ast::FnDef(it) => it.short_label(), 407 ast::Fn(it) => it.short_label(),
408 ast::StructDef(it) => it.short_label(), 408 ast::StructDef(it) => it.short_label(),
409 ast::EnumDef(it) => it.short_label(), 409 ast::EnumDef(it) => it.short_label(),
410 ast::TraitDef(it) => it.short_label(), 410 ast::TraitDef(it) => it.short_label(),
411 ast::Module(it) => it.short_label(), 411 ast::Module(it) => it.short_label(),
412 ast::TypeAliasDef(it) => it.short_label(), 412 ast::TypeAlias(it) => it.short_label(),
413 ast::ConstDef(it) => it.short_label(), 413 ast::ConstDef(it) => it.short_label(),
414 ast::StaticDef(it) => it.short_label(), 414 ast::StaticDef(it) => it.short_label(),
415 ast::RecordFieldDef(it) => it.short_label(), 415 ast::RecordFieldDef(it) => it.short_label(),
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs
index 5588130a1..e2c95be06 100644
--- a/crates/ra_ide/src/display/short_label.rs
+++ b/crates/ra_ide/src/display/short_label.rs
@@ -7,7 +7,7 @@ pub(crate) trait ShortLabel {
7 fn short_label(&self) -> Option<String>; 7 fn short_label(&self) -> Option<String>;
8} 8}
9 9
10impl ShortLabel for ast::FnDef { 10impl ShortLabel for ast::Fn {
11 fn short_label(&self) -> Option<String> { 11 fn short_label(&self) -> Option<String> {
12 Some(crate::display::function_declaration(self)) 12 Some(crate::display::function_declaration(self))
13 } 13 }
@@ -47,7 +47,7 @@ impl ShortLabel for ast::Module {
47 } 47 }
48} 48}
49 49
50impl ShortLabel for ast::TypeAliasDef { 50impl ShortLabel for ast::TypeAlias {
51 fn short_label(&self) -> Option<String> { 51 fn short_label(&self) -> Option<String> {
52 short_label_from_node(self, "type ") 52 short_label_from_node(self, "type ")
53 } 53 }
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs
index 1f6a3febf..8ef977761 100644
--- a/crates/ra_ide/src/file_structure.rs
+++ b/crates/ra_ide/src/file_structure.rs
@@ -111,7 +111,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
111 111
112 match_ast! { 112 match_ast! {
113 match node { 113 match node {
114 ast::FnDef(it) => { 114 ast::Fn(it) => {
115 let mut detail = String::from("fn"); 115 let mut detail = String::from("fn");
116 if let Some(type_param_list) = it.type_param_list() { 116 if let Some(type_param_list) = it.type_param_list() {
117 collapse_ws(type_param_list.syntax(), &mut detail); 117 collapse_ws(type_param_list.syntax(), &mut detail);
@@ -132,7 +132,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
132 ast::EnumVariant(it) => decl(it), 132 ast::EnumVariant(it) => decl(it),
133 ast::TraitDef(it) => decl(it), 133 ast::TraitDef(it) => decl(it),
134 ast::Module(it) => decl(it), 134 ast::Module(it) => decl(it),
135 ast::TypeAliasDef(it) => { 135 ast::TypeAlias(it) => {
136 let ty = it.type_ref(); 136 let ty = it.type_ref();
137 decl_with_type_ref(it, ty) 137 decl_with_type_ref(it, ty)
138 }, 138 },
@@ -271,7 +271,7 @@ fn very_obsolete() {}
271 label: "bar1", 271 label: "bar1",
272 navigation_range: 43..47, 272 navigation_range: 43..47,
273 node_range: 40..52, 273 node_range: 40..52,
274 kind: FN_DEF, 274 kind: FN,
275 detail: Some( 275 detail: Some(
276 "fn()", 276 "fn()",
277 ), 277 ),
@@ -284,7 +284,7 @@ fn very_obsolete() {}
284 label: "bar2", 284 label: "bar2",
285 navigation_range: 60..64, 285 navigation_range: 60..64,
286 node_range: 57..81, 286 node_range: 57..81,
287 kind: FN_DEF, 287 kind: FN,
288 detail: Some( 288 detail: Some(
289 "fn<T>(t: T) -> T", 289 "fn<T>(t: T) -> T",
290 ), 290 ),
@@ -297,7 +297,7 @@ fn very_obsolete() {}
297 label: "bar3", 297 label: "bar3",
298 navigation_range: 89..93, 298 navigation_range: 89..93,
299 node_range: 86..156, 299 node_range: 86..156,
300 kind: FN_DEF, 300 kind: FN,
301 detail: Some( 301 detail: Some(
302 "fn<A, B>(a: A, b: B) -> Vec< u32 >", 302 "fn<A, B>(a: A, b: B) -> Vec< u32 >",
303 ), 303 ),
@@ -339,7 +339,7 @@ fn very_obsolete() {}
339 label: "T", 339 label: "T",
340 navigation_range: 186..187, 340 navigation_range: 186..187,
341 node_range: 181..193, 341 node_range: 181..193,
342 kind: TYPE_ALIAS_DEF, 342 kind: TYPE_ALIAS,
343 detail: Some( 343 detail: Some(
344 "()", 344 "()",
345 ), 345 ),
@@ -417,7 +417,7 @@ fn very_obsolete() {}
417 label: "obsolete", 417 label: "obsolete",
418 navigation_range: 428..436, 418 navigation_range: 428..436,
419 node_range: 411..441, 419 node_range: 411..441,
420 kind: FN_DEF, 420 kind: FN,
421 detail: Some( 421 detail: Some(
422 "fn()", 422 "fn()",
423 ), 423 ),
@@ -428,7 +428,7 @@ fn very_obsolete() {}
428 label: "very_obsolete", 428 label: "very_obsolete",
429 navigation_range: 481..494, 429 navigation_range: 481..494,
430 node_range: 443..499, 430 node_range: 443..499,
431 kind: FN_DEF, 431 kind: FN,
432 detail: Some( 432 detail: Some(
433 "fn()", 433 "fn()",
434 ), 434 ),
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index d067c339d..4ef7efd26 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -1361,7 +1361,7 @@ fn foo_<|>test() {}
1361 11..19, 1361 11..19,
1362 ), 1362 ),
1363 name: "foo_test", 1363 name: "foo_test",
1364 kind: FN_DEF, 1364 kind: FN,
1365 container_name: None, 1365 container_name: None,
1366 description: None, 1366 description: None,
1367 docs: None, 1367 docs: None,
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index fe1c074d1..8d3452a83 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -376,7 +376,7 @@ impl Foo {
376} 376}
377"#, 377"#,
378 ); 378 );
379 check_result(refs, "f FN_DEF FileId(1) 27..43 30..31 Other", &[]); 379 check_result(refs, "f FN FileId(1) 27..43 30..31 Other", &[]);
380 } 380 }
381 381
382 #[test] 382 #[test]
@@ -514,7 +514,7 @@ pub(super) struct Foo<|> {
514 let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); 514 let refs = analysis.find_all_refs(pos, None).unwrap().unwrap();
515 check_result( 515 check_result(
516 refs, 516 refs,
517 "quux FN_DEF FileId(1) 19..35 26..30 Other", 517 "quux FN FileId(1) 19..35 26..30 Other",
518 &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], 518 &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"],
519 ); 519 );
520 520
@@ -522,7 +522,7 @@ pub(super) struct Foo<|> {
522 analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); 522 analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap();
523 check_result( 523 check_result(
524 refs, 524 refs,
525 "quux FN_DEF FileId(1) 19..35 26..30 Other", 525 "quux FN FileId(1) 19..35 26..30 Other",
526 &["FileId(3) 16..20 StructLiteral"], 526 &["FileId(3) 16..20 StructLiteral"],
527 ); 527 );
528 } 528 }
@@ -619,7 +619,7 @@ fn main() {
619 ); 619 );
620 check_result( 620 check_result(
621 refs, 621 refs,
622 "new FN_DEF FileId(1) 54..101 61..64 Other", 622 "new FN FileId(1) 54..101 61..64 Other",
623 &["FileId(1) 146..149 StructLiteral"], 623 &["FileId(1) 146..149 StructLiteral"],
624 ); 624 );
625 } 625 }
@@ -646,7 +646,7 @@ fn main() {
646 let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); 646 let refs = analysis.find_all_refs(pos, None).unwrap().unwrap();
647 check_result( 647 check_result(
648 refs, 648 refs,
649 "f FN_DEF FileId(1) 26..35 29..30 Other", 649 "f FN FileId(1) 26..35 29..30 Other",
650 &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"], 650 &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"],
651 ); 651 );
652 } 652 }
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs
index 8735ec53c..d8ffb8c84 100644
--- a/crates/ra_ide/src/references/rename.rs
+++ b/crates/ra_ide/src/references/rename.rs
@@ -149,7 +149,7 @@ fn rename_to_self(
149 let source_file = sema.parse(position.file_id); 149 let source_file = sema.parse(position.file_id);
150 let syn = source_file.syntax(); 150 let syn = source_file.syntax();
151 151
152 let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; 152 let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?;
153 let params = fn_def.param_list()?; 153 let params = fn_def.param_list()?;
154 if params.self_param().is_some() { 154 if params.self_param().is_some() {
155 return None; // method already has self param 155 return None; // method already has self param
@@ -221,7 +221,7 @@ fn rename_self_to_param(
221 let syn = source_file.syntax(); 221 let syn = source_file.syntax();
222 222
223 let text = sema.db.file_text(position.file_id); 223 let text = sema.db.file_text(position.file_id);
224 let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; 224 let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?;
225 let search_range = fn_def.syntax().text_range(); 225 let search_range = fn_def.syntax().text_range();
226 226
227 let mut edits: Vec<SourceFileEdit> = vec![]; 227 let mut edits: Vec<SourceFileEdit> = vec![];
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index f612835c2..3b7162b84 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -102,7 +102,7 @@ pub(crate) fn runnable(
102) -> Option<Runnable> { 102) -> Option<Runnable> {
103 match_ast! { 103 match_ast! {
104 match item { 104 match item {
105 ast::FnDef(it) => runnable_fn(sema, it, file_id), 105 ast::Fn(it) => runnable_fn(sema, it, file_id),
106 ast::Module(it) => runnable_mod(sema, it, file_id), 106 ast::Module(it) => runnable_mod(sema, it, file_id),
107 _ => None, 107 _ => None,
108 } 108 }
@@ -111,7 +111,7 @@ pub(crate) fn runnable(
111 111
112fn runnable_fn( 112fn runnable_fn(
113 sema: &Semantics<RootDatabase>, 113 sema: &Semantics<RootDatabase>,
114 fn_def: ast::FnDef, 114 fn_def: ast::Fn,
115 file_id: FileId, 115 file_id: FileId,
116) -> Option<Runnable> { 116) -> Option<Runnable> {
117 let name_string = fn_def.name()?.text().to_string(); 117 let name_string = fn_def.name()?.text().to_string();
@@ -188,7 +188,7 @@ pub struct TestAttr {
188} 188}
189 189
190impl TestAttr { 190impl TestAttr {
191 fn from_fn(fn_def: &ast::FnDef) -> TestAttr { 191 fn from_fn(fn_def: &ast::Fn) -> TestAttr {
192 let ignore = fn_def 192 let ignore = fn_def
193 .attrs() 193 .attrs()
194 .filter_map(|attr| attr.simple_name()) 194 .filter_map(|attr| attr.simple_name())
@@ -203,7 +203,7 @@ impl TestAttr {
203/// 203///
204/// It may produce false positives, for example, `#[wasm_bindgen_test]` requires a different command to run the test, 204/// It may produce false positives, for example, `#[wasm_bindgen_test]` requires a different command to run the test,
205/// but it's better than not to have the runnables for the tests at all. 205/// but it's better than not to have the runnables for the tests at all.
206fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool { 206fn has_test_related_attribute(fn_def: &ast::Fn) -> bool {
207 fn_def 207 fn_def
208 .attrs() 208 .attrs()
209 .filter_map(|attr| attr.path()) 209 .filter_map(|attr| attr.path())
@@ -211,7 +211,7 @@ fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool {
211 .any(|attribute_text| attribute_text.contains("test")) 211 .any(|attribute_text| attribute_text.contains("test"))
212} 212}
213 213
214fn has_doc_test(fn_def: &ast::FnDef) -> bool { 214fn has_doc_test(fn_def: &ast::Fn) -> bool {
215 fn_def.doc_comment_text().map_or(false, |comment| comment.contains("```")) 215 fn_def.doc_comment_text().map_or(false, |comment| comment.contains("```"))
216} 216}
217 217
@@ -246,7 +246,7 @@ fn has_test_function_or_multiple_test_submodules(module: &ast::Module) -> bool {
246 246
247 for item in item_list.items() { 247 for item in item_list.items() {
248 match item { 248 match item {
249 ast::Item::FnDef(f) => { 249 ast::Item::Fn(f) => {
250 if has_test_related_attribute(&f) { 250 if has_test_related_attribute(&f) {
251 return true; 251 return true;
252 } 252 }
@@ -320,7 +320,7 @@ fn bench() {}
320 4..8, 320 4..8,
321 ), 321 ),
322 name: "main", 322 name: "main",
323 kind: FN_DEF, 323 kind: FN,
324 container_name: None, 324 container_name: None,
325 description: None, 325 description: None,
326 docs: None, 326 docs: None,
@@ -338,7 +338,7 @@ fn bench() {}
338 26..34, 338 26..34,
339 ), 339 ),
340 name: "test_foo", 340 name: "test_foo",
341 kind: FN_DEF, 341 kind: FN,
342 container_name: None, 342 container_name: None,
343 description: None, 343 description: None,
344 docs: None, 344 docs: None,
@@ -363,7 +363,7 @@ fn bench() {}
363 62..70, 363 62..70,
364 ), 364 ),
365 name: "test_foo", 365 name: "test_foo",
366 kind: FN_DEF, 366 kind: FN,
367 container_name: None, 367 container_name: None,
368 description: None, 368 description: None,
369 docs: None, 369 docs: None,
@@ -388,7 +388,7 @@ fn bench() {}
388 89..94, 388 89..94,
389 ), 389 ),
390 name: "bench", 390 name: "bench",
391 kind: FN_DEF, 391 kind: FN,
392 container_name: None, 392 container_name: None,
393 description: None, 393 description: None,
394 docs: None, 394 docs: None,
@@ -431,7 +431,7 @@ fn foo() {}
431 4..8, 431 4..8,
432 ), 432 ),
433 name: "main", 433 name: "main",
434 kind: FN_DEF, 434 kind: FN,
435 container_name: None, 435 container_name: None,
436 description: None, 436 description: None,
437 docs: None, 437 docs: None,
@@ -447,7 +447,7 @@ fn foo() {}
447 full_range: 15..57, 447 full_range: 15..57,
448 focus_range: None, 448 focus_range: None,
449 name: "foo", 449 name: "foo",
450 kind: FN_DEF, 450 kind: FN,
451 container_name: None, 451 container_name: None,
452 description: None, 452 description: None,
453 docs: None, 453 docs: None,
@@ -493,7 +493,7 @@ impl Data {
493 4..8, 493 4..8,
494 ), 494 ),
495 name: "main", 495 name: "main",
496 kind: FN_DEF, 496 kind: FN,
497 container_name: None, 497 container_name: None,
498 description: None, 498 description: None,
499 docs: None, 499 docs: None,
@@ -509,7 +509,7 @@ impl Data {
509 full_range: 44..98, 509 full_range: 44..98,
510 focus_range: None, 510 focus_range: None,
511 name: "foo", 511 name: "foo",
512 kind: FN_DEF, 512 kind: FN,
513 container_name: None, 513 container_name: None,
514 description: None, 514 description: None,
515 docs: None, 515 docs: None,
@@ -570,7 +570,7 @@ mod test_mod {
570 35..44, 570 35..44,
571 ), 571 ),
572 name: "test_foo1", 572 name: "test_foo1",
573 kind: FN_DEF, 573 kind: FN,
574 container_name: None, 574 container_name: None,
575 description: None, 575 description: None,
576 docs: None, 576 docs: None,
@@ -670,7 +670,7 @@ mod root_tests {
670 107..121, 670 107..121,
671 ), 671 ),
672 name: "nested_test_11", 672 name: "nested_test_11",
673 kind: FN_DEF, 673 kind: FN,
674 container_name: None, 674 container_name: None,
675 description: None, 675 description: None,
676 docs: None, 676 docs: None,
@@ -695,7 +695,7 @@ mod root_tests {
695 163..177, 695 163..177,
696 ), 696 ),
697 name: "nested_test_12", 697 name: "nested_test_12",
698 kind: FN_DEF, 698 kind: FN,
699 container_name: None, 699 container_name: None,
700 description: None, 700 description: None,
701 docs: None, 701 docs: None,
@@ -740,7 +740,7 @@ mod root_tests {
740 258..271, 740 258..271,
741 ), 741 ),
742 name: "nested_test_2", 742 name: "nested_test_2",
743 kind: FN_DEF, 743 kind: FN,
744 container_name: None, 744 container_name: None,
745 description: None, 745 description: None,
746 docs: None, 746 docs: None,
@@ -783,7 +783,7 @@ fn test_foo1() {}
783 36..45, 783 36..45,
784 ), 784 ),
785 name: "test_foo1", 785 name: "test_foo1",
786 kind: FN_DEF, 786 kind: FN,
787 container_name: None, 787 container_name: None,
788 description: None, 788 description: None,
789 docs: None, 789 docs: None,
@@ -831,7 +831,7 @@ fn test_foo1() {}
831 58..67, 831 58..67,
832 ), 832 ),
833 name: "test_foo1", 833 name: "test_foo1",
834 kind: FN_DEF, 834 kind: FN,
835 container_name: None, 835 container_name: None,
836 description: None, 836 description: None,
837 docs: None, 837 docs: None,
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index d456d5d36..8d52fb6e4 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -464,7 +464,7 @@ fn highlight_element(
464 let db = sema.db; 464 let db = sema.db;
465 let mut binding_hash = None; 465 let mut binding_hash = None;
466 let highlight: Highlight = match element.kind() { 466 let highlight: Highlight = match element.kind() {
467 FN_DEF => { 467 FN => {
468 bindings_shadow_count.clear(); 468 bindings_shadow_count.clear();
469 return None; 469 return None;
470 } 470 }
@@ -709,11 +709,11 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
709 ENUM_DEF => HighlightTag::Enum, 709 ENUM_DEF => HighlightTag::Enum,
710 UNION_DEF => HighlightTag::Union, 710 UNION_DEF => HighlightTag::Union,
711 TRAIT_DEF => HighlightTag::Trait, 711 TRAIT_DEF => HighlightTag::Trait,
712 TYPE_ALIAS_DEF => HighlightTag::TypeAlias, 712 TYPE_ALIAS => HighlightTag::TypeAlias,
713 TYPE_PARAM => HighlightTag::TypeParam, 713 TYPE_PARAM => HighlightTag::TypeParam,
714 RECORD_FIELD_DEF => HighlightTag::Field, 714 RECORD_FIELD_DEF => HighlightTag::Field,
715 MODULE => HighlightTag::Module, 715 MODULE => HighlightTag::Module,
716 FN_DEF => HighlightTag::Function, 716 FN => HighlightTag::Function,
717 CONST_DEF => HighlightTag::Constant, 717 CONST_DEF => HighlightTag::Constant,
718 STATIC_DEF => HighlightTag::Static, 718 STATIC_DEF => HighlightTag::Static,
719 ENUM_VARIANT => HighlightTag::EnumVariant, 719 ENUM_VARIANT => HighlightTag::EnumVariant,
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs
index f716a3861..07217e808 100644
--- a/crates/ra_ide/src/syntax_tree.rs
+++ b/crates/ra_ide/src/syntax_tree.rs
@@ -116,7 +116,7 @@ mod tests {
116 syn.trim(), 116 syn.trim(),
117 r#" 117 r#"
118[email protected] 118[email protected]
119 FN_DEF@0..11 119 [email protected]
120 [email protected] "fn" 120 [email protected] "fn"
121 [email protected] " " 121 [email protected] " "
122 [email protected] 122 [email protected]
@@ -148,7 +148,7 @@ fn test() {
148 syn.trim(), 148 syn.trim(),
149 r#" 149 r#"
150[email protected] 150[email protected]
151 FN_DEF@0..60 151 [email protected]
152 [email protected] "fn" 152 [email protected] "fn"
153 [email protected] " " 153 [email protected] " "
154 [email protected] 154 [email protected]
@@ -190,7 +190,7 @@ [email protected]
190 assert_eq_text!( 190 assert_eq_text!(
191 syn.trim(), 191 syn.trim(),
192 r#" 192 r#"
193FN_DEF@0..11 193[email protected]
194 [email protected] "fn" 194 [email protected] "fn"
195 [email protected] " " 195 [email protected] " "
196 [email protected] 196 [email protected]
@@ -258,7 +258,7 @@ fn bar() {
258 syn.trim(), 258 syn.trim(),
259 r#" 259 r#"
260[email protected] 260[email protected]
261 FN_DEF@0..12 261 [email protected]
262 [email protected] "fn" 262 [email protected] "fn"
263 [email protected] " " 263 [email protected] " "
264 [email protected] 264 [email protected]
@@ -292,7 +292,7 @@ fn bar() {
292 syn.trim(), 292 syn.trim(),
293 r#" 293 r#"
294[email protected] 294[email protected]
295 FN_DEF@0..12 295 [email protected]
296 [email protected] "fn" 296 [email protected] "fn"
297 [email protected] " " 297 [email protected] " "
298 [email protected] 298 [email protected]
@@ -325,7 +325,7 @@ fn bar() {
325 syn.trim(), 325 syn.trim(),
326 r#" 326 r#"
327[email protected] 327[email protected]
328 FN_DEF@0..12 328 [email protected]
329 [email protected] "fn" 329 [email protected] "fn"
330 [email protected] " " 330 [email protected] " "
331 [email protected] 331 [email protected]
@@ -339,7 +339,7 @@ [email protected]
339 [email protected] "\n" 339 [email protected] "\n"
340 [email protected] "}" 340 [email protected] "}"
341 [email protected] "\n" 341 [email protected] "\n"
342 FN_DEF@13..25 342 [email protected]
343 [email protected] "fn" 343 [email protected] "fn"
344 [email protected] " " 344 [email protected] " "
345 [email protected] 345 [email protected]
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 1464c5f2a..0e73a8932 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -174,7 +174,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
174 let def: hir::EnumVariant = sema.to_def(&it)?; 174 let def: hir::EnumVariant = sema.to_def(&it)?;
175 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 175 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
176 }, 176 },
177 ast::FnDef(it) => { 177 ast::Fn(it) => {
178 let def: hir::Function = sema.to_def(&it)?; 178 let def: hir::Function = sema.to_def(&it)?;
179 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 179 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
180 }, 180 },
@@ -182,7 +182,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
182 let def: hir::Const = sema.to_def(&it)?; 182 let def: hir::Const = sema.to_def(&it)?;
183 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 183 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
184 }, 184 },
185 ast::TypeAliasDef(it) => { 185 ast::TypeAlias(it) => {
186 let def: hir::TypeAlias = sema.to_def(&it)?; 186 let def: hir::TypeAlias = sema.to_def(&it)?;
187 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 187 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
188 }, 188 },
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs
index 131e2a128..b4e85b88e 100644
--- a/crates/ra_ide_db/src/symbol_index.rs
+++ b/crates/ra_ide_db/src/symbol_index.rs
@@ -344,7 +344,7 @@ impl Query {
344} 344}
345 345
346fn is_type(kind: SyntaxKind) -> bool { 346fn is_type(kind: SyntaxKind) -> bool {
347 matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS_DEF) 347 matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS)
348} 348}
349 349
350/// The actual data that is stored in the index. It should be as compact as 350/// The actual data that is stored in the index. It should be as compact as
@@ -397,12 +397,12 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> {
397 } 397 }
398 match_ast! { 398 match_ast! {
399 match node { 399 match node {
400 ast::FnDef(it) => decl(it), 400 ast::Fn(it) => decl(it),
401 ast::StructDef(it) => decl(it), 401 ast::StructDef(it) => decl(it),
402 ast::EnumDef(it) => decl(it), 402 ast::EnumDef(it) => decl(it),
403 ast::TraitDef(it) => decl(it), 403 ast::TraitDef(it) => decl(it),
404 ast::Module(it) => decl(it), 404 ast::Module(it) => decl(it),
405 ast::TypeAliasDef(it) => decl(it), 405 ast::TypeAlias(it) => decl(it),
406 ast::ConstDef(it) => decl(it), 406 ast::ConstDef(it) => decl(it),
407 ast::StaticDef(it) => decl(it), 407 ast::StaticDef(it) => decl(it),
408 ast::MacroCall(it) => { 408 ast::MacroCall(it) => {
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index c43003fd6..220690cdd 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -258,7 +258,7 @@ fn test_expr_order() {
258 assert_eq_text!( 258 assert_eq_text!(
259 dump.trim(), 259 dump.trim(),
260 r#"[email protected] 260 r#"[email protected]
261 FN_DEF@0..15 261 [email protected]
262 [email protected] "fn" 262 [email protected] "fn"
263 [email protected] 263 [email protected]
264 [email protected] "bar" 264 [email protected] "bar"
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs
index 3b73e5346..664b23f6a 100644
--- a/crates/ra_parser/src/grammar/items.rs
+++ b/crates/ra_parser/src/grammar/items.rs
@@ -180,7 +180,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul
180 // unsafe const fn bar() {} 180 // unsafe const fn bar() {}
181 T![fn] => { 181 T![fn] => {
182 fn_def(p); 182 fn_def(p);
183 m.complete(p, FN_DEF); 183 m.complete(p, FN);
184 } 184 }
185 185
186 // test unsafe_trait 186 // test unsafe_trait
@@ -380,7 +380,7 @@ fn type_def(p: &mut Parser, m: Marker) {
380 types::type_(p); 380 types::type_(p);
381 } 381 }
382 p.expect(T![;]); 382 p.expect(T![;]);
383 m.complete(p, TYPE_ALIAS_DEF); 383 m.complete(p, TYPE_ALIAS);
384} 384}
385 385
386pub(crate) fn mod_item(p: &mut Parser, m: Marker) { 386pub(crate) fn mod_item(p: &mut Parser, m: Marker) {
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs
index 4f35e0baa..b84c3fc79 100644
--- a/crates/ra_parser/src/syntax_kind/generated.rs
+++ b/crates/ra_parser/src/syntax_kind/generated.rs
@@ -126,7 +126,7 @@ pub enum SyntaxKind {
126 STRUCT_DEF, 126 STRUCT_DEF,
127 UNION_DEF, 127 UNION_DEF,
128 ENUM_DEF, 128 ENUM_DEF,
129 FN_DEF, 129 FN,
130 RET_TYPE, 130 RET_TYPE,
131 EXTERN_CRATE, 131 EXTERN_CRATE,
132 MODULE, 132 MODULE,
@@ -135,7 +135,7 @@ pub enum SyntaxKind {
135 CONST_DEF, 135 CONST_DEF,
136 TRAIT_DEF, 136 TRAIT_DEF,
137 IMPL_DEF, 137 IMPL_DEF,
138 TYPE_ALIAS_DEF, 138 TYPE_ALIAS,
139 MACRO_CALL, 139 MACRO_CALL,
140 TOKEN_TREE, 140 TOKEN_TREE,
141 MACRO_DEF, 141 MACRO_DEF,
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs
index 6ebe10ff6..0110300af 100644
--- a/crates/ra_syntax/src/ast/edit.rs
+++ b/crates/ra_syntax/src/ast/edit.rs
@@ -29,9 +29,9 @@ impl ast::BinExpr {
29 } 29 }
30} 30}
31 31
32impl ast::FnDef { 32impl ast::Fn {
33 #[must_use] 33 #[must_use]
34 pub fn with_body(&self, body: ast::BlockExpr) -> ast::FnDef { 34 pub fn with_body(&self, body: ast::BlockExpr) -> ast::Fn {
35 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); 35 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
36 let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { 36 let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() {
37 old_body.syntax().clone().into() 37 old_body.syntax().clone().into()
@@ -192,9 +192,9 @@ impl ast::RecordFieldList {
192 } 192 }
193} 193}
194 194
195impl ast::TypeAliasDef { 195impl ast::TypeAlias {
196 #[must_use] 196 #[must_use]
197 pub fn remove_bounds(&self) -> ast::TypeAliasDef { 197 pub fn remove_bounds(&self) -> ast::TypeAlias {
198 let colon = match self.colon_token() { 198 let colon = match self.colon_token() {
199 Some(it) => it, 199 Some(it) => it,
200 None => return self.clone(), 200 None => return self.clone(),
diff --git a/crates/ra_syntax/src/ast/expr_ext.rs b/crates/ra_syntax/src/ast/expr_ext.rs
index 69c85c809..8692b9bb5 100644
--- a/crates/ra_syntax/src/ast/expr_ext.rs
+++ b/crates/ra_syntax/src/ast/expr_ext.rs
@@ -401,7 +401,7 @@ impl ast::BlockExpr {
401 Some(it) => it, 401 Some(it) => it,
402 None => return true, 402 None => return true,
403 }; 403 };
404 !matches!(parent.kind(), FN_DEF | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR) 404 !matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR)
405 } 405 }
406} 406}
407 407
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index be657699f..ad8ccf1ce 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -79,19 +79,19 @@ impl ExternCrate {
79 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 79 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
80} 80}
81#[derive(Debug, Clone, PartialEq, Eq, Hash)] 81#[derive(Debug, Clone, PartialEq, Eq, Hash)]
82pub struct FnDef { 82pub struct Fn {
83 pub(crate) syntax: SyntaxNode, 83 pub(crate) syntax: SyntaxNode,
84} 84}
85impl ast::AttrsOwner for FnDef {} 85impl ast::AttrsOwner for Fn {}
86impl ast::NameOwner for FnDef {} 86impl ast::NameOwner for Fn {}
87impl ast::VisibilityOwner for FnDef {} 87impl ast::VisibilityOwner for Fn {}
88impl ast::TypeParamsOwner for FnDef {} 88impl ast::TypeParamsOwner for Fn {}
89impl FnDef { 89impl Fn {
90 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
91 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
92 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } 90 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
93 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } 91 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
92 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
94 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } 93 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
94 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
95 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } 95 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
96 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } 96 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
97 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } 97 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
@@ -183,15 +183,15 @@ impl TraitDef {
183 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } 183 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
184} 184}
185#[derive(Debug, Clone, PartialEq, Eq, Hash)] 185#[derive(Debug, Clone, PartialEq, Eq, Hash)]
186pub struct TypeAliasDef { 186pub struct TypeAlias {
187 pub(crate) syntax: SyntaxNode, 187 pub(crate) syntax: SyntaxNode,
188} 188}
189impl ast::AttrsOwner for TypeAliasDef {} 189impl ast::AttrsOwner for TypeAlias {}
190impl ast::NameOwner for TypeAliasDef {} 190impl ast::NameOwner for TypeAlias {}
191impl ast::VisibilityOwner for TypeAliasDef {} 191impl ast::VisibilityOwner for TypeAlias {}
192impl ast::TypeParamsOwner for TypeAliasDef {} 192impl ast::TypeParamsOwner for TypeAlias {}
193impl ast::TypeBoundsOwner for TypeAliasDef {} 193impl ast::TypeBoundsOwner for TypeAlias {}
194impl TypeAliasDef { 194impl TypeAlias {
195 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } 195 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
196 pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } 196 pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) }
197 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } 197 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
@@ -303,7 +303,9 @@ impl UseTreeList {
303pub struct Abi { 303pub struct Abi {
304 pub(crate) syntax: SyntaxNode, 304 pub(crate) syntax: SyntaxNode,
305} 305}
306impl Abi {} 306impl Abi {
307 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
308}
307#[derive(Debug, Clone, PartialEq, Eq, Hash)] 309#[derive(Debug, Clone, PartialEq, Eq, Hash)]
308pub struct TypeParamList { 310pub struct TypeParamList {
309 pub(crate) syntax: SyntaxNode, 311 pub(crate) syntax: SyntaxNode,
@@ -321,8 +323,9 @@ pub struct ParamList {
321} 323}
322impl ParamList { 324impl ParamList {
323 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } 325 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
324 pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
325 pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } 326 pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
327 pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
328 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
326 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } 329 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
327} 330}
328#[derive(Debug, Clone, PartialEq, Eq, Hash)] 331#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -355,6 +358,39 @@ impl BlockExpr {
355 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } 358 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
356} 359}
357#[derive(Debug, Clone, PartialEq, Eq, Hash)] 360#[derive(Debug, Clone, PartialEq, Eq, Hash)]
361pub struct Param {
362 pub(crate) syntax: SyntaxNode,
363}
364impl ast::AttrsOwner for Param {}
365impl ast::TypeAscriptionOwner for Param {}
366impl Param {
367 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
368 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
369 pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
370}
371#[derive(Debug, Clone, PartialEq, Eq, Hash)]
372pub struct SelfParam {
373 pub(crate) syntax: SyntaxNode,
374}
375impl ast::AttrsOwner for SelfParam {}
376impl ast::TypeAscriptionOwner for SelfParam {}
377impl SelfParam {
378 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
379 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
380 support::token(&self.syntax, T![lifetime])
381 }
382 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
383 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
384 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
385}
386#[derive(Debug, Clone, PartialEq, Eq, Hash)]
387pub struct TypeBoundList {
388 pub(crate) syntax: SyntaxNode,
389}
390impl TypeBoundList {
391 pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
392}
393#[derive(Debug, Clone, PartialEq, Eq, Hash)]
358pub struct RecordFieldDefList { 394pub struct RecordFieldDefList {
359 pub(crate) syntax: SyntaxNode, 395 pub(crate) syntax: SyntaxNode,
360} 396}
@@ -415,13 +451,6 @@ impl EnumVariant {
415 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 451 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
416} 452}
417#[derive(Debug, Clone, PartialEq, Eq, Hash)] 453#[derive(Debug, Clone, PartialEq, Eq, Hash)]
418pub struct TypeBoundList {
419 pub(crate) syntax: SyntaxNode,
420}
421impl TypeBoundList {
422 pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
423}
424#[derive(Debug, Clone, PartialEq, Eq, Hash)]
425pub struct AssocItemList { 454pub struct AssocItemList {
426 pub(crate) syntax: SyntaxNode, 455 pub(crate) syntax: SyntaxNode,
427} 456}
@@ -1173,32 +1202,6 @@ impl LetStmt {
1173 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 1202 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1174} 1203}
1175#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1204#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1176pub struct SelfParam {
1177 pub(crate) syntax: SyntaxNode,
1178}
1179impl ast::AttrsOwner for SelfParam {}
1180impl ast::TypeAscriptionOwner for SelfParam {}
1181impl SelfParam {
1182 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1183 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
1184 support::token(&self.syntax, T![lifetime])
1185 }
1186 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1187 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
1188 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1189}
1190#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1191pub struct Param {
1192 pub(crate) syntax: SyntaxNode,
1193}
1194impl ast::AttrsOwner for Param {}
1195impl ast::TypeAscriptionOwner for Param {}
1196impl Param {
1197 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1198 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1199 pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
1200}
1201#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1202pub struct PathSegment { 1205pub struct PathSegment {
1203 pub(crate) syntax: SyntaxNode, 1206 pub(crate) syntax: SyntaxNode,
1204} 1207}
@@ -1274,14 +1277,14 @@ pub enum Item {
1274 EnumDef(EnumDef), 1277 EnumDef(EnumDef),
1275 ExternBlock(ExternBlock), 1278 ExternBlock(ExternBlock),
1276 ExternCrate(ExternCrate), 1279 ExternCrate(ExternCrate),
1277 FnDef(FnDef), 1280 Fn(Fn),
1278 ImplDef(ImplDef), 1281 ImplDef(ImplDef),
1279 MacroCall(MacroCall), 1282 MacroCall(MacroCall),
1280 Module(Module), 1283 Module(Module),
1281 StaticDef(StaticDef), 1284 StaticDef(StaticDef),
1282 StructDef(StructDef), 1285 StructDef(StructDef),
1283 TraitDef(TraitDef), 1286 TraitDef(TraitDef),
1284 TypeAliasDef(TypeAliasDef), 1287 TypeAlias(TypeAlias),
1285 UnionDef(UnionDef), 1288 UnionDef(UnionDef),
1286 Use(Use), 1289 Use(Use),
1287} 1290}
@@ -1303,6 +1306,24 @@ pub enum TypeRef {
1303 DynTraitType(DynTraitType), 1306 DynTraitType(DynTraitType),
1304} 1307}
1305#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1308#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1309pub enum Pat {
1310 OrPat(OrPat),
1311 ParenPat(ParenPat),
1312 RefPat(RefPat),
1313 BoxPat(BoxPat),
1314 BindPat(BindPat),
1315 PlaceholderPat(PlaceholderPat),
1316 DotDotPat(DotDotPat),
1317 PathPat(PathPat),
1318 RecordPat(RecordPat),
1319 TupleStructPat(TupleStructPat),
1320 TuplePat(TuplePat),
1321 SlicePat(SlicePat),
1322 RangePat(RangePat),
1323 LiteralPat(LiteralPat),
1324 MacroPat(MacroPat),
1325}
1326#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1306pub enum FieldDefList { 1327pub enum FieldDefList {
1307 RecordFieldDefList(RecordFieldDefList), 1328 RecordFieldDefList(RecordFieldDefList),
1308 TupleFieldDefList(TupleFieldDefList), 1329 TupleFieldDefList(TupleFieldDefList),
@@ -1343,32 +1364,14 @@ pub enum Expr {
1343} 1364}
1344#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1365#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1345pub enum AssocItem { 1366pub enum AssocItem {
1346 FnDef(FnDef), 1367 Fn(Fn),
1347 TypeAliasDef(TypeAliasDef), 1368 TypeAlias(TypeAlias),
1348 ConstDef(ConstDef), 1369 ConstDef(ConstDef),
1349 MacroCall(MacroCall), 1370 MacroCall(MacroCall),
1350} 1371}
1351impl ast::AttrsOwner for AssocItem {} 1372impl ast::AttrsOwner for AssocItem {}
1352impl ast::NameOwner for AssocItem {} 1373impl ast::NameOwner for AssocItem {}
1353#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1374#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1354pub enum Pat {
1355 OrPat(OrPat),
1356 ParenPat(ParenPat),
1357 RefPat(RefPat),
1358 BoxPat(BoxPat),
1359 BindPat(BindPat),
1360 PlaceholderPat(PlaceholderPat),
1361 DotDotPat(DotDotPat),
1362 PathPat(PathPat),
1363 RecordPat(RecordPat),
1364 TupleStructPat(TupleStructPat),
1365 TuplePat(TuplePat),
1366 SlicePat(SlicePat),
1367 RangePat(RangePat),
1368 LiteralPat(LiteralPat),
1369 MacroPat(MacroPat),
1370}
1371#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1372pub enum Stmt { 1375pub enum Stmt {
1373 LetStmt(LetStmt), 1376 LetStmt(LetStmt),
1374 ExprStmt(ExprStmt), 1377 ExprStmt(ExprStmt),
@@ -1381,7 +1384,7 @@ pub enum AttrInput {
1381} 1384}
1382#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1385#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1383pub enum ExternItem { 1386pub enum ExternItem {
1384 FnDef(FnDef), 1387 Fn(Fn),
1385 StaticDef(StaticDef), 1388 StaticDef(StaticDef),
1386} 1389}
1387impl ast::AttrsOwner for ExternItem {} 1390impl ast::AttrsOwner for ExternItem {}
@@ -1463,8 +1466,8 @@ impl AstNode for ExternCrate {
1463 } 1466 }
1464 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1467 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1465} 1468}
1466impl AstNode for FnDef { 1469impl AstNode for Fn {
1467 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_DEF } 1470 fn can_cast(kind: SyntaxKind) -> bool { kind == FN }
1468 fn cast(syntax: SyntaxNode) -> Option<Self> { 1471 fn cast(syntax: SyntaxNode) -> Option<Self> {
1469 if Self::can_cast(syntax.kind()) { 1472 if Self::can_cast(syntax.kind()) {
1470 Some(Self { syntax }) 1473 Some(Self { syntax })
@@ -1540,8 +1543,8 @@ impl AstNode for TraitDef {
1540 } 1543 }
1541 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1544 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1542} 1545}
1543impl AstNode for TypeAliasDef { 1546impl AstNode for TypeAlias {
1544 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS_DEF } 1547 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS }
1545 fn cast(syntax: SyntaxNode) -> Option<Self> { 1548 fn cast(syntax: SyntaxNode) -> Option<Self> {
1546 if Self::can_cast(syntax.kind()) { 1549 if Self::can_cast(syntax.kind()) {
1547 Some(Self { syntax }) 1550 Some(Self { syntax })
@@ -1727,6 +1730,39 @@ impl AstNode for BlockExpr {
1727 } 1730 }
1728 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1731 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1729} 1732}
1733impl AstNode for Param {
1734 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM }
1735 fn cast(syntax: SyntaxNode) -> Option<Self> {
1736 if Self::can_cast(syntax.kind()) {
1737 Some(Self { syntax })
1738 } else {
1739 None
1740 }
1741 }
1742 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1743}
1744impl AstNode for SelfParam {
1745 fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM }
1746 fn cast(syntax: SyntaxNode) -> Option<Self> {
1747 if Self::can_cast(syntax.kind()) {
1748 Some(Self { syntax })
1749 } else {
1750 None
1751 }
1752 }
1753 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1754}
1755impl AstNode for TypeBoundList {
1756 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
1757 fn cast(syntax: SyntaxNode) -> Option<Self> {
1758 if Self::can_cast(syntax.kind()) {
1759 Some(Self { syntax })
1760 } else {
1761 None
1762 }
1763 }
1764 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1765}
1730impl AstNode for RecordFieldDefList { 1766impl AstNode for RecordFieldDefList {
1731 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST } 1767 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST }
1732 fn cast(syntax: SyntaxNode) -> Option<Self> { 1768 fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -1793,17 +1829,6 @@ impl AstNode for EnumVariant {
1793 } 1829 }
1794 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1830 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1795} 1831}
1796impl AstNode for TypeBoundList {
1797 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
1798 fn cast(syntax: SyntaxNode) -> Option<Self> {
1799 if Self::can_cast(syntax.kind()) {
1800 Some(Self { syntax })
1801 } else {
1802 None
1803 }
1804 }
1805 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1806}
1807impl AstNode for AssocItemList { 1832impl AstNode for AssocItemList {
1808 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST } 1833 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST }
1809 fn cast(syntax: SyntaxNode) -> Option<Self> { 1834 fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2673,28 +2698,6 @@ impl AstNode for LetStmt {
2673 } 2698 }
2674 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2699 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2675} 2700}
2676impl AstNode for SelfParam {
2677 fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM }
2678 fn cast(syntax: SyntaxNode) -> Option<Self> {
2679 if Self::can_cast(syntax.kind()) {
2680 Some(Self { syntax })
2681 } else {
2682 None
2683 }
2684 }
2685 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2686}
2687impl AstNode for Param {
2688 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM }
2689 fn cast(syntax: SyntaxNode) -> Option<Self> {
2690 if Self::can_cast(syntax.kind()) {
2691 Some(Self { syntax })
2692 } else {
2693 None
2694 }
2695 }
2696 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2697}
2698impl AstNode for PathSegment { 2701impl AstNode for PathSegment {
2699 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } 2702 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
2700 fn cast(syntax: SyntaxNode) -> Option<Self> { 2703 fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2784,8 +2787,8 @@ impl From<ExternBlock> for Item {
2784impl From<ExternCrate> for Item { 2787impl From<ExternCrate> for Item {
2785 fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } 2788 fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
2786} 2789}
2787impl From<FnDef> for Item { 2790impl From<Fn> for Item {
2788 fn from(node: FnDef) -> Item { Item::FnDef(node) } 2791 fn from(node: Fn) -> Item { Item::Fn(node) }
2789} 2792}
2790impl From<ImplDef> for Item { 2793impl From<ImplDef> for Item {
2791 fn from(node: ImplDef) -> Item { Item::ImplDef(node) } 2794 fn from(node: ImplDef) -> Item { Item::ImplDef(node) }
@@ -2805,8 +2808,8 @@ impl From<StructDef> for Item {
2805impl From<TraitDef> for Item { 2808impl From<TraitDef> for Item {
2806 fn from(node: TraitDef) -> Item { Item::TraitDef(node) } 2809 fn from(node: TraitDef) -> Item { Item::TraitDef(node) }
2807} 2810}
2808impl From<TypeAliasDef> for Item { 2811impl From<TypeAlias> for Item {
2809 fn from(node: TypeAliasDef) -> Item { Item::TypeAliasDef(node) } 2812 fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
2810} 2813}
2811impl From<UnionDef> for Item { 2814impl From<UnionDef> for Item {
2812 fn from(node: UnionDef) -> Item { Item::UnionDef(node) } 2815 fn from(node: UnionDef) -> Item { Item::UnionDef(node) }
@@ -2817,10 +2820,8 @@ impl From<Use> for Item {
2817impl AstNode for Item { 2820impl AstNode for Item {
2818 fn can_cast(kind: SyntaxKind) -> bool { 2821 fn can_cast(kind: SyntaxKind) -> bool {
2819 match kind { 2822 match kind {
2820 CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL 2823 CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL
2821 | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF | USE => { 2824 | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS | UNION_DEF | USE => true,
2822 true
2823 }
2824 _ => false, 2825 _ => false,
2825 } 2826 }
2826 } 2827 }
@@ -2830,14 +2831,14 @@ impl AstNode for Item {
2830 ENUM_DEF => Item::EnumDef(EnumDef { syntax }), 2831 ENUM_DEF => Item::EnumDef(EnumDef { syntax }),
2831 EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), 2832 EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }),
2832 EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), 2833 EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }),
2833 FN_DEF => Item::FnDef(FnDef { syntax }), 2834 FN => Item::Fn(Fn { syntax }),
2834 IMPL_DEF => Item::ImplDef(ImplDef { syntax }), 2835 IMPL_DEF => Item::ImplDef(ImplDef { syntax }),
2835 MACRO_CALL => Item::MacroCall(MacroCall { syntax }), 2836 MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
2836 MODULE => Item::Module(Module { syntax }), 2837 MODULE => Item::Module(Module { syntax }),
2837 STATIC_DEF => Item::StaticDef(StaticDef { syntax }), 2838 STATIC_DEF => Item::StaticDef(StaticDef { syntax }),
2838 STRUCT_DEF => Item::StructDef(StructDef { syntax }), 2839 STRUCT_DEF => Item::StructDef(StructDef { syntax }),
2839 TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), 2840 TRAIT_DEF => Item::TraitDef(TraitDef { syntax }),
2840 TYPE_ALIAS_DEF => Item::TypeAliasDef(TypeAliasDef { syntax }), 2841 TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
2841 UNION_DEF => Item::UnionDef(UnionDef { syntax }), 2842 UNION_DEF => Item::UnionDef(UnionDef { syntax }),
2842 USE => Item::Use(Use { syntax }), 2843 USE => Item::Use(Use { syntax }),
2843 _ => return None, 2844 _ => return None,
@@ -2850,14 +2851,14 @@ impl AstNode for Item {
2850 Item::EnumDef(it) => &it.syntax, 2851 Item::EnumDef(it) => &it.syntax,
2851 Item::ExternBlock(it) => &it.syntax, 2852 Item::ExternBlock(it) => &it.syntax,
2852 Item::ExternCrate(it) => &it.syntax, 2853 Item::ExternCrate(it) => &it.syntax,
2853 Item::FnDef(it) => &it.syntax, 2854 Item::Fn(it) => &it.syntax,
2854 Item::ImplDef(it) => &it.syntax, 2855 Item::ImplDef(it) => &it.syntax,
2855 Item::MacroCall(it) => &it.syntax, 2856 Item::MacroCall(it) => &it.syntax,
2856 Item::Module(it) => &it.syntax, 2857 Item::Module(it) => &it.syntax,
2857 Item::StaticDef(it) => &it.syntax, 2858 Item::StaticDef(it) => &it.syntax,
2858 Item::StructDef(it) => &it.syntax, 2859 Item::StructDef(it) => &it.syntax,
2859 Item::TraitDef(it) => &it.syntax, 2860 Item::TraitDef(it) => &it.syntax,
2860 Item::TypeAliasDef(it) => &it.syntax, 2861 Item::TypeAlias(it) => &it.syntax,
2861 Item::UnionDef(it) => &it.syntax, 2862 Item::UnionDef(it) => &it.syntax,
2862 Item::Use(it) => &it.syntax, 2863 Item::Use(it) => &it.syntax,
2863 } 2864 }
@@ -2948,6 +2949,101 @@ impl AstNode for TypeRef {
2948 } 2949 }
2949 } 2950 }
2950} 2951}
2952impl From<OrPat> for Pat {
2953 fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
2954}
2955impl From<ParenPat> for Pat {
2956 fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
2957}
2958impl From<RefPat> for Pat {
2959 fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
2960}
2961impl From<BoxPat> for Pat {
2962 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
2963}
2964impl From<BindPat> for Pat {
2965 fn from(node: BindPat) -> Pat { Pat::BindPat(node) }
2966}
2967impl From<PlaceholderPat> for Pat {
2968 fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) }
2969}
2970impl From<DotDotPat> for Pat {
2971 fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) }
2972}
2973impl From<PathPat> for Pat {
2974 fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
2975}
2976impl From<RecordPat> for Pat {
2977 fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
2978}
2979impl From<TupleStructPat> for Pat {
2980 fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
2981}
2982impl From<TuplePat> for Pat {
2983 fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
2984}
2985impl From<SlicePat> for Pat {
2986 fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
2987}
2988impl From<RangePat> for Pat {
2989 fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
2990}
2991impl From<LiteralPat> for Pat {
2992 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
2993}
2994impl From<MacroPat> for Pat {
2995 fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
2996}
2997impl AstNode for Pat {
2998 fn can_cast(kind: SyntaxKind) -> bool {
2999 match kind {
3000 OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT
3001 | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT
3002 | LITERAL_PAT | MACRO_PAT => true,
3003 _ => false,
3004 }
3005 }
3006 fn cast(syntax: SyntaxNode) -> Option<Self> {
3007 let res = match syntax.kind() {
3008 OR_PAT => Pat::OrPat(OrPat { syntax }),
3009 PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
3010 REF_PAT => Pat::RefPat(RefPat { syntax }),
3011 BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
3012 BIND_PAT => Pat::BindPat(BindPat { syntax }),
3013 PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }),
3014 DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }),
3015 PATH_PAT => Pat::PathPat(PathPat { syntax }),
3016 RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
3017 TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
3018 TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
3019 SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
3020 RANGE_PAT => Pat::RangePat(RangePat { syntax }),
3021 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
3022 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
3023 _ => return None,
3024 };
3025 Some(res)
3026 }
3027 fn syntax(&self) -> &SyntaxNode {
3028 match self {
3029 Pat::OrPat(it) => &it.syntax,
3030 Pat::ParenPat(it) => &it.syntax,
3031 Pat::RefPat(it) => &it.syntax,
3032 Pat::BoxPat(it) => &it.syntax,
3033 Pat::BindPat(it) => &it.syntax,
3034 Pat::PlaceholderPat(it) => &it.syntax,
3035 Pat::DotDotPat(it) => &it.syntax,
3036 Pat::PathPat(it) => &it.syntax,
3037 Pat::RecordPat(it) => &it.syntax,
3038 Pat::TupleStructPat(it) => &it.syntax,
3039 Pat::TuplePat(it) => &it.syntax,
3040 Pat::SlicePat(it) => &it.syntax,
3041 Pat::RangePat(it) => &it.syntax,
3042 Pat::LiteralPat(it) => &it.syntax,
3043 Pat::MacroPat(it) => &it.syntax,
3044 }
3045 }
3046}
2951impl From<RecordFieldDefList> for FieldDefList { 3047impl From<RecordFieldDefList> for FieldDefList {
2952 fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) } 3048 fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) }
2953} 3049}
@@ -3157,11 +3253,11 @@ impl AstNode for Expr {
3157 } 3253 }
3158 } 3254 }
3159} 3255}
3160impl From<FnDef> for AssocItem { 3256impl From<Fn> for AssocItem {
3161 fn from(node: FnDef) -> AssocItem { AssocItem::FnDef(node) } 3257 fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
3162} 3258}
3163impl From<TypeAliasDef> for AssocItem { 3259impl From<TypeAlias> for AssocItem {
3164 fn from(node: TypeAliasDef) -> AssocItem { AssocItem::TypeAliasDef(node) } 3260 fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
3165} 3261}
3166impl From<ConstDef> for AssocItem { 3262impl From<ConstDef> for AssocItem {
3167 fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } 3263 fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) }
@@ -3172,14 +3268,14 @@ impl From<MacroCall> for AssocItem {
3172impl AstNode for AssocItem { 3268impl AstNode for AssocItem {
3173 fn can_cast(kind: SyntaxKind) -> bool { 3269 fn can_cast(kind: SyntaxKind) -> bool {
3174 match kind { 3270 match kind {
3175 FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, 3271 FN | TYPE_ALIAS | CONST_DEF | MACRO_CALL => true,
3176 _ => false, 3272 _ => false,
3177 } 3273 }
3178 } 3274 }
3179 fn cast(syntax: SyntaxNode) -> Option<Self> { 3275 fn cast(syntax: SyntaxNode) -> Option<Self> {
3180 let res = match syntax.kind() { 3276 let res = match syntax.kind() {
3181 FN_DEF => AssocItem::FnDef(FnDef { syntax }), 3277 FN => AssocItem::Fn(Fn { syntax }),
3182 TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), 3278 TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
3183 CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), 3279 CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }),
3184 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), 3280 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
3185 _ => return None, 3281 _ => return None,
@@ -3188,108 +3284,13 @@ impl AstNode for AssocItem {
3188 } 3284 }
3189 fn syntax(&self) -> &SyntaxNode { 3285 fn syntax(&self) -> &SyntaxNode {
3190 match self { 3286 match self {
3191 AssocItem::FnDef(it) => &it.syntax, 3287 AssocItem::Fn(it) => &it.syntax,
3192 AssocItem::TypeAliasDef(it) => &it.syntax, 3288 AssocItem::TypeAlias(it) => &it.syntax,
3193 AssocItem::ConstDef(it) => &it.syntax, 3289 AssocItem::ConstDef(it) => &it.syntax,
3194 AssocItem::MacroCall(it) => &it.syntax, 3290 AssocItem::MacroCall(it) => &it.syntax,
3195 } 3291 }
3196 } 3292 }
3197} 3293}
3198impl From<OrPat> for Pat {
3199 fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
3200}
3201impl From<ParenPat> for Pat {
3202 fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
3203}
3204impl From<RefPat> for Pat {
3205 fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
3206}
3207impl From<BoxPat> for Pat {
3208 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
3209}
3210impl From<BindPat> for Pat {
3211 fn from(node: BindPat) -> Pat { Pat::BindPat(node) }
3212}
3213impl From<PlaceholderPat> for Pat {
3214 fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) }
3215}
3216impl From<DotDotPat> for Pat {
3217 fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) }
3218}
3219impl From<PathPat> for Pat {
3220 fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
3221}
3222impl From<RecordPat> for Pat {
3223 fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
3224}
3225impl From<TupleStructPat> for Pat {
3226 fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
3227}
3228impl From<TuplePat> for Pat {
3229 fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
3230}
3231impl From<SlicePat> for Pat {
3232 fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
3233}
3234impl From<RangePat> for Pat {
3235 fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
3236}
3237impl From<LiteralPat> for Pat {
3238 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
3239}
3240impl From<MacroPat> for Pat {
3241 fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
3242}
3243impl AstNode for Pat {
3244 fn can_cast(kind: SyntaxKind) -> bool {
3245 match kind {
3246 OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT
3247 | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT
3248 | LITERAL_PAT | MACRO_PAT => true,
3249 _ => false,
3250 }
3251 }
3252 fn cast(syntax: SyntaxNode) -> Option<Self> {
3253 let res = match syntax.kind() {
3254 OR_PAT => Pat::OrPat(OrPat { syntax }),
3255 PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
3256 REF_PAT => Pat::RefPat(RefPat { syntax }),
3257 BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
3258 BIND_PAT => Pat::BindPat(BindPat { syntax }),
3259 PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }),
3260 DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }),
3261 PATH_PAT => Pat::PathPat(PathPat { syntax }),
3262 RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
3263 TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
3264 TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
3265 SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
3266 RANGE_PAT => Pat::RangePat(RangePat { syntax }),
3267 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
3268 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
3269 _ => return None,
3270 };
3271 Some(res)
3272 }
3273 fn syntax(&self) -> &SyntaxNode {
3274 match self {
3275 Pat::OrPat(it) => &it.syntax,
3276 Pat::ParenPat(it) => &it.syntax,
3277 Pat::RefPat(it) => &it.syntax,
3278 Pat::BoxPat(it) => &it.syntax,
3279 Pat::BindPat(it) => &it.syntax,
3280 Pat::PlaceholderPat(it) => &it.syntax,
3281 Pat::DotDotPat(it) => &it.syntax,
3282 Pat::PathPat(it) => &it.syntax,
3283 Pat::RecordPat(it) => &it.syntax,
3284 Pat::TupleStructPat(it) => &it.syntax,
3285 Pat::TuplePat(it) => &it.syntax,
3286 Pat::SlicePat(it) => &it.syntax,
3287 Pat::RangePat(it) => &it.syntax,
3288 Pat::LiteralPat(it) => &it.syntax,
3289 Pat::MacroPat(it) => &it.syntax,
3290 }
3291 }
3292}
3293impl From<LetStmt> for Stmt { 3294impl From<LetStmt> for Stmt {
3294 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } 3295 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
3295} 3296}
@@ -3346,8 +3347,8 @@ impl AstNode for AttrInput {
3346 } 3347 }
3347 } 3348 }
3348} 3349}
3349impl From<FnDef> for ExternItem { 3350impl From<Fn> for ExternItem {
3350 fn from(node: FnDef) -> ExternItem { ExternItem::FnDef(node) } 3351 fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) }
3351} 3352}
3352impl From<StaticDef> for ExternItem { 3353impl From<StaticDef> for ExternItem {
3353 fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } 3354 fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) }
@@ -3355,13 +3356,13 @@ impl From<StaticDef> for ExternItem {
3355impl AstNode for ExternItem { 3356impl AstNode for ExternItem {
3356 fn can_cast(kind: SyntaxKind) -> bool { 3357 fn can_cast(kind: SyntaxKind) -> bool {
3357 match kind { 3358 match kind {
3358 FN_DEF | STATIC_DEF => true, 3359 FN | STATIC_DEF => true,
3359 _ => false, 3360 _ => false,
3360 } 3361 }
3361 } 3362 }
3362 fn cast(syntax: SyntaxNode) -> Option<Self> { 3363 fn cast(syntax: SyntaxNode) -> Option<Self> {
3363 let res = match syntax.kind() { 3364 let res = match syntax.kind() {
3364 FN_DEF => ExternItem::FnDef(FnDef { syntax }), 3365 FN => ExternItem::Fn(Fn { syntax }),
3365 STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), 3366 STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }),
3366 _ => return None, 3367 _ => return None,
3367 }; 3368 };
@@ -3369,7 +3370,7 @@ impl AstNode for ExternItem {
3369 } 3370 }
3370 fn syntax(&self) -> &SyntaxNode { 3371 fn syntax(&self) -> &SyntaxNode {
3371 match self { 3372 match self {
3372 ExternItem::FnDef(it) => &it.syntax, 3373 ExternItem::Fn(it) => &it.syntax,
3373 ExternItem::StaticDef(it) => &it.syntax, 3374 ExternItem::StaticDef(it) => &it.syntax,
3374 } 3375 }
3375 } 3376 }
@@ -3417,22 +3418,22 @@ impl std::fmt::Display for TypeRef {
3417 std::fmt::Display::fmt(self.syntax(), f) 3418 std::fmt::Display::fmt(self.syntax(), f)
3418 } 3419 }
3419} 3420}
3420impl std::fmt::Display for FieldDefList { 3421impl std::fmt::Display for Pat {
3421 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3422 std::fmt::Display::fmt(self.syntax(), f) 3423 std::fmt::Display::fmt(self.syntax(), f)
3423 } 3424 }
3424} 3425}
3425impl std::fmt::Display for Expr { 3426impl std::fmt::Display for FieldDefList {
3426 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3427 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3427 std::fmt::Display::fmt(self.syntax(), f) 3428 std::fmt::Display::fmt(self.syntax(), f)
3428 } 3429 }
3429} 3430}
3430impl std::fmt::Display for AssocItem { 3431impl std::fmt::Display for Expr {
3431 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3432 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3432 std::fmt::Display::fmt(self.syntax(), f) 3433 std::fmt::Display::fmt(self.syntax(), f)
3433 } 3434 }
3434} 3435}
3435impl std::fmt::Display for Pat { 3436impl std::fmt::Display for AssocItem {
3436 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3437 std::fmt::Display::fmt(self.syntax(), f) 3438 std::fmt::Display::fmt(self.syntax(), f)
3438 } 3439 }
@@ -3487,7 +3488,7 @@ impl std::fmt::Display for ExternCrate {
3487 std::fmt::Display::fmt(self.syntax(), f) 3488 std::fmt::Display::fmt(self.syntax(), f)
3488 } 3489 }
3489} 3490}
3490impl std::fmt::Display for FnDef { 3491impl std::fmt::Display for Fn {
3491 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3492 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3492 std::fmt::Display::fmt(self.syntax(), f) 3493 std::fmt::Display::fmt(self.syntax(), f)
3493 } 3494 }
@@ -3522,7 +3523,7 @@ impl std::fmt::Display for TraitDef {
3522 std::fmt::Display::fmt(self.syntax(), f) 3523 std::fmt::Display::fmt(self.syntax(), f)
3523 } 3524 }
3524} 3525}
3525impl std::fmt::Display for TypeAliasDef { 3526impl std::fmt::Display for TypeAlias {
3526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3527 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3527 std::fmt::Display::fmt(self.syntax(), f) 3528 std::fmt::Display::fmt(self.syntax(), f)
3528 } 3529 }
@@ -3607,6 +3608,21 @@ impl std::fmt::Display for BlockExpr {
3607 std::fmt::Display::fmt(self.syntax(), f) 3608 std::fmt::Display::fmt(self.syntax(), f)
3608 } 3609 }
3609} 3610}
3611impl std::fmt::Display for Param {
3612 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3613 std::fmt::Display::fmt(self.syntax(), f)
3614 }
3615}
3616impl std::fmt::Display for SelfParam {
3617 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3618 std::fmt::Display::fmt(self.syntax(), f)
3619 }
3620}
3621impl std::fmt::Display for TypeBoundList {
3622 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3623 std::fmt::Display::fmt(self.syntax(), f)
3624 }
3625}
3610impl std::fmt::Display for RecordFieldDefList { 3626impl std::fmt::Display for RecordFieldDefList {
3611 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3627 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3612 std::fmt::Display::fmt(self.syntax(), f) 3628 std::fmt::Display::fmt(self.syntax(), f)
@@ -3637,11 +3653,6 @@ impl std::fmt::Display for EnumVariant {
3637 std::fmt::Display::fmt(self.syntax(), f) 3653 std::fmt::Display::fmt(self.syntax(), f)
3638 } 3654 }
3639} 3655}
3640impl std::fmt::Display for TypeBoundList {
3641 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3642 std::fmt::Display::fmt(self.syntax(), f)
3643 }
3644}
3645impl std::fmt::Display for AssocItemList { 3656impl std::fmt::Display for AssocItemList {
3646 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3657 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3647 std::fmt::Display::fmt(self.syntax(), f) 3658 std::fmt::Display::fmt(self.syntax(), f)
@@ -4037,16 +4048,6 @@ impl std::fmt::Display for LetStmt {
4037 std::fmt::Display::fmt(self.syntax(), f) 4048 std::fmt::Display::fmt(self.syntax(), f)
4038 } 4049 }
4039} 4050}
4040impl std::fmt::Display for SelfParam {
4041 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4042 std::fmt::Display::fmt(self.syntax(), f)
4043 }
4044}
4045impl std::fmt::Display for Param {
4046 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4047 std::fmt::Display::fmt(self.syntax(), f)
4048 }
4049}
4050impl std::fmt::Display for PathSegment { 4051impl std::fmt::Display for PathSegment {
4051 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 4052 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4052 std::fmt::Display::fmt(self.syntax(), f) 4053 std::fmt::Display::fmt(self.syntax(), f)
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs
index 0ff69bc2d..ef235680f 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -294,7 +294,7 @@ pub fn fn_def(
294 type_params: Option<ast::TypeParamList>, 294 type_params: Option<ast::TypeParamList>,
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 {
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs
index 242900643..a7a301d6b 100644
--- a/crates/ra_syntax/src/ast/node_ext.rs
+++ b/crates/ra_syntax/src/ast/node_ext.rs
@@ -474,7 +474,7 @@ impl ast::TokenTree {
474} 474}
475 475
476impl ast::DocCommentsOwner for ast::SourceFile {} 476impl ast::DocCommentsOwner for ast::SourceFile {}
477impl ast::DocCommentsOwner for ast::FnDef {} 477impl ast::DocCommentsOwner for ast::Fn {}
478impl ast::DocCommentsOwner for ast::StructDef {} 478impl ast::DocCommentsOwner for ast::StructDef {}
479impl ast::DocCommentsOwner for ast::UnionDef {} 479impl ast::DocCommentsOwner for ast::UnionDef {}
480impl ast::DocCommentsOwner for ast::RecordFieldDef {} 480impl ast::DocCommentsOwner for ast::RecordFieldDef {}
@@ -485,6 +485,6 @@ impl ast::DocCommentsOwner for ast::TraitDef {}
485impl ast::DocCommentsOwner for ast::Module {} 485impl ast::DocCommentsOwner for ast::Module {}
486impl ast::DocCommentsOwner for ast::StaticDef {} 486impl ast::DocCommentsOwner for ast::StaticDef {}
487impl ast::DocCommentsOwner for ast::ConstDef {} 487impl ast::DocCommentsOwner for ast::ConstDef {}
488impl ast::DocCommentsOwner for ast::TypeAliasDef {} 488impl ast::DocCommentsOwner for ast::TypeAlias {}
489impl ast::DocCommentsOwner for ast::ImplDef {} 489impl ast::DocCommentsOwner for ast::ImplDef {}
490impl ast::DocCommentsOwner for ast::MacroCall {} 490impl ast::DocCommentsOwner for ast::MacroCall {}
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 219dd0b07..6203b6206 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -255,11 +255,11 @@ fn api_walkthrough() {
255 let mut func = None; 255 let mut func = None;
256 for item in file.items() { 256 for item in file.items() {
257 match item { 257 match item {
258 ast::Item::FnDef(f) => func = Some(f), 258 ast::Item::Fn(f) => func = Some(f),
259 _ => unreachable!(), 259 _ => unreachable!(),
260 } 260 }
261 } 261 }
262 let func: ast::FnDef = func.unwrap(); 262 let func: ast::Fn = func.unwrap();
263 263
264 // Each AST node has a bunch of getters for children. All getters return 264 // Each AST node has a bunch of getters for children. All getters return
265 // `Option`s though, to account for incomplete code. Some getters are common 265 // `Option`s though, to account for incomplete code. Some getters are common
@@ -316,7 +316,7 @@ fn api_walkthrough() {
316 ); 316 );
317 317
318 // As well as some iterator helpers: 318 // As well as some iterator helpers:
319 let f = expr_syntax.ancestors().find_map(ast::FnDef::cast); 319 let f = expr_syntax.ancestors().find_map(ast::Fn::cast);
320 assert_eq!(f, Some(func)); 320 assert_eq!(f, Some(func));
321 assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); 321 assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}']));
322 assert_eq!( 322 assert_eq!(
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs
index c6b30a02a..87a7acd09 100644
--- a/crates/ra_syntax/src/parsing/text_tree_sink.rs
+++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs
@@ -146,7 +146,7 @@ fn n_attached_trivias<'a>(
146 trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, 146 trivias: impl Iterator<Item = (SyntaxKind, &'a str)>,
147) -> usize { 147) -> usize {
148 match kind { 148 match kind {
149 MACRO_CALL | CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF 149 MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN
150 | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => { 150 | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => {
151 let mut res = 0; 151 let mut res = 0;
152 let mut trivias = trivias.enumerate().peekable(); 152 let mut trivias = trivias.enumerate().peekable();
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index fdec48fb0..6a2749381 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -4,7 +4,7 @@ mod block;
4 4
5use crate::{ 5use crate::{
6 ast, match_ast, AstNode, SyntaxError, 6 ast, match_ast, AstNode, SyntaxError,
7 SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN_DEF, INT_NUMBER, STRING, TYPE_ALIAS_DEF}, 7 SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN, INT_NUMBER, STRING, TYPE_ALIAS},
8 SyntaxNode, SyntaxToken, TextSize, T, 8 SyntaxNode, SyntaxToken, TextSize, T,
9}; 9};
10use rustc_lexer::unescape::{ 10use rustc_lexer::unescape::{
@@ -200,7 +200,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) {
200 None => return, 200 None => return,
201 }; 201 };
202 match parent.kind() { 202 match parent.kind() {
203 FN_DEF | CONST_DEF | TYPE_ALIAS_DEF => (), 203 FN | CONST_DEF | TYPE_ALIAS => (),
204 _ => return, 204 _ => return,
205 } 205 }
206 206
diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs
index 2c08f7e6e..ad9901468 100644
--- a/crates/ra_syntax/src/validation/block.rs
+++ b/crates/ra_syntax/src/validation/block.rs
@@ -9,7 +9,7 @@ use crate::{
9pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) { 9pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) {
10 if let Some(parent) = block.syntax().parent() { 10 if let Some(parent) = block.syntax().parent() {
11 match parent.kind() { 11 match parent.kind() {
12 FN_DEF | EXPR_STMT | BLOCK_EXPR => return, 12 FN | EXPR_STMT | BLOCK_EXPR => return,
13 _ => {} 13 _ => {}
14 } 14 }
15 } 15 }
diff --git a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast
index 375ed45e0..4845a6563 100644
--- a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast
+++ b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..31 2 [email protected]
3 [email protected] 3 [email protected]
4 [email protected] "#" 4 [email protected] "#"
5 [email protected] "[" 5 [email protected] "["
diff --git a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast
index b72c92c33..2ae5bacea 100644
--- a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast
+++ b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast
@@ -12,7 +12,7 @@ [email protected]
12 [email protected] 12 [email protected]
13 [email protected] "}" 13 [email protected] "}"
14 [email protected] "\n\n" 14 [email protected] "\n\n"
15 FN_DEF@17..27 15 [email protected]
16 [email protected] "fn" 16 [email protected] "fn"
17 [email protected] " " 17 [email protected] " "
18 [email protected] 18 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast
index 33953d8d7..1e9637c26 100644
--- a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast
+++ b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..12 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -58,7 +58,7 @@ [email protected]
58 [email protected] "\n" 58 [email protected] "\n"
59 [email protected] "}" 59 [email protected] "}"
60 [email protected] "\n\n" 60 [email protected] "\n\n"
61 FN_DEF@82..94 61 [email protected]
62 [email protected] "fn" 62 [email protected] "fn"
63 [email protected] " " 63 [email protected] " "
64 [email protected] 64 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
index 3bf57eacc..1c3e0f65b 100644
--- a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
+++ b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..41 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
index e1e782f5f..c8bf96550 100644
--- a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
+++ b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..389 2 [email protected]
3 [email protected] 3 [email protected]
4 [email protected] 4 [email protected]
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast
index 9323b7890..1ab045a44 100644
--- a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast
+++ b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..22 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast
index b18378cff..a3c25b450 100644
--- a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast
+++ b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..7 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast
index 93434f34f..66157c3dc 100644
--- a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast
+++ b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..55 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast
index 628315c78..bb4a28f4e 100644
--- a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast
+++ b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..46 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast
index a87e5061a..ce43ddf45 100644
--- a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast
+++ b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast
@@ -11,7 +11,7 @@ [email protected]
11 [email protected] 11 [email protected]
12 [email protected] "{" 12 [email protected] "{"
13 [email protected] "\n " 13 [email protected] "\n "
14 FN_DEF@20..161 14 [email protected]
15 [email protected] "fn" 15 [email protected] "fn"
16 [email protected] " " 16 [email protected] " "
17 [email protected] 17 [email protected]
@@ -116,7 +116,7 @@ [email protected]
116 [email protected] "\n " 116 [email protected] "\n "
117 [email protected] "}" 117 [email protected] "}"
118 [email protected] "\n\n " 118 [email protected] "\n\n "
119 FN_DEF@167..180 119 [email protected]
120 [email protected] "fn" 120 [email protected] "fn"
121 [email protected] " " 121 [email protected] " "
122 [email protected] 122 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast
index 4ff27f5c8..f6fa964b7 100644
--- a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast
+++ b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..138 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast
index 5f3a31473..6f6feba5a 100644
--- a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast
+++ b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast
@@ -1,8 +1,8 @@
1[email protected] 1[email protected]
2 FN_DEF@0..2 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] "\n\n" 4 [email protected] "\n\n"
5 FN_DEF@4..15 5 [email protected]
6 [email protected] "fn" 6 [email protected] "fn"
7 [email protected] " " 7 [email protected] " "
8 [email protected] 8 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast
index 1746bd3c1..ba4ce4795 100644
--- a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast
+++ b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..21 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast
index 28146f44e..866f61113 100644
--- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast
+++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..33 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -40,7 +40,7 @@ [email protected]
40 [email protected] " " 40 [email protected] " "
41 [email protected] "}" 41 [email protected] "}"
42 [email protected] "\n" 42 [email protected] "\n"
43 FN_DEF@34..68 43 [email protected]
44 [email protected] "fn" 44 [email protected] "fn"
45 [email protected] " " 45 [email protected] " "
46 [email protected] 46 [email protected]
@@ -88,7 +88,7 @@ [email protected]
88 [email protected] " " 88 [email protected] " "
89 [email protected] "}" 89 [email protected] "}"
90 [email protected] "\n" 90 [email protected] "\n"
91 FN_DEF@69..111 91 [email protected]
92 [email protected] "fn" 92 [email protected] "fn"
93 [email protected] " " 93 [email protected] " "
94 [email protected] 94 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast
index 9ea9d715e..5ffefd742 100644
--- a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast
+++ b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..55 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
index 48610a5eb..1e94e72bc 100644
--- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
+++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..53 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -65,7 +65,7 @@ [email protected]
65 [email protected] "{" 65 [email protected] "{"
66 [email protected] "}" 66 [email protected] "}"
67 [email protected] "\n\n" 67 [email protected] "\n\n"
68 FN_DEF@55..239 68 [email protected]
69 [email protected] "fn" 69 [email protected] "fn"
70 [email protected] " " 70 [email protected] " "
71 [email protected] 71 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast
index 88b086daf..4b9bd679e 100644
--- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast
+++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..574 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast
index 4d6461d1e..53704f640 100644
--- a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast
+++ b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..29 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast
index 0da8f59f0..bfcd0149e 100644
--- a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast
+++ b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..23 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast
index 515819e42..55ff3943f 100644
--- a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..349 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
index c6859eca8..ec9f556aa 100644
--- a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..292 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
index 53e445459..063532e02 100644
--- a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..88 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast
index 1b2ac5011..303a49576 100644
--- a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast
+++ b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..89 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast
index 0415085b0..2f03709eb 100644
--- a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast
+++ b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast
@@ -34,7 +34,7 @@ [email protected]
34 [email protected] 34 [email protected]
35 [email protected] "use" 35 [email protected] "use"
36 [email protected] "\n" 36 [email protected] "\n"
37 FN_DEF@38..47 37 [email protected]
38 [email protected] "fn" 38 [email protected] "fn"
39 [email protected] " " 39 [email protected] " "
40 [email protected] 40 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
index bc446e3df..c0ba4fba9 100644
--- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
+++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
@@ -17,7 +17,7 @@ [email protected]
17 [email protected] 17 [email protected]
18 [email protected] "{" 18 [email protected] "{"
19 [email protected] "\n " 19 [email protected] "\n "
20 FN_DEF@20..31 20 [email protected]
21 [email protected] "fn" 21 [email protected] "fn"
22 [email protected] " " 22 [email protected] " "
23 [email protected] 23 [email protected]
@@ -30,7 +30,7 @@ [email protected]
30 [email protected] "{" 30 [email protected] "{"
31 [email protected] "}" 31 [email protected] "}"
32 [email protected] "\n " 32 [email protected] "\n "
33 FN_DEF@36..51 33 [email protected]
34 [email protected] 34 [email protected]
35 [email protected] "pub" 35 [email protected] "pub"
36 [email protected] " " 36 [email protected] " "
@@ -46,7 +46,7 @@ [email protected]
46 [email protected] "{" 46 [email protected] "{"
47 [email protected] "}" 47 [email protected] "}"
48 [email protected] "\n " 48 [email protected] "\n "
49 TYPE_ALIAS_DEF@56..81 49 [email protected]
50 [email protected] 50 [email protected]
51 [email protected] "pub" 51 [email protected] "pub"
52 [email protected] "(" 52 [email protected] "("
diff --git a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast
index 21db9ee85..bed7ad6c3 100644
--- a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast
+++ b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..32 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
index ec950381b..a98c31b0c 100644
--- a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
+++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..82 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast
index cb90f28bc..19b3540e9 100644
--- a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast
+++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..30 2 [email protected]
3 [email protected] "type" 3 [email protected] "type"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -26,7 +26,7 @@ [email protected]
26 [email protected] "u32" 26 [email protected] "u32"
27 [email protected] ";" 27 [email protected] ";"
28 [email protected] "\n" 28 [email protected] "\n"
29 TYPE_ALIAS_DEF@31..64 29 [email protected]
30 [email protected] "type" 30 [email protected] "type"
31 [email protected] " " 31 [email protected] " "
32 [email protected] 32 [email protected]
@@ -57,7 +57,7 @@ [email protected]
57 [email protected] ")" 57 [email protected] ")"
58 [email protected] ";" 58 [email protected] ";"
59 [email protected] "\n" 59 [email protected] "\n"
60 TYPE_ALIAS_DEF@65..95 60 [email protected]
61 [email protected] "type" 61 [email protected] "type"
62 [email protected] " " 62 [email protected] " "
63 [email protected] 63 [email protected]
@@ -83,7 +83,7 @@ [email protected]
83 [email protected] "]" 83 [email protected] "]"
84 [email protected] ";" 84 [email protected] ";"
85 [email protected] "\n" 85 [email protected] "\n"
86 TYPE_ALIAS_DEF@96..149 86 [email protected]
87 [email protected] "type" 87 [email protected] "type"
88 [email protected] " " 88 [email protected] " "
89 [email protected] 89 [email protected]
@@ -136,7 +136,7 @@ [email protected]
136 [email protected] ")" 136 [email protected] ")"
137 [email protected] ";" 137 [email protected] ";"
138 [email protected] "\n" 138 [email protected] "\n"
139 FN_DEF@150..238 139 [email protected]
140 [email protected] "fn" 140 [email protected] "fn"
141 [email protected] " " 141 [email protected] " "
142 [email protected] 142 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast
index e46456384..df29017e7 100644
--- a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast
+++ b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..82 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast b/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast
index f1e78f388..93c429e12 100644
--- a/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast
+++ b/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast
@@ -1,4 +1,4 @@
1FN_DEF@0..11 1[email protected]
2 [email protected] "fn" 2 [email protected] "fn"
3 [email protected] " " 3 [email protected] " "
4 [email protected] 4 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast
index bf70ebca4..0b9bbec07 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..12 2 [email protected]
3 [email protected] "type" 3 [email protected] "type"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
index 75668c818..8b0a888fd 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..29 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast
index 95bcc3c0a..2409eefe7 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..13 2 [email protected]
3 [email protected] "type" 3 [email protected] "type"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast
index 90202d764..776022fd9 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..15 2 [email protected]
3 [email protected] "type" 3 [email protected] "type"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
index c789e8d82..cc0f8bcaf 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..10 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
@@ -19,7 +19,7 @@ [email protected]
19 [email protected] " " 19 [email protected] " "
20 [email protected] "}" 20 [email protected] "}"
21 [email protected] " " 21 [email protected] " "
22 FN_DEF@22..32 22 [email protected]
23 [email protected] "fn" 23 [email protected] "fn"
24 [email protected] " " 24 [email protected] " "
25 [email protected] 25 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
index cd24313d4..3f3a7f1b9 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..29 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast
index c5fa7a404..63a10127d 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..20 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast
index 4e3fa704e..8fd8d5e59 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..47 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
index e1abc5633..fa14e1e6d 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..46 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
index 53f7ebaf9..d2a18330f 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
@@ -2,7 +2,7 @@ [email protected]
2 [email protected] 2 [email protected]
3 [email protected] "unsafe" 3 [email protected] "unsafe"
4 [email protected] " " 4 [email protected] " "
5 FN_DEF@7..24 5 [email protected]
6 [email protected] "async" 6 [email protected] "async"
7 [email protected] " " 7 [email protected] " "
8 [email protected] "fn" 8 [email protected] "fn"
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast
index 5501dc5a6..22c7c5f0d 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast
@@ -14,7 +14,7 @@ [email protected]
14 [email protected] 14 [email protected]
15 [email protected] "default" 15 [email protected] "default"
16 [email protected] " " 16 [email protected] " "
17 TYPE_ALIAS_DEF@22..35 17 [email protected]
18 [email protected] "type" 18 [email protected] "type"
19 [email protected] " " 19 [email protected] " "
20 [email protected] 20 [email protected]
@@ -35,7 +35,7 @@ [email protected]
35 [email protected] 35 [email protected]
36 [email protected] "default" 36 [email protected] "default"
37 [email protected] " " 37 [email protected] " "
38 FN_DEF@48..59 38 [email protected]
39 [email protected] "fn" 39 [email protected] "fn"
40 [email protected] " " 40 [email protected] " "
41 [email protected] 41 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
index a9de44b57..6753c3fe7 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..44 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
index f422acdda..a62ce23e6 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
@@ -11,7 +11,7 @@ [email protected]
11 [email protected] 11 [email protected]
12 [email protected] "{" 12 [email protected] "{"
13 [email protected] "\n " 13 [email protected] "\n "
14 TYPE_ALIAS_DEF@13..27 14 [email protected]
15 [email protected] "type" 15 [email protected] "type"
16 [email protected] " " 16 [email protected] " "
17 [email protected] 17 [email protected]
@@ -41,7 +41,7 @@ [email protected]
41 [email protected] "i32" 41 [email protected] "i32"
42 [email protected] ";" 42 [email protected] ";"
43 [email protected] "\n " 43 [email protected] "\n "
44 FN_DEF@50..61 44 [email protected]
45 [email protected] "fn" 45 [email protected] "fn"
46 [email protected] " " 46 [email protected] " "
47 [email protected] 47 [email protected]
@@ -54,7 +54,7 @@ [email protected]
54 [email protected] "{" 54 [email protected] "{"
55 [email protected] "}" 55 [email protected] "}"
56 [email protected] "\n " 56 [email protected] "\n "
57 FN_DEF@66..80 57 [email protected]
58 [email protected] "fn" 58 [email protected] "fn"
59 [email protected] " " 59 [email protected] " "
60 [email protected] 60 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
index cd0892451..9cae1e8cc 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..53 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
index 20eba09f5..ace8ad050 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..38 2 [email protected]
3 [email protected] "type" 3 [email protected] "type"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast
index 6c8c1e24b..1b56e20d5 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..27 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast
index 0cd1dffc9..87c170707 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast
@@ -11,7 +11,7 @@ [email protected]
11 [email protected] 11 [email protected]
12 [email protected] "{" 12 [email protected] "{"
13 [email protected] "\n " 13 [email protected] "\n "
14 FN_DEF@13..26 14 [email protected]
15 [email protected] "fn" 15 [email protected] "fn"
16 [email protected] " " 16 [email protected] " "
17 [email protected] 17 [email protected]
@@ -26,7 +26,7 @@ [email protected]
26 [email protected] "{" 26 [email protected] "{"
27 [email protected] "}" 27 [email protected] "}"
28 [email protected] "\n " 28 [email protected] "\n "
29 FN_DEF@31..46 29 [email protected]
30 [email protected] "fn" 30 [email protected] "fn"
31 [email protected] " " 31 [email protected] " "
32 [email protected] 32 [email protected]
@@ -43,7 +43,7 @@ [email protected]
43 [email protected] "{" 43 [email protected] "{"
44 [email protected] "}" 44 [email protected] "}"
45 [email protected] "\n " 45 [email protected] "\n "
46 FN_DEF@51..69 46 [email protected]
47 [email protected] "fn" 47 [email protected] "fn"
48 [email protected] " " 48 [email protected] " "
49 [email protected] 49 [email protected]
@@ -62,7 +62,7 @@ [email protected]
62 [email protected] "{" 62 [email protected] "{"
63 [email protected] "}" 63 [email protected] "}"
64 [email protected] "\n " 64 [email protected] "\n "
65 FN_DEF@74..103 65 [email protected]
66 [email protected] "fn" 66 [email protected] "fn"
67 [email protected] " " 67 [email protected] " "
68 [email protected] 68 [email protected]
@@ -95,7 +95,7 @@ [email protected]
95 [email protected] "{" 95 [email protected] "{"
96 [email protected] "}" 96 [email protected] "}"
97 [email protected] "\n " 97 [email protected] "\n "
98 FN_DEF@108..125 98 [email protected]
99 [email protected] "fn" 99 [email protected] "fn"
100 [email protected] " " 100 [email protected] " "
101 [email protected] 101 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast
index 10eb31d68..3ce2acfae 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..102 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast
index 425e5196c..f62826fd5 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..25 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast
index d823c08fc..66a609346 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 FN_DEF@0..47 2 [email protected]
3 [email protected] "fn" 3 [email protected] "fn"
4 [email protected] " " 4 [email protected] " "
5 [email protected] 5 [email protected]
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast
index 283442a8b..28c94bfd6 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast
@@ -1,5 +1,5 @@
1[email protected] 1[email protected]
2 TYPE_ALIAS_DEF@0..30 2 [email protected]
3