Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--Cargo.lock4
-rw-r--r--crates/hir/src/semantics.rs2
-rw-r--r--crates/hir_def/src/attr.rs3
-rw-r--r--crates/hir_def/src/body/lower.rs40
-rw-r--r--crates/hir_expand/src/lib.rs2
-rw-r--r--crates/hir_ty/src/tests/method_resolution.rs30
-rw-r--r--crates/hir_ty/src/tests/simple.rs74
-rw-r--r--crates/ide/src/highlight_related.rs25
-rw-r--r--crates/ide/src/hover/render.rs4
-rw-r--r--crates/ide/src/join_lines.rs2
-rw-r--r--crates/ide/src/syntax_tree.rs77
-rw-r--r--crates/ide_assists/src/handlers/add_return_type.rs5
-rw-r--r--crates/ide_assists/src/handlers/convert_to_guarded_return.rs4
-rw-r--r--crates/ide_assists/src/handlers/extract_function.rs40
-rw-r--r--crates/ide_assists/src/handlers/extract_variable.rs3
-rw-r--r--crates/ide_assists/src/handlers/inline_call.rs10
-rw-r--r--crates/ide_assists/src/handlers/inline_local_variable.rs3
-rw-r--r--crates/ide_assists/src/handlers/remove_dbg.rs2
-rw-r--r--crates/ide_assists/src/handlers/unwrap_block.rs4
-rw-r--r--crates/ide_assists/src/utils.rs18
-rw-r--r--crates/ide_completion/src/completions/postfix.rs4
-rw-r--r--crates/ide_completion/src/context.rs6
-rw-r--r--crates/ide_completion/src/patterns.rs8
-rw-r--r--crates/ide_db/src/helpers.rs41
-rw-r--r--crates/ide_db/src/helpers/insert_use.rs8
-rw-r--r--crates/ide_db/src/helpers/insert_use/tests.rs4
-rw-r--r--crates/ide_db/src/helpers/node_ext.rs54
-rw-r--r--crates/mbe/src/tests/expand.rs157
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs40
-rw-r--r--crates/parser/src/syntax_kind/generated.rs2
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--crates/syntax/src/ast.rs2
-rw-r--r--crates/syntax/src/ast/edit_in_place.rs2
-rw-r--r--crates/syntax/src/ast/expr_ext.rs36
-rw-r--r--crates/syntax/src/ast/generated/nodes.rs82
-rw-r--r--crates/syntax/src/ast/make.rs1
-rw-r--r--crates/syntax/src/ast/node_ext.rs17
-rw-r--r--crates/syntax/src/lib.rs7
-rw-r--r--crates/syntax/src/ted.rs4
-rw-r--r--crates/syntax/src/tests/ast_src.rs2
-rw-r--r--crates/syntax/src/validation/block.rs16
-rw-r--r--crates/syntax/test_data/parser/err/0005_attribute_recover.rast7
-rw-r--r--crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0008_item_block_recovery.rast52
-rw-r--r--crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast61
-rw-r--r--crates/syntax/test_data/parser/err/0014_where_no_bounds.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0016_missing_semi.rast61
-rw-r--r--crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast45
-rw-r--r--crates/syntax/test_data/parser/err/0018_incomplete_fn.rast169
-rw-r--r--crates/syntax/test_data/parser/err/0019_let_recover.rast166
-rw-r--r--crates/syntax/test_data/parser/err/0020_fn_recover.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0021_incomplete_param.rast7
-rw-r--r--crates/syntax/test_data/parser/err/0022_bad_exprs.rast217
-rw-r--r--crates/syntax/test_data/parser/err/0023_mismatched_paren.rast49
-rw-r--r--crates/syntax/test_data/parser/err/0024_many_type_parens.rast432
-rw-r--r--crates/syntax/test_data/parser/err/0025_nope.rast360
-rw-r--r--crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0029_field_completion.rast23
-rw-r--r--crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast222
-rw-r--r--crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast363
-rw-r--r--crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast105
-rw-r--r--crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast155
-rw-r--r--crates/syntax/test_data/parser/err/0035_use_recover.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast10
-rw-r--r--crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast31
-rw-r--r--crates/syntax/test_data/parser/err/0039_lambda_recovery.rast121
-rw-r--r--crates/syntax/test_data/parser/err/0043_weird_blocks.rast113
-rw-r--r--crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast7
-rw-r--r--crates/syntax/test_data/parser/err/0045_item_modifiers.rast5
-rw-r--r--crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast143
-rw-r--r--crates/syntax/test_data/parser/err/0049_double_fish.rast180
-rw-r--r--crates/syntax/test_data/parser/fragments/item/ok/0000_fn.rast5
-rw-r--r--crates/syntax/test_data/parser/fragments/stmt/ok/0000_expr_block.rast135
-rw-r--r--crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast25
-rw-r--r--crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast10
-rw-r--r--crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast37
-rw-r--r--crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast25
-rw-r--r--crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast77
-rw-r--r--crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast71
-rw-r--r--crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast7
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0006_self_param.rast25
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0008_path_part.rast169
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast26
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast95
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast50
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast10
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast65
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast10
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast59
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast185
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast75
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast155
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0030_cond.rast365
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast149
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast88
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast67
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast33
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast7
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast271
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0044_block_items.rast34
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast10
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast167
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast129
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast173
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast94
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast225
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast229
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast279
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast79
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast165
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast33
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast98
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0075_block.rast86
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast27
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast167
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast253
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast247
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast10
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast112
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast43
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast33
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast221
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0099_param_list.rast20
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast46
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast241
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast85
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast251
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast101
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast53
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0109_label.rast114
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast155
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast231
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast90
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast127
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast143
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast277
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast41
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast73
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast182
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast49
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast47
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast39
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast155
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast102
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast115
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast106
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast58
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast197
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast887
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast221
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast61
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0151_fn.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast51
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast115
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast131
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast199
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0157_const_block.rast23
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast50
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast64
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast45
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast33
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast31
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast23
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast53
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast39
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast21
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0183_type_param.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast5
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast33
-rw-r--r--crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast37
-rw-r--r--crates/syntax/test_data/parser/ok/0005_fn_item.rast7
-rw-r--r--crates/syntax/test_data/parser/ok/0008_mod_item.rast7
-rw-r--r--crates/syntax/test_data/parser/ok/0011_outer_attribute.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0012_visibility.rast25
-rw-r--r--crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast40
-rw-r--r--crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast38
-rw-r--r--crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast60
-rw-r--r--crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast347
-rw-r--r--crates/syntax/test_data/parser/ok/0029_range_forms.rast279
-rw-r--r--crates/syntax/test_data/parser/ok/0030_string_suffixes.rast103
-rw-r--r--crates/syntax/test_data/parser/ok/0032_where_for.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0033_label_break.rast421
-rw-r--r--crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast61
-rw-r--r--crates/syntax/test_data/parser/ok/0035_weird_exprs.rast3918
-rw-r--r--crates/syntax/test_data/parser/ok/0036_fully_qualified.rast27
-rw-r--r--crates/syntax/test_data/parser/ok/0038_where_pred_type.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast7
-rw-r--r--crates/syntax/test_data/parser/ok/0041_raw_keywords.rast77
-rw-r--r--crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast97
-rw-r--r--crates/syntax/test_data/parser/ok/0043_complex_assignment.rast133
-rw-r--r--crates/syntax/test_data/parser/ok/0044_let_attrs.rast125
-rw-r--r--crates/syntax/test_data/parser/ok/0045_block_attrs.rast268
-rw-r--r--crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast495
-rw-r--r--crates/syntax/test_data/parser/ok/0048_compound_assignment.rast373
-rw-r--r--crates/syntax/test_data/parser/ok/0049_async_block.rast47
-rw-r--r--crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast56
-rw-r--r--crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast55
-rw-r--r--crates/syntax/test_data/parser/ok/0052_for_range_block.rast135
-rw-r--r--crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast15
-rw-r--r--crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast49
-rw-r--r--crates/syntax/test_data/parser/ok/0056_neq_in_type.rast106
-rw-r--r--crates/syntax/test_data/parser/ok/0057_loop_in_call.rast49
-rw-r--r--crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast169
-rw-r--r--crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast174
-rw-r--r--crates/syntax/test_data/parser/ok/0060_as_range.rast87
-rw-r--r--crates/syntax/test_data/parser/ok/0061_match_full_range.rast29
-rw-r--r--crates/syntax/test_data/parser/ok/0062_macro_2.0.rast205
-rw-r--r--crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast20
-rw-r--r--crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast20
-rw-r--r--crates/syntax/test_data/parser/ok/0065_comment_newline.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast5
-rw-r--r--crates/syntax/test_data/parser/ok/0066_default_modifier.rast20
-rw-r--r--crates/syntax/test_data/parser/ok/0067_where_for_pred.rast42
-rw-r--r--crates/syntax/test_data/parser/ok/0068_item_modifiers.rast40
-rw-r--r--crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast149
-rw-r--r--crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast93
-rw-r--r--crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast116
233 files changed, 11762 insertions, 11343 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9170ec3a66..9da1f56dea 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1760,9 +1760,9 @@ dependencies = [
[[package]]
name = "ungrammar"
-version = "1.14.4"
+version = "1.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d6e36d57b143472488b1594fe25c376fa9683bccfd80d858b2180c97806835b"
+checksum = "395e988af2480b8a8118ad1d5f1f790197d332e3e2585231f742949b63080ef5"
[[package]]
name = "unicase"
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 51befc698c..5cda6cc1e9 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -698,7 +698,7 @@ impl<'db> SemanticsImpl<'db> {
ast::ForExpr(it) => it.label(),
ast::WhileExpr(it) => it.label(),
ast::LoopExpr(it) => it.label(),
- ast::EffectExpr(it) => it.label(),
+ ast::BlockExpr(it) => it.label(),
_ => None,
}
};
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index 70fa249a5b..04011d9129 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -524,7 +524,8 @@ fn inner_attributes(
},
ast::Fn(it) => {
let body = it.body()?;
- (body.attrs(), ast::CommentIter::from_syntax_node(body.syntax()))
+ let stmt_list = body.stmt_list()?;
+ (stmt_list.attrs(), ast::CommentIter::from_syntax_node(body.syntax()))
},
ast::Impl(it) => {
let assoc_item_list = it.assoc_item_list()?;
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index a34c18d6d0..6a6d992af3 100644
--- a/crates/hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
@@ -245,43 +245,37 @@ impl ExprCollector<'_> {
self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr)
}
- ast::Expr::EffectExpr(e) => match e.effect() {
- ast::Effect::Try(_) => {
- let body = self.collect_block_opt(e.block_expr());
+ ast::Expr::BlockExpr(e) => match e.modifier() {
+ Some(ast::BlockModifier::Try(_)) => {
+ let body = self.collect_block(e);
self.alloc_expr(Expr::TryBlock { body }, syntax_ptr)
}
- ast::Effect::Unsafe(_) => {
- let body = self.collect_block_opt(e.block_expr());
+ Some(ast::BlockModifier::Unsafe(_)) => {
+ let body = self.collect_block(e);
self.alloc_expr(Expr::Unsafe { body }, syntax_ptr)
}
// FIXME: we need to record these effects somewhere...
- ast::Effect::Label(label) => {
+ Some(ast::BlockModifier::Label(label)) => {
let label = self.collect_label(label);
- match e.block_expr() {
- Some(block) => {
- let res = self.collect_block(block);
- match &mut self.body.exprs[res] {
- Expr::Block { label: block_label, .. } => {
- *block_label = Some(label);
- }
- _ => unreachable!(),
- }
- res
+ let res = self.collect_block(e);
+ match &mut self.body.exprs[res] {
+ Expr::Block { label: block_label, .. } => {
+ *block_label = Some(label);
}
- None => self.missing_expr(),
+ _ => unreachable!(),
}
+ res
}
- // FIXME: we need to record these effects somewhere...
- ast::Effect::Async(_) => {
- let body = self.collect_block_opt(e.block_expr());
+ Some(ast::BlockModifier::Async(_)) => {
+ let body = self.collect_block(e);
self.alloc_expr(Expr::Async { body }, syntax_ptr)
}
- ast::Effect::Const(_) => {
- let body = self.collect_block_opt(e.block_expr());
+ Some(ast::BlockModifier::Const(_)) => {
+ let body = self.collect_block(e);
self.alloc_expr(Expr::Const { body }, syntax_ptr)
}
+ None => self.collect_block(e),
},
- ast::Expr::BlockExpr(e) => self.collect_block(e),
ast::Expr::LoopExpr(e) => {
let label = e.label().map(|label| self.collect_label(label));
let body = self.collect_block_opt(e.loop_body());
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index 8bb56e0700..bdc3023e9c 100644
--- a/crates/hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -721,7 +721,7 @@ impl ExpandTo {
match parent.kind() {
MACRO_ITEMS | SOURCE_FILE | ITEM_LIST => ExpandTo::Items,
- MACRO_STMTS | EXPR_STMT | BLOCK_EXPR => ExpandTo::Statements,
+ MACRO_STMTS | EXPR_STMT | STMT_LIST => ExpandTo::Statements,
MACRO_PAT => ExpandTo::Pattern,
MACRO_TYPE => ExpandTo::Type,
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs
index 306da6738b..26078a4b2f 100644
--- a/crates/hir_ty/src/tests/method_resolution.rs
+++ b/crates/hir_ty/src/tests/method_resolution.rs
@@ -1083,22 +1083,22 @@ fn dyn_trait_super_trait_not_in_scope() {
fn method_resolution_foreign_opaque_type() {
check_infer(
r#"
- extern "C" {
- type S;
- fn f() -> &'static S;
- }
+extern "C" {
+ type S;
+ fn f() -> &'static S;
+}
- impl S {
- fn foo(&self) -> bool {
- true
- }
- }
+impl S {
+ fn foo(&self) -> bool {
+ true
+ }
+}
- fn test() {
- let s = unsafe { f() };
- s.foo();
- }
- "#,
+fn test() {
+ let s = unsafe { f() };
+ s.foo();
+}
+"#,
expect![[r#"
75..79 'self': &S
89..109 '{ ... }': bool
@@ -1106,7 +1106,7 @@ fn method_resolution_foreign_opaque_type() {
123..167 '{ ...o(); }': ()
133..134 's': &S
137..151 'unsafe { f() }': &S
- 144..151 '{ f() }': &S
+ 137..151 'unsafe { f() }': &S
146..147 'f': fn f() -> &S
146..149 'f()': &S
157..158 's': &S
diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs
index a409c453b0..f4d082ea8c 100644
--- a/crates/hir_ty/src/tests/simple.rs
+++ b/crates/hir_ty/src/tests/simple.rs
@@ -352,7 +352,7 @@ unsafe fn baz(u: MyUnion) {
71..89 'MyUnio...o: 0 }': MyUnion
86..87 '0': u32
95..113 'unsafe...(u); }': ()
- 102..113 '{ baz(u); }': ()
+ 95..113 'unsafe...(u); }': ()
104..107 'baz': fn baz(MyUnion)
104..110 'baz(u)': ()
108..109 'u': MyUnion
@@ -360,7 +360,7 @@ unsafe fn baz(u: MyUnion) {
126..146 'MyUnio... 0.0 }': MyUnion
141..144 '0.0': f32
152..170 'unsafe...(u); }': ()
- 159..170 '{ baz(u); }': ()
+ 152..170 'unsafe...(u); }': ()
161..164 'baz': fn baz(MyUnion)
161..167 'baz(u)': ()
165..166 'u': MyUnion
@@ -1914,41 +1914,41 @@ fn fn_pointer_return() {
}
#[test]
-fn effects_smoke_test() {
+fn block_modifiers_smoke_test() {
check_infer(
r#"
- //- minicore: future
- async fn main() {
- let x = unsafe { 92 };
- let y = async { async { () }.await };
- let z = try { () };
- let w = const { 92 };
- let t = 'a: { 92 };
- }
+//- minicore: future
+async fn main() {
+ let x = unsafe { 92 };
+ let y = async { async { () }.await };
+ let z = try { () };
+ let w = const { 92 };
+ let t = 'a: { 92 };
+}
"#,
expect![[r#"
16..162 '{ ...2 }; }': ()
26..27 'x': i32
30..43 'unsafe { 92 }': i32
- 37..43 '{ 92 }': i32
+ 30..43 'unsafe { 92 }': i32
39..41 '92': i32
53..54 'y': impl Future<Output = ()>
+ 57..85 'async ...wait }': ()
57..85 'async ...wait }': impl Future<Output = ()>
- 63..85 '{ asyn...wait }': ()
+ 65..77 'async { () }': ()
65..77 'async { () }': impl Future<Output = ()>
65..83 'async ....await': ()
- 71..77 '{ () }': ()
73..75 '()': ()
95..96 'z': {unknown}
+ 99..109 'try { () }': ()
99..109 'try { () }': {unknown}
- 103..109 '{ () }': ()
105..107 '()': ()
119..120 'w': i32
123..135 'const { 92 }': i32
- 129..135 '{ 92 }': i32
+ 123..135 'const { 92 }': i32
131..133 '92': i32
145..146 't': i32
- 153..159 '{ 92 }': i32
+ 149..159 ''a: { 92 }': i32
155..157 '92': i32
"#]],
)
@@ -2104,32 +2104,32 @@ fn infer_labelled_break_with_val() {
fn infer_labelled_block_break_with_val() {
check_infer(
r#"
- fn default<T>() -> T { loop {} }
- fn foo() {
- let _x = 'outer: {
- let inner = 'inner: {
- let i = default();
- if (break 'outer i) {
- break 'inner 5i8;
- } else if true {
- break 'inner 6;
- }
- break 'inner 'innermost: { 0 };
- 42
- };
- break 'outer inner < 8;
- };
- }
- "#,
+fn default<T>() -> T { loop {} }
+fn foo() {
+ let _x = 'outer: {
+ let inner = 'inner: {
+ let i = default();
+ if (break 'outer i) {
+ break 'inner 5i8;
+ } else if true {
+ break 'inner 6;
+ }
+ break 'inner 'innermost: { 0 };
+ 42
+ };
+ break 'outer inner < 8;
+ };
+}
+"#,
expect![[r#"
21..32 '{ loop {} }': T
23..30 'loop {}': !
28..30 '{}': ()
42..381 '{ ... }; }': ()
52..54 '_x': bool
- 65..378 '{ ... }': bool
+ 57..378 ''outer... }': bool
79..84 'inner': i8
- 95..339 '{ ... }': i8
+ 87..339 ''inner... }': i8
113..114 'i': bool
117..124 'default': fn default<bool>() -> bool
117..126 'default()': bool
@@ -2145,7 +2145,7 @@ fn infer_labelled_block_break_with_val() {
241..255 'break 'inner 6': !
254..255 '6': i8
283..313 'break ... { 0 }': !
- 308..313 '{ 0 }': i8
+ 296..313 ''inner... { 0 }': i8
310..311 '0': i8
327..329 '42': i8
349..371 'break ...er < 8': !
diff --git a/crates/ide/src/highlight_related.rs b/crates/ide/src/highlight_related.rs
index d305f82fcb..6aef3a9429 100644
--- a/crates/ide/src/highlight_related.rs
+++ b/crates/ide/src/highlight_related.rs
@@ -164,8 +164,8 @@ fn highlight_exit_points(
match anc {
ast::Fn(fn_) => hl(sema, fn_.body().map(ast::Expr::BlockExpr)),
ast::ClosureExpr(closure) => hl(sema, closure.body()),
- ast::EffectExpr(effect) => if matches!(effect.effect(), ast::Effect::Async(_) | ast::Effect::Try(_)| ast::Effect::Const(_)) {
- hl(sema, effect.block_expr().map(ast::Expr::BlockExpr))
+ ast::BlockExpr(block_expr) => if matches!(block_expr.modifier(), Some(ast::BlockModifier::Async(_) | ast::BlockModifier::Try(_)| ast::BlockModifier::Const(_))) {
+ hl(sema, Some(block_expr.into()))
} else {
continue;
},
@@ -180,7 +180,7 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
fn hl(
token: Option<SyntaxToken>,
label: Option<ast::Label>,
- body: Option<ast::BlockExpr>,
+ body: Option<ast::StmtList>,
) -> Option<Vec<HighlightedRange>> {
let mut highlights = Vec::new();
let range = cover_range(
@@ -204,7 +204,7 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
ast::LoopExpr(l) => l.label().and_then(|it| it.lifetime()),
ast::ForExpr(f) => f.label().and_then(|it| it.lifetime()),
ast::WhileExpr(w) => w.label().and_then(|it| it.lifetime()),
- ast::EffectExpr(b) => Some(b.label().and_then(|it| it.lifetime())?),
+ ast::BlockExpr(b) => Some(b.label().and_then(|it| it.lifetime())?),
_ => return None,
}
};
@@ -218,16 +218,16 @@ fn highlight_break_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
for anc in token.ancestors().flat_map(ast::Expr::cast) {
return match anc {
ast::Expr::LoopExpr(l) if label_matches(l.label()) => {
- hl(l.loop_token(), l.label(), l.loop_body())
+ hl(l.loop_token(), l.label(), l.loop_body().and_then(|it| it.stmt_list()))
}
ast::Expr::ForExpr(f) if label_matches(f.label()) => {
- hl(f.for_token(), f.label(), f.loop_body())
+ hl(f.for_token(), f.label(), f.loop_body().and_then(|it| it.stmt_list()))
}
ast::Expr::WhileExpr(w) if label_matches(w.label()) => {
- hl(w.while_token(), w.label(), w.loop_body())
+ hl(w.while_token(), w.label(), w.loop_body().and_then(|it| it.stmt_list()))
}
- ast::Expr::EffectExpr(e) if e.label().is_some() && label_matches(e.label()) => {
- hl(None, e.label(), e.block_expr())
+ ast::Expr::BlockExpr(e) if e.label().is_some() && label_matches(e.label()) => {
+ hl(None, e.label(), e.stmt_list())
}
_ => continue,
};
@@ -258,7 +258,12 @@ fn highlight_yield_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
return match_ast! {
match anc {
ast::Fn(fn_) => hl(fn_.async_token(), fn_.body().map(ast::Expr::BlockExpr)),
- ast::EffectExpr(effect) => hl(effect.async_token(), effect.block_expr().map(ast::Expr::BlockExpr)),
+ ast::BlockExpr(block_expr) => {
+ if block_expr.async_token().is_none() {
+ continue;
+ }
+ hl(block_expr.async_token(), Some(block_expr.into()))
+ },
ast::ClosureExpr(closure) => hl(closure.async_token(), closure.body()),
_ => continue,
}
diff --git a/crates/ide/src/hover/render.rs b/crates/ide/src/hover/render.rs
index 5b516de4c6..7f9a91286a 100644
--- a/crates/ide/src/hover/render.rs
+++ b/crates/ide/src/hover/render.rs
@@ -86,8 +86,8 @@ pub(super) fn try_expr(
ast::Fn(fn_) => sema.to_def(&fn_)?.ret_type(sema.db),
ast::Item(__) => return None,
ast::ClosureExpr(closure) => sema.type_of_expr(&closure.body()?)?.original,
- ast::EffectExpr(effect) => if matches!(effect.effect(), ast::Effect::Async(_) | ast::Effect::Try(_)| ast::Effect::Const(_)) {
- sema.type_of_expr(&effect.block_expr()?.into())?.original
+ ast::BlockExpr(block_expr) => if matches!(block_expr.modifier(), Some(ast::BlockModifier::Async(_) | ast::BlockModifier::Try(_)| ast::BlockModifier::Const(_))) {
+ sema.type_of_expr(&block_expr.into())?.original
} else {
continue;
},
diff --git a/crates/ide/src/join_lines.rs b/crates/ide/src/join_lines.rs
index 8eb2e49359..000d74abac 100644
--- a/crates/ide/src/join_lines.rs
+++ b/crates/ide/src/join_lines.rs
@@ -212,7 +212,7 @@ fn remove_newline(
}
fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> {
- let block_expr = ast::BlockExpr::cast(token.parent()?)?;
+ let block_expr = ast::BlockExpr::cast(token.ancestors().nth(1)?)?;
if !block_expr.is_standalone() {
return None;
}
diff --git a/crates/ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs
index 633878d1c6..1771b56fe3 100644
--- a/crates/ide/src/syntax_tree.rs
+++ b/crates/ide/src/syntax_tree.rs
@@ -133,8 +133,9 @@ mod tests {
"#]],
);
@@ -158,25 +159,26 @@ fn test() {
- [email protected] "\"\n fn foo() {\n ..."
+ [email protected] "\"\n fn foo() {\n ..."
"#]],
)
}
@@ -196,8 +198,9 @@ fn test() {
"#]],
);
@@ -252,9 +255,10 @@ fn bar() {
"#]],
);
@@ -280,9 +284,10 @@ fn bar() {
"#]],
);
@@ -307,9 +312,10 @@ fn bar() {
@@ -321,9 +327,10 @@ fn bar() {
"#]],
);
}
diff --git a/crates/ide_assists/src/handlers/add_return_type.rs b/crates/ide_assists/src/handlers/add_return_type.rs
index ce5981b406..2ecdf33607 100644
--- a/crates/ide_assists/src/handlers/add_return_type.rs
+++ b/crates/ide_assists/src/handlers/add_return_type.rs
@@ -100,9 +100,10 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla
let action = ret_ty_to_action(func.ret_type(), rparen_pos)?;
let body = func.body()?;
- let tail_expr = body.tail_expr()?;
+ let stmt_list = body.stmt_list()?;
+ let tail_expr = stmt_list.tail_expr()?;
- let ret_range_end = body.l_curly_token()?.text_range().start();
+ let ret_range_end = stmt_list.l_curly_token()?.text_range().start();
let ret_range = TextRange::new(rparen_pos, ret_range_end);
(FnType::Function, tail_expr, ret_range, action)
};
diff --git a/crates/ide_assists/src/handlers/convert_to_guarded_return.rs b/crates/ide_assists/src/handlers/convert_to_guarded_return.rs
index 1ec0e0a5da..884905a918 100644
--- a/crates/ide_assists/src/handlers/convert_to_guarded_return.rs
+++ b/crates/ide_assists/src/handlers/convert_to_guarded_return.rs
@@ -68,6 +68,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
let cond_expr = cond.expr()?;
let then_block = if_expr.then_branch()?;
+ let then_block = then_block.stmt_list()?;
let parent_block = if_expr.syntax().parent()?.ancestors().find_map(ast::BlockExpr::cast)?;
@@ -75,6 +76,9 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
return None;
}
+ // FIXME: This relies on untyped syntax tree and casts to much. It should be
+ // rewritten to use strongly-typed APIs.
+
// check for early return and continue
let first_in_then_block = then_block.syntax().first_child()?;
if ast::ReturnExpr::can_cast(first_in_then_block.kind())
diff --git a/crates/ide_assists/src/handlers/extract_function.rs b/crates/ide_assists/src/handlers/extract_function.rs
index 328d172cb8..733bb34788 100644
--- a/crates/ide_assists/src/handlers/extract_function.rs
+++ b/crates/ide_assists/src/handlers/extract_function.rs
@@ -148,24 +148,30 @@ fn extraction_target(node: &SyntaxNode, selection_range: TextRange) -> Option<Fu
return match stmt {
ast::Stmt::Item(_) => None,
ast::Stmt::ExprStmt(_) | ast::Stmt::LetStmt(_) => Some(FunctionBody::from_range(
- node.parent().and_then(ast::BlockExpr::cast)?,
+ node.parent().and_then(ast::StmtList::cast)?,
node.text_range(),
)),
};
}
+ // Covering element returned the parent block of one or multiple statements that have been selected
+ if let Some(stmt_list) = ast::StmtList::cast(node.clone()) {
+ if let Some(block_expr) = stmt_list.syntax().parent().and_then(ast::BlockExpr::cast) {
+ if block_expr.syntax().text_range() == selection_range {
+ return FunctionBody::from_expr(block_expr.into());
+ }
+ }
+
+ // Extract the full statements.
+ return Some(FunctionBody::from_range(stmt_list, selection_range));
+ }
+
let expr = ast::Expr::cast(node.clone())?;
// A node got selected fully
if node.text_range() == selection_range {
return FunctionBody::from_expr(expr.clone());
}
- // Covering element returned the parent block of one or multiple statements that have been selected
- if let ast::Expr::BlockExpr(block) = expr {
- // Extract the full statements.
- return Some(FunctionBody::from_range(block, selection_range));
- }
-
node.ancestors().find_map(ast::Expr::cast).and_then(FunctionBody::from_expr)
}
@@ -284,7 +290,7 @@ impl RetType {
#[derive(Debug)]
enum FunctionBody {
Expr(ast::Expr),
- Span { parent: ast::BlockExpr, text_range: TextRange },
+ Span { parent: ast::StmtList, text_range: TextRange },
}
#[derive(Debug)]
@@ -441,7 +447,7 @@ impl FunctionBody {
}
}
- fn from_range(parent: ast::BlockExpr, selected: TextRange) -> FunctionBody {
+ fn from_range(parent: ast::StmtList, selected: TextRange) -> FunctionBody {
let mut text_range = parent
.statements()
.map(|stmt| stmt.syntax().text_range())
@@ -643,14 +649,14 @@ impl FunctionBody {
break match_ast! {
match anc {
ast::ClosureExpr(closure) => (false, closure.body(), infer_expr_opt(closure.body())),
- ast::EffectExpr(effect) => {
- let (constness, block) = match effect.effect() {
- ast::Effect::Const(_) => (true, effect.block_expr()),
- ast::Effect::Try(_) => (false, effect.block_expr()),
- ast::Effect::Label(label) if label.lifetime().is_some() => (false, effect.block_expr()),
+ ast::BlockExpr(block_expr) => {
+ let (constness, block) = match block_expr.modifier() {
+ Some(ast::BlockModifier::Const(_)) => (true, block_expr),
+ Some(ast::BlockModifier::Try(_)) => (false, block_expr),
+ Some(ast::BlockModifier::Label(label)) if label.lifetime().is_some() => (false, block_expr),
_ => continue,
};
- let expr = block.map(ast::Expr::BlockExpr);
+ let expr = Some(ast::Expr::BlockExpr(block));
(constness, expr.clone(), infer_expr_opt(expr))
},
ast::Fn(fn_) => {
@@ -745,7 +751,7 @@ impl FunctionBody {
ast::Expr::LoopExpr(_)
| ast::Expr::ForExpr(_)
| ast::Expr::WhileExpr(_) => loop_depth -= 1,
- ast::Expr::EffectExpr(effect) if effect.unsafe_token().is_some() => {
+ ast::Expr::BlockExpr(block_expr) if block_expr.unsafe_token().is_some() => {
unsafe_depth -= 1
}
_ => (),
@@ -757,7 +763,7 @@ impl FunctionBody {
ast::Expr::LoopExpr(_) | ast::Expr::ForExpr(_) | ast::Expr::WhileExpr(_) => {
loop_depth += 1;
}
- ast::Expr::EffectExpr(effect) if effect.unsafe_token().is_some() => {
+ ast::Expr::BlockExpr(block_expr) if block_expr.unsafe_token().is_some() => {
unsafe_depth += 1
}
ast::Expr::ReturnExpr(it) => {
diff --git a/crates/ide_assists/src/handlers/extract_variable.rs b/crates/ide_assists/src/handlers/extract_variable.rs
index 9398b84b3f..9b4e1380a4 100644
--- a/crates/ide_assists/src/handlers/extract_variable.rs
+++ b/crates/ide_assists/src/handlers/extract_variable.rs
@@ -137,6 +137,7 @@ fn valid_target_expr(node: SyntaxNode) -> Option<ast::Expr> {
}
}
+#[derive(Debug)]
enum Anchor {
Before(SyntaxNode),
Replace(ast::ExprStmt),
@@ -148,7 +149,7 @@ impl Anchor {
to_extract.syntax().ancestors().take_while(|it| !ast::Item::can_cast(it.kind())).find_map(
|node| {
if let Some(expr) =
- node.parent().and_then(ast::BlockExpr::cast).and_then(|it| it.tail_expr())
+ node.parent().and_then(ast::StmtList::cast).and_then(|it| it.tail_expr())
{
if expr.syntax() == &node {
cov_mark::hit!(test_extract_var_last_expr);
diff --git a/crates/ide_assists/src/handlers/inline_call.rs b/crates/ide_assists/src/handlers/inline_call.rs
index 9927ceb74e..bd566ec820 100644
--- a/crates/ide_assists/src/handlers/inline_call.rs
+++ b/crates/ide_assists/src/handlers/inline_call.rs
@@ -389,9 +389,13 @@ fn inline(
_ => {
let ty =
sema.type_of_expr(expr).filter(TypeInfo::has_adjustment).and(param_ty.clone());
- body.push_front(
- make::let_stmt(pat.clone(), ty, Some(expr.clone())).clone_for_update().into(),
- )
+ if let Some(stmt_list) = body.stmt_list() {
+ stmt_list.push_front(
+ make::let_stmt(pat.clone(), ty, Some(expr.clone()))
+ .clone_for_update()
+ .into(),
+ )
+ }
}
}
}
diff --git a/crates/ide_assists/src/handlers/inline_local_variable.rs b/crates/ide_assists/src/handlers/inline_local_variable.rs
index 7e5c787058..337cd6cb5a 100644
--- a/crates/ide_assists/src/handlers/inline_local_variable.rs
+++ b/crates/ide_assists/src/handlers/inline_local_variable.rs
@@ -93,8 +93,7 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O
| ast::Expr::ArrayExpr(_)
| ast::Expr::ParenExpr(_)
| ast::Expr::PathExpr(_)
- | ast::Expr::BlockExpr(_)
- | ast::Expr::EffectExpr(_),
+ | ast::Expr::BlockExpr(_),
);
let parent = matches!(
usage_parent,
diff --git a/crates/ide_assists/src/handlers/remove_dbg.rs b/crates/ide_assists/src/handlers/remove_dbg.rs
index e6aab9e848..b860a3b6da 100644
--- a/crates/ide_assists/src/handlers/remove_dbg.rs
+++ b/crates/ide_assists/src/handlers/remove_dbg.rs
@@ -46,7 +46,7 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
[] => {
match_ast! {
match parent {
- ast::BlockExpr(__) => {
+ ast::StmtList(__) => {
let range = macro_call.syntax().text_range();
let range = match whitespace_start(macro_call.syntax().prev_sibling_or_token()) {
Some(start) => range.cover_offset(start),
diff --git a/crates/ide_assists/src/handlers/unwrap_block.rs b/crates/ide_assists/src/handlers/unwrap_block.rs
index cd6084f6b3..9171874e9d 100644
--- a/crates/ide_assists/src/handlers/unwrap_block.rs
+++ b/crates/ide_assists/src/handlers/unwrap_block.rs
@@ -30,14 +30,14 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
let assist_label = "Unwrap block";
let l_curly_token = ctx.find_token_syntax_at_offset(T!['{'])?;
- let mut block = ast::BlockExpr::cast(l_curly_token.parent()?)?;
+ let mut block = ast::BlockExpr::cast(l_curly_token.ancestors().nth(1)?)?;
let target = block.syntax().text_range();
let mut parent = block.syntax().parent()?;
if ast::MatchArm::can_cast(parent.kind()) {
parent = parent.ancestors().find(|it| ast::MatchExpr::can_cast(it.kind()))?
}
- if matches!(parent.kind(), SyntaxKind::BLOCK_EXPR | SyntaxKind::EXPR_STMT) {
+ if matches!(parent.kind(), SyntaxKind::STMT_LIST | SyntaxKind::EXPR_STMT) {
return acc.add(assist_id, assist_label, target, |builder| {
builder.replace(block.syntax().text_range(), update_expr_string(block.to_string()));
});
diff --git a/crates/ide_assists/src/utils.rs b/crates/ide_assists/src/utils.rs
index 2431f5c4e7..aa0956d0f6 100644
--- a/crates/ide_assists/src/utils.rs
+++ b/crates/ide_assists/src/utils.rs
@@ -25,30 +25,34 @@ use crate::assist_context::{AssistBuilder, AssistContext};
pub(crate) use gen_trait_fn_body::gen_trait_fn_body;
-pub(crate) fn unwrap_trivial_block(block: ast::BlockExpr) -> ast::Expr {
- extract_trivial_expression(&block)
+pub(crate) fn unwrap_trivial_block(block_expr: ast::BlockExpr) -> ast::Expr {
+ extract_trivial_expression(&block_expr)
.filter(|expr| !expr.syntax().text().contains_char('\n'))
- .unwrap_or_else(|| block.into())
+ .unwrap_or_else(|| block_expr.into())
}
-pub fn extract_trivial_expression(block: &ast::BlockExpr) -> Option<ast::Expr> {
+pub fn extract_trivial_expression(block_expr: &ast::BlockExpr) -> Option<ast::Expr> {
+ if block_expr.modifier().is_some() {
+ return None;
+ }
+ let stmt_list = block_expr.stmt_list()?;
let has_anything_else = |thing: &SyntaxNode| -> bool {
let mut non_trivial_children =
- block.syntax().children_with_tokens().filter(|it| match it.kind() {
+ stmt_list.syntax().children_with_tokens().filter(|it| match it.kind() {
WHITESPACE | T!['{'] | T!['}'] => false,
_ => it.as_node() != Some(thing),
});
non_trivial_children.next().is_some()
};
- if let Some(expr) = block.tail_expr() {
+ if let Some(expr) = stmt_list.tail_expr() {
if has_anything_else(expr.syntax()) {
return None;
}
return Some(expr);
}
// Unwrap `{ continue; }`
- let stmt = block.statements().next()?;
+ let stmt = stmt_list.statements().next()?;
if let ast::Stmt::ExprStmt(expr_stmt) = stmt {
if has_anything_else(expr_stmt.syntax()) {
return None;
diff --git a/crates/ide_completion/src/completions/postfix.rs b/crates/ide_completion/src/completions/postfix.rs
index b9eaccaf55..7edd2e2876 100644
--- a/crates/ide_completion/src/completions/postfix.rs
+++ b/crates/ide_completion/src/completions/postfix.rs
@@ -8,7 +8,7 @@ use ide_db::{
};
use syntax::{
ast::{self, AstNode, AstToken},
- SyntaxKind::{BLOCK_EXPR, EXPR_STMT},
+ SyntaxKind::{EXPR_STMT, STMT_LIST},
TextRange, TextSize,
};
use text_edit::TextEdit;
@@ -256,7 +256,7 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
.add_to(acc);
if let Some(parent) = dot_receiver.syntax().parent().and_then(|p| p.parent()) {
- if matches!(parent.kind(), BLOCK_EXPR | EXPR_STMT) {
+ if matches!(parent.kind(), STMT_LIST | EXPR_STMT) {
postfix_snippet(
ctx,
cap,
diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs
index abc021acf1..7d5c36d01f 100644
--- a/crates/ide_completion/src/context.rs
+++ b/crates/ide_completion/src/context.rs
@@ -326,7 +326,7 @@ impl<'a> CompletionContext<'a> {
}
pub(crate) fn has_block_expr_parent(&self) -> bool {
- matches!(self.completion_location, Some(ImmediateLocation::BlockExpr))
+ matches!(self.completion_location, Some(ImmediateLocation::StmtList))
}
pub(crate) fn expects_ident_pat_or_ref_expr(&self) -> bool {
@@ -818,9 +818,9 @@ impl<'a> CompletionContext<'a> {
if let Some(stmt) = ast::ExprStmt::cast(node.clone()) {
return Some(stmt.syntax().text_range() == name_ref.syntax().text_range());
}
- if let Some(block) = ast::BlockExpr::cast(node) {
+ if let Some(stmt_list) = ast::StmtList::cast(node) {
return Some(
- block.tail_expr().map(|e| e.syntax().text_range())
+ stmt_list.tail_expr().map(|e| e.syntax().text_range())
== Some(name_ref.syntax().text_range()),
);
}
diff --git a/crates/ide_completion/src/patterns.rs b/crates/ide_completion/src/patterns.rs
index 6ceef0225a..05792dd47e 100644
--- a/crates/ide_completion/src/patterns.rs
+++ b/crates/ide_completion/src/patterns.rs
@@ -38,7 +38,7 @@ pub(crate) enum ImmediateLocation {
TupleField,
RefExpr,
IdentPat,
- BlockExpr,
+ StmtList,
ItemList,
TypeBound,
// Fake file ast node
@@ -201,7 +201,7 @@ pub(crate) fn determine_location(
ast::Use(_it) => ImmediateLocation::Use,
ast::UseTree(_it) => ImmediateLocation::UseTree,
ast::UseTreeList(_it) => ImmediateLocation::UseTree,
- ast::BlockExpr(_it) => ImmediateLocation::BlockExpr,
+ ast::StmtList(_it) => ImmediateLocation::StmtList,
ast::SourceFile(_it) => ImmediateLocation::ItemList,
ast::ItemList(_it) => ImmediateLocation::ItemList,
ast::RefExpr(_it) => ImmediateLocation::RefExpr,
@@ -421,8 +421,8 @@ mod tests {
#[test]
fn test_block_expr_loc() {
- check_location(r"fn my_fn() { let a = 2; f$0 }", ImmediateLocation::BlockExpr);
- check_location(r"fn my_fn() { f$0 f }", ImmediateLocation::BlockExpr);
+ check_location(r"fn my_fn() { let a = 2; f$0 }", ImmediateLocation::StmtList);
+ check_location(r"fn my_fn() { f$0 f }", ImmediateLocation::StmtList);
}
#[test]
diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs
index c92893716f..a52c4046bf 100644
--- a/crates/ide_db/src/helpers.rs
+++ b/crates/ide_db/src/helpers.rs
@@ -139,26 +139,27 @@ impl SnippetCap {
pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
match expr {
ast::Expr::BlockExpr(b) => {
- if let Some(e) = b.tail_expr() {
- for_each_tail_expr(&e, cb);
- }
- }
- ast::Expr::EffectExpr(e) => match e.effect() {
- ast::Effect::Label(label) => {
- for_each_break_expr(Some(label), e.block_expr(), &mut |b| {
- cb(&ast::Expr::BreakExpr(b))
- });
- if let Some(b) = e.block_expr() {
- for_each_tail_expr(&ast::Expr::BlockExpr(b), cb);
+ match b.modifier() {
+ Some(
+ ast::BlockModifier::Async(_)
+ | ast::BlockModifier::Try(_)
+ | ast::BlockModifier::Const(_),
+ ) => return cb(expr),
+
+ Some(ast::BlockModifier::Label(label)) => {
+ for_each_break_expr(Some(label), b.stmt_list(), &mut |b| {
+ cb(&ast::Expr::BreakExpr(b))
+ });
}
+ Some(ast::BlockModifier::Unsafe(_)) => (),
+ None => (),
}
- ast::Effect::Unsafe(_) => {
- if let Some(e) = e.block_expr().and_then(|b| b.tail_expr()) {
+ if let Some(stmt_list) = b.stmt_list() {
+ if let Some(e) = stmt_list.tail_expr() {
for_each_tail_expr(&e, cb);
}
}
- ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_) => cb(expr),
- },
+ }
ast::Expr::IfExpr(if_) => {
let mut if_ = if_.clone();
loop {
@@ -176,7 +177,9 @@ pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
}
}
ast::Expr::LoopExpr(l) => {
- for_each_break_expr(l.label(), l.loop_body(), &mut |b| cb(&ast::Expr::BreakExpr(b)))
+ for_each_break_expr(l.label(), l.loop_body().and_then(|it| it.stmt_list()), &mut |b| {
+ cb(&ast::Expr::BreakExpr(b))
+ })
}
ast::Expr::MatchExpr(m) => {
if let Some(arms) = m.match_arm_list() {
@@ -216,7 +219,7 @@ pub fn for_each_tail_expr(expr: &ast::Expr, cb: &mut dyn FnMut(&ast::Expr)) {
/// Calls `cb` on each break expr inside of `body` that is applicable for the given label.
pub fn for_each_break_expr(
label: Option<ast::Label>,
- body: Option<ast::BlockExpr>,
+ body: Option<ast::StmtList>,
cb: &mut dyn FnMut(ast::BreakExpr),
) {
let label = label.and_then(|lbl| lbl.lifetime());
@@ -236,7 +239,7 @@ pub fn for_each_break_expr(
ast::Expr::LoopExpr(_) | ast::Expr::WhileExpr(_) | ast::Expr::ForExpr(_) => {
depth += 1
}
- ast::Expr::EffectExpr(e) if e.label().is_some() => depth += 1,
+ ast::Expr::BlockExpr(e) if e.label().is_some() => depth += 1,
ast::Expr::BreakExpr(b)
if (depth == 0 && b.lifetime().is_none()) || eq_label(b.lifetime()) =>
{
@@ -248,7 +251,7 @@ pub fn for_each_break_expr(
ast::Expr::LoopExpr(_) | ast::Expr::WhileExpr(_) | ast::Expr::ForExpr(_) => {
depth -= 1
}
- ast::Expr::EffectExpr(e) if e.label().is_some() => depth -= 1,
+ ast::Expr::BlockExpr(e) if e.label().is_some() => depth -= 1,
_ => (),
},
}
diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs
index 8acad6a8ca..a8ac0a9006 100644
--- a/crates/ide_db/src/helpers/insert_use.rs
+++ b/crates/ide_db/src/helpers/insert_use.rs
@@ -46,7 +46,7 @@ pub struct InsertUseConfig {
pub enum ImportScope {
File(ast::SourceFile),
Module(ast::ItemList),
- Block(ast::BlockExpr),
+ Block(ast::StmtList),
}
impl ImportScope {
@@ -60,15 +60,15 @@ impl ImportScope {
match syntax {
ast::Module(module) => module.item_list().map(ImportScope::Module),
ast::SourceFile(file) => Some(ImportScope::File(file)),
- ast::Fn(func) => contains_cfg_attr(&func).then(|| func.body().map(ImportScope::Block)).flatten(),
+ ast::Fn(func) => contains_cfg_attr(&func).then(|| func.body().and_then(|it| it.stmt_list().map(ImportScope::Block))).flatten(),
ast::Const(konst) => contains_cfg_attr(&konst).then(|| match konst.body()? {
ast::Expr::BlockExpr(block) => Some(block),
_ => None,
- }).flatten().map(ImportScope::Block),
+ }).flatten().and_then(|it| it.stmt_list().map(ImportScope::Block)),
ast::Static(statik) => contains_cfg_attr(&statik).then(|| match statik.body()? {
ast::Expr::BlockExpr(block) => Some(block),
_ => None,
- }).flatten().map(ImportScope::Block),
+ }).flatten().and_then(|it| it.stmt_list().map(ImportScope::Block)),
_ => None,
}
diff --git a/crates/ide_db/src/helpers/insert_use/tests.rs b/crates/ide_db/src/helpers/insert_use/tests.rs
index c5420f4679..339360ba4a 100644
--- a/crates/ide_db/src/helpers/insert_use/tests.rs
+++ b/crates/ide_db/src/helpers/insert_use/tests.rs
@@ -1,8 +1,8 @@
-use super::*;
-
use hir::PrefixKind;
use test_utils::{assert_eq_text, extract_range_or_offset, CURSOR_MARKER};
+use super::*;
+
#[test]
fn respects_cfg_attr_fn() {
check(
diff --git a/crates/ide_db/src/helpers/node_ext.rs b/crates/ide_db/src/helpers/node_ext.rs
index 24f853737b..fe823f74f8 100644
--- a/crates/ide_db/src/helpers/node_ext.rs
+++ b/crates/ide_db/src/helpers/node_ext.rs
@@ -32,8 +32,8 @@ pub fn walk_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Expr)) {
/// Preorder walk all the expression's child expressions preserving events.
/// If the callback returns true on an [`WalkEvent::Enter`], the subtree of the expression will be skipped.
/// Note that the subtree may already be skipped due to the context analysis this function does.
-pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>) -> bool) {
- let mut preorder = expr.syntax().preorder();
+pub fn preorder_expr(start: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>) -> bool) {
+ let mut preorder = start.syntax().preorder();
while let Some(event) = preorder.next() {
let node = match event {
WalkEvent::Enter(node) => node,
@@ -44,17 +44,17 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
continue;
}
};
- match ast::Stmt::cast(node.clone()) {
- // recursively walk the initializer, skipping potential const pat expressions
- // let statements aren't usually nested too deeply so this is fine to recurse on
- Some(ast::Stmt::LetStmt(l)) => {
- if let Some(expr) = l.initializer() {
- preorder_expr(&expr, cb);
- }
+ if let Some(let_stmt) = node.parent().and_then(ast::LetStmt::cast) {
+ if Some(node.clone()) != let_stmt.initializer().map(|it| it.syntax().clone()) {
+ // skipping potential const pat expressions in let statements
preorder.skip_subtree();
+ continue;
}
+ }
+
+ match ast::Stmt::cast(node.clone()) {
// Don't skip subtree since we want to process the expression child next
- Some(ast::Stmt::ExprStmt(_)) => (),
+ Some(ast::Stmt::ExprStmt(_)) | Some(ast::Stmt::LetStmt(_)) => (),
// This might be an expression
Some(ast::Stmt::Item(ast::Item::MacroCall(mcall))) => {
cb(WalkEvent::Enter(ast::Expr::MacroCall(mcall)));
@@ -68,15 +68,19 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
preorder.skip_subtree();
} else if let Some(expr) = ast::Expr::cast(node) {
let is_different_context = match &expr {
- ast::Expr::EffectExpr(effect) => {
+ ast::Expr::BlockExpr(block_expr) => {
matches!(
- effect.effect(),
- ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_)
+ block_expr.modifier(),
+ Some(
+ ast::BlockModifier::Async(_)
+ | ast::BlockModifier::Try(_)
+ | ast::BlockModifier::Const(_)
+ )
)
}
ast::Expr::ClosureExpr(_) => true,
_ => false,
- };
+ } && expr.syntax() != start.syntax();
let skip = cb(WalkEvent::Enter(expr));
if skip || is_different_context {
preorder.skip_subtree();
@@ -88,8 +92,8 @@ pub fn preorder_expr(expr: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
}
/// Preorder walk all the expression's child patterns.
-pub fn walk_patterns_in_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
- let mut preorder = expr.syntax().preorder();
+pub fn walk_patterns_in_expr(start: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
+ let mut preorder = start.syntax().preorder();
while let Some(event) = preorder.next() {
let node = match event {
WalkEvent::Enter(node) => node,
@@ -115,15 +119,19 @@ pub fn walk_patterns_in_expr(expr: &ast::Expr, cb: &mut dyn FnMut(ast::Pat)) {
preorder.skip_subtree();
} else if let Some(expr) = ast::Expr::cast(node.clone()) {
let is_different_context = match &expr {
- ast::Expr::EffectExpr(effect) => match effect.effect() {
- ast::Effect::Async(_) | ast::Effect::Try(_) | ast::Effect::Const(_) => {
- true
- }
- ast::Effect::Unsafe(_) | ast::Effect::Label(_) => false,
- },
+ ast::Expr::BlockExpr(block_expr) => {
+ matches!(
+ block_expr.modifier(),
+ Some(
+ ast::BlockModifier::Async(_)
+ | ast::BlockModifier::Try(_)
+ | ast::BlockModifier::Const(_)
+ )
+ )
+ }
ast::Expr::ClosureExpr(_) => true,
_ => false,
- };
+ } && expr.syntax() != start.syntax();
if is_different_context {
preorder.skip_subtree();
}
diff --git a/crates/mbe/src/tests/expand.rs b/crates/mbe/src/tests/expand.rs
index eb2e2f6a50..df374aea98 100644
--- a/crates/mbe/src/tests/expand.rs
+++ b/crates/mbe/src/tests/expand.rs
@@ -217,20 +217,21 @@ fn test_expr_order() {
dump.trim()
);
}
@@ -1320,70 +1321,72 @@ fn test_vec() {
let tree = fixture.expand_expr(r#"vec![1u32,2];"#);
- assert_eq!(
- format!("{:#?}", tree).trim(),
+ assert_eq_text!(
+ &format!("{:#?}", tree),
+"#
);
}
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index f6e9a5f1b3..bb70c0d932 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -93,8 +93,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
// test labeled_block
// fn f() { 'label: {}; }
T!['{'] => {
- block_expr(p);
- m.complete(p, EFFECT_EXPR)
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR)
}
_ => {
// test_err misplaced_label_err
@@ -111,8 +111,8 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
let m = p.start();
p.bump(T![async]);
p.eat(T![move]);
- block_expr(p);
- m.complete(p, EFFECT_EXPR)
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR)
}
T![match] => match_expr(p),
// test unsafe_block
@@ -120,16 +120,16 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
T![unsafe] if la == T!['{'] => {
let m = p.start();
p.bump(T![unsafe]);
- block_expr(p);
- m.complete(p, EFFECT_EXPR)
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR)
}
// test const_block
// fn f() { const { } }
T![const] if la == T!['{'] => {
let m = p.start();
p.bump(T![const]);
- block_expr(p);
- m.complete(p, EFFECT_EXPR)
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR)
}
T!['{'] => {
// test for_range_from
@@ -138,7 +138,9 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
// break;
// }
// }
- block_expr_unchecked(p)
+ let m = p.start();
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR)
}
T![return] => return_expr(p),
T![yield] => yield_expr(p),
@@ -150,9 +152,7 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
}
};
let blocklike = match done.kind() {
- IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR | EFFECT_EXPR => {
- BlockLike::Block
- }
+ IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR | BLOCK_EXPR => BlockLike::Block,
_ => BlockLike::NotBlock,
};
Some((done, blocklike))
@@ -486,16 +486,18 @@ pub(crate) fn block_expr(p: &mut Parser) {
p.error("expected a block");
return;
}
- block_expr_unchecked(p);
+ let m = p.start();
+ stmt_list(p);
+ m.complete(p, BLOCK_EXPR);
}
-fn block_expr_unchecked(p: &mut Parser) -> CompletedMarker {
+fn stmt_list(p: &mut Parser) -> CompletedMarker {
assert!(p.at(T!['{']));
let m = p.start();
p.bump(T!['{']);
expr_block_contents(p);
p.expect(T!['}']);
- m.complete(p, BLOCK_EXPR)
+ m.complete(p, STMT_LIST)
}
// test return_expr
@@ -597,8 +599,12 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
}
p.bump(T![try]);
- block_expr(p);
- m.complete(p, EFFECT_EXPR)
+ if p.at(T!['{']) {
+ stmt_list(p);
+ } else {
+ p.error("expected a block")
+ }
+ m.complete(p, BLOCK_EXPR)
}
// test box_expr
diff --git a/crates/parser/src/syntax_kind/generated.rs b/crates/parser/src/syntax_kind/generated.rs
index 0986b23bf8..842d66755c 100644
--- a/crates/parser/src/syntax_kind/generated.rs
+++ b/crates/parser/src/syntax_kind/generated.rs
@@ -187,6 +187,7 @@ pub enum SyntaxKind {
BREAK_EXPR,
LABEL,
BLOCK_EXPR,
+ STMT_LIST,
RETURN_EXPR,
YIELD_EXPR,
MATCH_EXPR,
@@ -196,7 +197,6 @@ pub enum SyntaxKind {
RECORD_EXPR,
RECORD_EXPR_FIELD_LIST,
RECORD_EXPR_FIELD,
- EFFECT_EXPR,
BOX_EXPR,
CALL_EXPR,
INDEX_EXPR,
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index 6a48a322a6..f889fa2a2c 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -29,7 +29,7 @@ rayon = "1"
expect-test = "1.1"
proc-macro2 = "1.0.8"
quote = "1.0.2"
-ungrammar = "=1.14"
+ungrammar = "=1.14.5"
test_utils = { path = "../test_utils" }
sourcegen = { path = "../sourcegen" }
diff --git a/crates/syntax/src/ast.rs b/crates/syntax/src/ast.rs
index 7c9200f568..e07b22a550 100644
--- a/crates/syntax/src/ast.rs
+++ b/crates/syntax/src/ast.rs
@@ -18,7 +18,7 @@ use crate::{
};
pub use self::{
- expr_ext::{ArrayExprKind, Effect, ElseBranch, LiteralKind},
+ expr_ext::{ArrayExprKind, BlockModifier, ElseBranch, LiteralKind},
generated::{nodes::*, tokens::*},
node_ext::{
AttrKind, FieldKind, Macro, NameLike, NameOrNameRef, PathSegmentKind, SelfParamKind,
diff --git a/crates/syntax/src/ast/edit_in_place.rs b/crates/syntax/src/ast/edit_in_place.rs
index 9c5ae9a156..d6775c89ba 100644
--- a/crates/syntax/src/ast/edit_in_place.rs
+++ b/crates/syntax/src/ast/edit_in_place.rs
@@ -451,7 +451,7 @@ impl ast::RecordExprFieldList {
}
}
-impl ast::BlockExpr {
+impl ast::StmtList {
pub fn push_front(&self, statement: ast::Stmt) {
ted::insert(Position::after(self.l_curly_token().unwrap()), statement.syntax());
}
diff --git a/crates/syntax/src/ast/expr_ext.rs b/crates/syntax/src/ast/expr_ext.rs
index 9d78cb226f..4f92cc0671 100644
--- a/crates/syntax/src/ast/expr_ext.rs
+++ b/crates/syntax/src/ast/expr_ext.rs
@@ -25,7 +25,6 @@ impl ast::Expr {
| ast::Expr::WhileExpr(_)
| ast::Expr::BlockExpr(_)
| ast::Expr::MatchExpr(_)
- | ast::Expr::EffectExpr(_)
)
}
}
@@ -268,38 +267,23 @@ impl ast::Literal {
}
}
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub enum Effect {
+pub enum BlockModifier {
Async(SyntaxToken),
Unsafe(SyntaxToken),
Try(SyntaxToken),
Const(SyntaxToken),
- // Very much not an effect, but we stuff it into this node anyway
Label(ast::Label),
}
-impl ast::EffectExpr {
- pub fn effect(&self) -> Effect {
- if let Some(token) = self.async_token() {
- return Effect::Async(token);
- }
- if let Some(token) = self.unsafe_token() {
- return Effect::Unsafe(token);
- }
- if let Some(token) = self.try_token() {
- return Effect::Try(token);
- }
- if let Some(token) = self.const_token() {
- return Effect::Const(token);
- }
- if let Some(label) = self.label() {
- return Effect::Label(label);
- }
- unreachable!("ast::EffectExpr without Effect")
- }
-}
-
impl ast::BlockExpr {
+ pub fn modifier(&self) -> Option<BlockModifier> {
+ self.async_token()
+ .map(BlockModifier::Async)
+ .or_else(|| self.unsafe_token().map(BlockModifier::Unsafe))
+ .or_else(|| self.try_token().map(BlockModifier::Try))
+ .or_else(|| self.const_token().map(BlockModifier::Const))
+ .or_else(|| self.label().map(BlockModifier::Label))
+ }
/// false if the block is an intrinsic part of the syntax and can't be
/// replaced with arbitrary expression.
///
@@ -312,7 +296,7 @@ impl ast::BlockExpr {
Some(it) => it,
None => return true,
};
- !matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR)
+ !matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR)
}
}
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs
index 547e754636..066ad91d38 100644
--- a/crates/syntax/src/ast/generated/nodes.rs
+++ b/crates/syntax/src/ast/generated/nodes.rs
@@ -477,10 +477,12 @@ pub struct BlockExpr {
}
impl ast::AttrsOwner for BlockExpr {}
impl BlockExpr {
- pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
- pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
- pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
- pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
+ pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
+ pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
+ pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
+ pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
+ pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
+ pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SelfParam {
@@ -643,7 +645,6 @@ impl Meta {
pub struct ExprStmt {
pub(crate) syntax: SyntaxNode,
}
-impl ast::AttrsOwner for ExprStmt {}
impl ExprStmt {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
@@ -753,19 +754,6 @@ impl ContinueExpr {
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct EffectExpr {
- pub(crate) syntax: SyntaxNode,
-}
-impl ast::AttrsOwner for EffectExpr {}
-impl EffectExpr {
- pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
- pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
- pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
- pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
- pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
- pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldExpr {
pub(crate) syntax: SyntaxNode,
}
@@ -945,6 +933,17 @@ impl YieldExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct StmtList {
+ pub(crate) syntax: SyntaxNode,
+}
+impl ast::AttrsOwner for StmtList {}
+impl StmtList {
+ pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
+ pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
+ pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
+ pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Label {
pub(crate) syntax: SyntaxNode,
}
@@ -1339,7 +1338,6 @@ pub enum Expr {
CastExpr(CastExpr),
ClosureExpr(ClosureExpr),
ContinueExpr(ContinueExpr),
- EffectExpr(EffectExpr),
FieldExpr(FieldExpr),
ForExpr(ForExpr),
IfExpr(IfExpr),
@@ -2255,17 +2253,6 @@ impl AstNode for ContinueExpr {
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
-impl AstNode for EffectExpr {
- fn can_cast(kind: SyntaxKind) -> bool { kind == EFFECT_EXPR }
- fn cast(syntax: SyntaxNode) -> Option<Self> {
- if Self::can_cast(syntax.kind()) {
- Some(Self { syntax })
- } else {
- None
- }
- }
- fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
impl AstNode for FieldExpr {
fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2475,6 +2462,17 @@ impl AstNode for YieldExpr {
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
+impl AstNode for StmtList {
+ fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
+ fn cast(syntax: SyntaxNode) -> Option<Self> {
+ if Self::can_cast(syntax.kind()) {
+ Some(Self { syntax })
+ } else {
+ None
+ }
+ }
+ fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
impl AstNode for Label {
fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -3073,9 +3071,6 @@ impl From<ClosureExpr> for Expr {
impl From<ContinueExpr> for Expr {
fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
}
-impl From<EffectExpr> for Expr {
- fn from(node: EffectExpr) -> Expr { Expr::EffectExpr(node) }
-}
impl From<FieldExpr> for Expr {
fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
}
@@ -3143,9 +3138,9 @@ impl AstNode for Expr {
fn can_cast(kind: SyntaxKind) -> bool {
match kind {
ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
- | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR
- | IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MACRO_STMTS
- | MATCH_EXPR | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
+ | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | FIELD_EXPR | FOR_EXPR | IF_EXPR
+ | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MACRO_STMTS | MATCH_EXPR
+ | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
| RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR
| YIELD_EXPR => true,
_ => false,
@@ -3163,7 +3158,6 @@ impl AstNode for Expr {
CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
- EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
@@ -3201,7 +3195,6 @@ impl AstNode for Expr {
Expr::CastExpr(it) => &it.syntax,
Expr::ClosureExpr(it) => &it.syntax,
Expr::ContinueExpr(it) => &it.syntax,
- Expr::EffectExpr(it) => &it.syntax,
Expr::FieldExpr(it) => &it.syntax,
Expr::ForExpr(it) => &it.syntax,
Expr::IfExpr(it) => &it.syntax,
@@ -3660,7 +3653,6 @@ impl AstNode for DynAttrsOwner {
| CONST_PARAM
| LIFETIME_PARAM
| TYPE_PARAM
- | EXPR_STMT
| LET_STMT
| ARRAY_EXPR
| AWAIT_EXPR
@@ -3671,7 +3663,6 @@ impl AstNode for DynAttrsOwner {
| CAST_EXPR
| CLOSURE_EXPR
| CONTINUE_EXPR
- | EFFECT_EXPR
| FIELD_EXPR
| FOR_EXPR
| IF_EXPR
@@ -3690,6 +3681,7 @@ impl AstNode for DynAttrsOwner {
| TUPLE_EXPR
| WHILE_EXPR
| YIELD_EXPR
+ | STMT_LIST
| RECORD_EXPR_FIELD_LIST
| RECORD_EXPR_FIELD
| MATCH_ARM_LIST
@@ -4222,11 +4214,6 @@ impl std::fmt::Display for ContinueExpr {
std::fmt::Display::fmt(self.syntax(), f)
}
}
-impl std::fmt::Display for EffectExpr {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- std::fmt::Display::fmt(self.syntax(), f)
- }
-}
impl std::fmt::Display for FieldExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
@@ -4322,6 +4309,11 @@ impl std::fmt::Display for YieldExpr {
std::fmt::Display::fmt(self.syntax(), f)
}
}
+impl std::fmt::Display for StmtList {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ std::fmt::Display::fmt(self.syntax(), f)
+ }
+}
impl std::fmt::Display for Label {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index b01befebea..dc13e916c8 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -247,6 +247,7 @@ pub fn record_field(
ast_from_text(&format!("struct S {{ {}{}: {}, }}", visibility, name, ty))
}
+// TODO
pub fn block_expr(
stmts: impl IntoIterator<Item = ast::Stmt>,
tail_expr: Option<ast::Expr>,
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs
index ab47d4ece9..cb3bdaac1b 100644
--- a/crates/syntax/src/ast/node_ext.rs
+++ b/crates/syntax/src/ast/node_ext.rs
@@ -11,8 +11,8 @@ use rowan::{GreenNodeData, GreenTokenData};
use crate::{
ast::{
- self, support, AstChildren, AstNode, AstToken, AttrsOwner, GenericParamsOwner, NameOwner,
- SyntaxNode,
+ self, support, AstNode, AstToken, AttrsOwner, GenericParamsOwner, ModuleItemOwner,
+ NameOwner, SyntaxNode,
},
NodeOrToken, SmolStr, SyntaxElement, SyntaxToken, TokenText, T,
};
@@ -50,14 +50,23 @@ fn text_of_first_token(node: &SyntaxNode) -> TokenText<'_> {
}
}
+impl ast::ModuleItemOwner for ast::StmtList {}
+
impl ast::BlockExpr {
- pub fn items(&self) -> AstChildren<ast::Item> {
- support::children(self.syntax())
+ // FIXME: remove all these methods, they belong to ast::StmtList
+ pub fn items(&self) -> impl Iterator<Item = ast::Item> {
+ self.stmt_list().into_iter().flat_map(|it| it.items())
}
pub fn is_empty(&self) -> bool {
self.statements().next().is_none() && self.tail_expr().is_none()
}
+ pub fn statements(&self) -> impl Iterator<Item = ast::Stmt> {
+ self.stmt_list().into_iter().flat_map(|it| it.statements())
+ }
+ pub fn tail_expr(&self) -> Option<ast::Expr> {
+ self.stmt_list()?.tail_expr()
+ }
}
#[derive(Debug, PartialEq, Eq, Clone)]
diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs
index 40460e18c3..00749d742f 100644
--- a/crates/syntax/src/lib.rs
+++ b/crates/syntax/src/lib.rs
@@ -295,7 +295,8 @@ fn api_walkthrough() {
// Let's get the `1 + 1` expression!
let body: ast::BlockExpr = func.body().unwrap();
- let expr: ast::Expr = body.tail_expr().unwrap();
+ let stmt_list: ast::StmtList = body.stmt_list().unwrap();
+ let expr: ast::Expr = stmt_list.tail_expr().unwrap();
// Enums are used to group related ast nodes together, and can be used for
// matching. However, because there are no public fields, it's possible to
@@ -331,8 +332,8 @@ fn api_walkthrough() {
assert_eq!(text.to_string(), "1 + 1");
// There's a bunch of traversal methods on `SyntaxNode`:
- assert_eq!(expr_syntax.parent().as_ref(), Some(body.syntax()));
- assert_eq!(body.syntax().first_child_or_token().map(|it| it.kind()), Some(T!['{']));
+ assert_eq!(expr_syntax.parent().as_ref(), Some(stmt_list.syntax()));
+ assert_eq!(stmt_list.syntax().first_child_or_token().map(|it| it.kind()), Some(T!['{']));
assert_eq!(
expr_syntax.next_sibling_or_token().map(|it| it.kind()),
Some(SyntaxKind::WHITESPACE)
diff --git a/crates/syntax/src/ted.rs b/crates/syntax/src/ted.rs
index 2396408270..4b0d8bf391 100644
--- a/crates/syntax/src/ted.rs
+++ b/crates/syntax/src/ted.rs
@@ -162,8 +162,8 @@ fn ws_before(position: &Position, new: &SyntaxElement) -> Option<SyntaxToken> {
}
if prev.kind() == T!['{'] && ast::Stmt::can_cast(new.kind()) {
- if let Some(block_expr) = prev.parent().and_then(ast::BlockExpr::cast) {
- let mut indent = IndentLevel::from_element(&block_expr.syntax().clone().into());
+ if let Some(stmt_list) = prev.parent().and_then(ast::StmtList::cast) {
+ let mut indent = IndentLevel::from_element(&stmt_list.syntax().clone().into());
indent.0 += 1;
return Some(make::tokens::whitespace(&format!("\n{}", indent)));
}
diff --git a/crates/syntax/src/tests/ast_src.rs b/crates/syntax/src/tests/ast_src.rs
index fe37d02451..efbb7ca0cc 100644
--- a/crates/syntax/src/tests/ast_src.rs
+++ b/crates/syntax/src/tests/ast_src.rs
@@ -149,6 +149,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
"BREAK_EXPR",
"LABEL",
"BLOCK_EXPR",
+ "STMT_LIST",
"RETURN_EXPR",
"YIELD_EXPR",
"MATCH_EXPR",
@@ -158,7 +159,6 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
"RECORD_EXPR",
"RECORD_EXPR_FIELD_LIST",
"RECORD_EXPR_FIELD",
- "EFFECT_EXPR",
"BOX_EXPR",
// postfix
"CALL_EXPR",
diff --git a/crates/syntax/src/validation/block.rs b/crates/syntax/src/validation/block.rs
index 40170014f9..e03a77749d 100644
--- a/crates/syntax/src/validation/block.rs
+++ b/crates/syntax/src/validation/block.rs
@@ -9,14 +9,16 @@ use crate::{
pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) {
if let Some(parent) = block.syntax().parent() {
match parent.kind() {
- FN | EXPR_STMT | BLOCK_EXPR => return,
+ FN | EXPR_STMT | STMT_LIST => return,
_ => {}
}
}
- errors.extend(block.attrs().filter(|attr| attr.kind().is_inner()).map(|attr| {
- SyntaxError::new(
- "A block in this position cannot accept inner attributes",
- attr.syntax().text_range(),
- )
- }))
+ if let Some(stmt_list) = block.stmt_list() {
+ errors.extend(stmt_list.attrs().filter(|attr| attr.kind().is_inner()).map(|attr| {
+ SyntaxError::new(
+ "A block in this position cannot accept inner attributes",
+ attr.syntax().text_range(),
+ )
+ }))
+ }
}
diff --git a/crates/syntax/test_data/parser/err/0005_attribute_recover.rast b/crates/syntax/test_data/parser/err/0005_attribute_recover.rast
index 6202c8bfe7..44dcc58a92 100644
--- a/crates/syntax/test_data/parser/err/0005_attribute_recover.rast
+++ b/crates/syntax/test_data/parser/err/0005_attribute_recover.rast
@@ -29,9 +29,10 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast
index 560bfd7518..c57ea77364 100644
--- a/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast
+++ b/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast
@@ -21,8 +21,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/err/0008_item_block_recovery.rast b/crates/syntax/test_data/parser/err/0008_item_block_recovery.rast
index 1e9637c26d..99ec2faed0 100644
--- a/crates/syntax/test_data/parser/err/0008_item_block_recovery.rast
+++ b/crates/syntax/test_data/parser/err/0008_item_block_recovery.rast
@@ -9,9 +9,10 @@ [email protected]
@@ -33,28 +34,30 @@ [email protected]
@@ -68,9 +71,10 @@ [email protected]
error 17..17: expected BANG
error 19..19: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast b/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
index e0f1d0c274..586acc7329 100644
--- a/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
+++ b/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast
@@ -9,36 +9,37 @@ [email protected]
error 24..24: expected a block
error 24..24: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0014_where_no_bounds.rast b/crates/syntax/test_data/parser/err/0014_where_no_bounds.rast
index a1f39b22a5..9178cf3b7f 100644
--- a/crates/syntax/test_data/parser/err/0014_where_no_bounds.rast
+++ b/crates/syntax/test_data/parser/err/0014_where_no_bounds.rast
@@ -25,7 +25,8 @@ [email protected]
error 19..19: expected colon
diff --git a/crates/syntax/test_data/parser/err/0016_missing_semi.rast b/crates/syntax/test_data/parser/err/0016_missing_semi.rast
index 66157c3dce..30e76de834 100644
--- a/crates/syntax/test_data/parser/err/0016_missing_semi.rast
+++ b/crates/syntax/test_data/parser/err/0016_missing_semi.rast
@@ -9,35 +9,36 @@ [email protected]
error 38..38: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast b/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast
index fe094f61c1..9d2c7c6948 100644
--- a/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast
+++ b/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast
@@ -20,27 +20,28 @@ [email protected]
error 44..44: expected expression
diff --git a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast
index 5b180ce337..55ac5bc62a 100644
--- a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast
+++ b/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast
@@ -33,90 +33,91 @@ [email protected]
- [email protected] "ScopeData"
- [email protected] "entries"
+ [email protected] "ScopeData"
+ [email protected] "entries"
diff --git a/crates/syntax/test_data/parser/err/0019_let_recover.rast b/crates/syntax/test_data/parser/err/0019_let_recover.rast
index 72c05bd964..919ce545b7 100644
--- a/crates/syntax/test_data/parser/err/0019_let_recover.rast
+++ b/crates/syntax/test_data/parser/err/0019_let_recover.rast
@@ -9,87 +9,91 @@ [email protected]
error 24..24: expected expression
error 24..24: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0020_fn_recover.rast b/crates/syntax/test_data/parser/err/0020_fn_recover.rast
index 6f6feba5a8..9ed2b14745 100644
--- a/crates/syntax/test_data/parser/err/0020_fn_recover.rast
+++ b/crates/syntax/test_data/parser/err/0020_fn_recover.rast
@@ -12,8 +12,9 @@ [email protected]
error 2..2: expected a name
error 2..2: expected function arguments
diff --git a/crates/syntax/test_data/parser/err/0021_incomplete_param.rast b/crates/syntax/test_data/parser/err/0021_incomplete_param.rast
index 901490fa2f..e2b6a3fd7e 100644
--- a/crates/syntax/test_data/parser/err/0021_incomplete_param.rast
+++ b/crates/syntax/test_data/parser/err/0021_incomplete_param.rast
@@ -26,8 +26,9 @@ [email protected]
error 16..16: missing type for function parameter
diff --git a/crates/syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/syntax/test_data/parser/err/0022_bad_exprs.rast
index 7e6d82bfb4..d4341371a7 100644
--- a/crates/syntax/test_data/parser/err/0022_bad_exprs.rast
+++ b/crates/syntax/test_data/parser/err/0022_bad_exprs.rast
@@ -9,35 +9,36 @@ [email protected]
@@ -49,41 +50,42 @@ [email protected]
@@ -95,49 +97,50 @@ [email protected]
error 16..16: expected expression
error 17..17: expected R_BRACK
diff --git a/crates/syntax/test_data/parser/err/0023_mismatched_paren.rast b/crates/syntax/test_data/parser/err/0023_mismatched_paren.rast
index 5ffefd7429..671566e383 100644
--- a/crates/syntax/test_data/parser/err/0023_mismatched_paren.rast
+++ b/crates/syntax/test_data/parser/err/0023_mismatched_paren.rast
@@ -9,30 +9,31 @@ [email protected]
- [email protected] "\"baz\""
+ [email protected] "\"baz\""
[email protected] "//~ ERROR incorrect c ..."
diff --git a/crates/syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/syntax/test_data/parser/err/0024_many_type_parens.rast
index d29f12c1e5..39a317137f 100644
--- a/crates/syntax/test_data/parser/err/0024_many_type_parens.rast
+++ b/crates/syntax/test_data/parser/err/0024_many_type_parens.rast
@@ -64,8 +64,9 @@ [email protected]
@@ -77,219 +78,220 @@ [email protected]
error 88..88: expected COMMA
error 88..88: expected R_ANGLE
diff --git a/crates/syntax/test_data/parser/err/0025_nope.rast b/crates/syntax/test_data/parser/err/0025_nope.rast
index 83fc9fe776..b48b4aed8d 100644
--- a/crates/syntax/test_data/parser/err/0025_nope.rast
+++ b/crates/syntax/test_data/parser/err/0025_nope.rast
@@ -9,185 +9,187 @@ [email protected]
- [email protected] "//~ ERROR: expected t ..."
- [email protected] "// recover..."
- [email protected] "StillFine"
- [email protected] "// fail again"
- [email protected] "//~ ERROR: found `{`"
- [email protected] "//~^ ERROR: found `{`"
- [email protected] "// still recover later"
- [email protected] "bad_syntax"
- [email protected] "//~ ERROR: expected e ..."
+ [email protected] "//~ ERROR: expected t ..."
+ [email protected] "// recover..."
+ [email protected] "StillFine"
+ [email protected] "// fail again"
+ [email protected] "//~ ERROR: found `{`"
+ [email protected] "//~^ ERROR: found `{`"
+ [email protected] "// still recover later"
+ [email protected] "bad_syntax"
+ [email protected] "//~ ERROR: expected e ..."
error 95..95: expected type
error 95..95: expected COMMA
diff --git a/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast
index b021783fc7..ec585a4235 100644
--- a/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast
+++ b/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast
@@ -21,8 +21,9 @@ [email protected]
error 26..26: expected type
error 26..26: expected colon
diff --git a/crates/syntax/test_data/parser/err/0029_field_completion.rast b/crates/syntax/test_data/parser/err/0029_field_completion.rast
index c6402cdd84..183cf32030 100644
--- a/crates/syntax/test_data/parser/err/0029_field_completion.rast
+++ b/crates/syntax/test_data/parser/err/0029_field_completion.rast
@@ -20,16 +20,17 @@ [email protected]
error 21..21: expected field name or number
diff --git a/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast b/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast
index 8462797486..d4963979c8 100644
--- a/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast
+++ b/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast
@@ -9,115 +9,119 @@ [email protected]
- [email protected] "\"Inner attributes not ..."
- [email protected] "//! Nor are ModuleDoc ..."
- [email protected] "\"Nor here\""
- [email protected] "\"We error on each attr\""
- [email protected] "//! Nor are ModuleDoc ..."
- [email protected] "\"Nor here\""
- [email protected] "//! Nor are ModuleDoc ..."
+ [email protected] "\"Inner attributes not ..."
+ [email protected] "//! Nor are ModuleDoc ..."
+ [email protected] "\"Nor here\""
+ [email protected] "\"We error on each attr\""
+ [email protected] "//! Nor are ModuleDoc ..."
+ [email protected] "\"Nor here\""
+ [email protected] "//! Nor are ModuleDoc ..."
error 39..83: A block in this position cannot accept inner attributes
error 152..171: A block in this position cannot accept inner attributes
diff --git a/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
index 9524f5ccc7..2438b104bf 100644
--- a/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
+++ b/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast
@@ -9,187 +9,188 @@ [email protected]
- [email protected] "\"Not allowed here\""
- [email protected] "\"Nor here\""
- [email protected] "\"Nor here\""
+ [email protected] "\"Not allowed here\""
+ [email protected] "\"Nor here\""
+ [email protected] "\"Nor here\""
error 52..52: expected `[`
error 52..52: expected pattern
diff --git a/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
index b6095d5030..66fc2ccbd2 100644
--- a/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
+++ b/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast
@@ -9,58 +9,59 @@ [email protected]
error 80..80: expected pattern
error 80..80: expected FAT_ARROW
diff --git a/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast b/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast
index d9d49bfb5f..583e62c77a 100644
--- a/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast
+++ b/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast
@@ -9,83 +9,84 @@ [email protected]
error 24..24: expected a name
error 27..27: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0035_use_recover.rast b/crates/syntax/test_data/parser/err/0035_use_recover.rast
index a95151bc5b..14eaf9e9b0 100644
--- a/crates/syntax/test_data/parser/err/0035_use_recover.rast
+++ b/crates/syntax/test_data/parser/err/0035_use_recover.rast
@@ -45,8 +45,9 @@ [email protected]
error 17..17: expected one of `*`, `::`, `{`, `self`, `super` or an identifier
error 17..17: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast
index ae4dd2f3b2..90c258cd1a 100644
--- a/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast
+++ b/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast
@@ -27,8 +27,9 @@ [email protected]
@@ -43,8 +44,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast b/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast
index bed7ad6c33..fd302fb4d5 100644
--- a/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast
+++ b/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast
@@ -9,21 +9,22 @@ [email protected]
error 16..20: An inclusive range must have an end expression
error 26..29: An inclusive range must have an end expression
diff --git a/crates/syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/syntax/test_data/parser/err/0039_lambda_recovery.rast
index a9c5b70fd3..b9b9f2e4b1 100644
--- a/crates/syntax/test_data/parser/err/0039_lambda_recovery.rast
+++ b/crates/syntax/test_data/parser/err/0039_lambda_recovery.rast
@@ -18,65 +18,66 @@ [email protected]
error 56..56: expected expression
diff --git a/crates/syntax/test_data/parser/err/0043_weird_blocks.rast b/crates/syntax/test_data/parser/err/0043_weird_blocks.rast
index 797a089648..25910cb405 100644
--- a/crates/syntax/test_data/parser/err/0043_weird_blocks.rast
+++ b/crates/syntax/test_data/parser/err/0043_weird_blocks.rast
@@ -9,60 +9,65 @@ [email protected]
error 24..24: expected existential, fn, trait or impl
error 41..41: expected existential, fn, trait or impl
diff --git a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast
index a2460a7eca..d4e4bf102e 100644
--- a/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast
+++ b/crates/syntax/test_data/parser/err/0044_unexpected_for_type.rast
@@ -244,9 +244,10 @@ [email protected]
error 21..21: expected a function pointer or path
error 52..52: expected a function pointer or path
diff --git a/crates/syntax/test_data/parser/err/0045_item_modifiers.rast b/crates/syntax/test_data/parser/err/0045_item_modifiers.rast
index e9dad0b7a0..b4ff1a14a7 100644
--- a/crates/syntax/test_data/parser/err/0045_item_modifiers.rast
+++ b/crates/syntax/test_data/parser/err/0045_item_modifiers.rast
@@ -14,8 +14,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast b/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast
index 6eaa32b969..d94daacdc1 100644
--- a/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast
+++ b/crates/syntax/test_data/parser/err/0046_ambiguous_trait_object.rast
@@ -117,77 +117,78 @@ [email protected]
- [email protected] "Addable"
+ [email protected] "Addable"
error 19..34: ambiguous `+` in a type
error 54..69: ambiguous `+` in a type
diff --git a/crates/syntax/test_data/parser/err/0049_double_fish.rast b/crates/syntax/test_data/parser/err/0049_double_fish.rast
index 51e36543ac..ca52166fbc 100644
--- a/crates/syntax/test_data/parser/err/0049_double_fish.rast
+++ b/crates/syntax/test_data/parser/err/0049_double_fish.rast
@@ -9,48 +9,49 @@ [email protected]
@@ -62,53 +63,54 @@ [email protected]
error 30..30: expected identifier
error 31..31: expected COMMA
diff --git a/crates/syntax/test_data/parser/fragments/item/ok/0000_fn.rast b/crates/syntax/test_data/parser/fragments/item/ok/0000_fn.rast
index 93c429e128..4ff9967bea 100644
--- a/crates/syntax/test_data/parser/fragments/item/ok/0000_fn.rast
+++ b/crates/syntax/test_data/parser/fragments/item/ok/0000_fn.rast
@@ -8,5 +8,6 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/fragments/stmt/ok/0000_expr_block.rast b/crates/syntax/test_data/parser/fragments/stmt/ok/0000_expr_block.rast
index 6c946091f3..a2d4f18988 100644
--- a/crates/syntax/test_data/parser/fragments/stmt/ok/0000_expr_block.rast
+++ b/crates/syntax/test_data/parser/fragments/stmt/ok/0000_expr_block.rast
@@ -1,69 +1,70 @@
diff --git a/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
index 3774dd0733..06abd807f1 100644
--- a/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
+++ b/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast
@@ -9,18 +9,19 @@ [email protected]
error 22..22: expected a loop
error 27..27: expected type
diff --git a/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast b/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
index cc0f8bcaf9..04bac98211 100644
--- a/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
+++ b/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast
@@ -8,8 +8,9 @@ [email protected]
@@ -28,8 +29,9 @@ [email protected]
error 11..11: expected an item
error 18..18: expected an item
diff --git a/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
index 2c9570678e..c9a84a0ce4 100644
--- a/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
+++ b/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast
@@ -9,23 +9,24 @@ [email protected]
error 27..27: expected SEMICOLON
diff --git a/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast
index 63a10127dd..57c1d2051b 100644
--- a/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast
+++ b/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast
@@ -9,17 +9,18 @@ [email protected]
error 14..14: expected an item
diff --git a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
index fa14e1e6de..005f6db3c5 100644
--- a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
+++ b/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast
@@ -9,44 +9,45 @@ [email protected]
error 27..31: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix
error 39..43: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix
diff --git a/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
index a81c442c0d..f8cdddb6e8 100644
--- a/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
+++ b/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast
@@ -9,40 +9,41 @@ [email protected]
- [email protected] "default"
+ [email protected] "default"
error 25..25: expected COLON
diff --git a/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast b/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast
index 99391c266a..6c634b4f74 100644
--- a/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast
+++ b/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast
@@ -44,8 +44,9 @@ [email protected]
error 6..6: missing type for function parameter
error 6..6: expected COMMA
diff --git a/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast b/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
index 12f5040f90..174733a867 100644
--- a/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast
@@ -56,7 +56,8 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast b/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast
index 8e0252ce74..5308dce6a2 100644
--- a/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast
@@ -32,6 +32,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast
index d4c8b9d67a..90667cb7c2 100644
--- a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast
@@ -24,8 +24,9 @@ [email protected]
@@ -42,8 +43,9 @@ [email protected]
@@ -63,8 +65,9 @@ [email protected]
@@ -98,8 +101,9 @@ [email protected]
@@ -116,8 +120,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0008_path_part.rast b/crates/syntax/test_data/parser/inline/ok/0008_path_part.rast
index 7d2f7eab05..ff81307128 100644
--- a/crates/syntax/test_data/parser/inline/ok/0008_path_part.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0008_path_part.rast
@@ -9,88 +9,89 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast b/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast
index f62826fd55..0e2ddb9f2f 100644
--- a/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast
@@ -9,16 +9,18 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast b/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast
index 66a609346a..9475e3e217 100644
--- a/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast
@@ -9,51 +9,52 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast b/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast
index b67ea2682c..81c916fe1e 100644
--- a/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast
@@ -9,28 +9,30 @@ [email protected]
- [email protected] "continue"
- [email protected] "continue"
+ [email protected] "continue"
+ [email protected] "continue"
diff --git a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
index df59f37a25..48b11844cd 100644
--- a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
@@ -33,8 +33,9 @@ [email protected]
@@ -67,8 +68,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast b/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast
index 7db38ea4da..8a67c60e79 100644
--- a/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast
@@ -9,36 +9,37 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast b/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast
index dc7f6295b2..d57e315a34 100644
--- a/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast
@@ -55,8 +55,9 @@ [email protected]
@@ -72,8 +73,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast b/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast
index 2dbce34b61..970260df81 100644
--- a/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast
@@ -9,33 +9,34 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast b/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast
index 467a301346..d1be7e6e0a 100644
--- a/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast
@@ -9,96 +9,97 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast b/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast
index 348b54dc9d..ed47dc21dd 100644
--- a/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast
@@ -9,41 +9,42 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast b/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast
index e096b3a1f6..5afd7bd8fe 100644
--- a/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast
@@ -9,81 +9,82 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0030_cond.rast b/crates/syntax/test_data/parser/inline/ok/0030_cond.rast
index 58a97d3ad8..3aa330f55d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0030_cond.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0030_cond.rast
@@ -9,37 +9,39 @@ [email protected]
@@ -51,152 +53,157 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast b/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast
index 173cecf6d9..d2d22e58ea 100644
--- a/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast
@@ -9,76 +9,81 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast b/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast
index 783b25338f..a52c1c3893 100644
--- a/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast
@@ -9,47 +9,49 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast b/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast
index b6379e62f8..ab22f3189d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast
@@ -42,37 +42,38 @@ [email protected]
- [email protected] "Default"
- [email protected] "default"
+ [email protected] "Default"
+ [email protected] "default"
diff --git a/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast b/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast
index 64e705fb3d..9bb358f8a0 100644
--- a/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast
@@ -9,20 +9,21 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast b/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast
index db5bd28496..3122528286 100644
--- a/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast
@@ -12,9 +12,10 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast b/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast
index fa38e94667..55619dd016 100644
--- a/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast
@@ -9,139 +9,140 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0044_block_items.rast b/crates/syntax/test_data/parser/inline/ok/0044_block_items.rast
index 1fd3cd0e78..d5c755d343 100644
--- a/crates/syntax/test_data/parser/inline/ok/0044_block_items.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0044_block_items.rast
@@ -9,20 +9,22 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast b/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
index abc258b336..8f187f2ae6 100644
--- a/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
@@ -42,6 +42,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast b/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
index e1b88c5db5..c65ad4231e 100644
--- a/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
@@ -36,8 +36,9 @@ [email protected]
@@ -78,6 +79,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast
index c34cfeb315..7894f66d4c 100644
--- a/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast
@@ -9,87 +9,88 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast b/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast
index 32187facfd..97e2d31d1c 100644
--- a/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast
@@ -9,68 +9,69 @@ [email protected]
- [email protected] "\"hello\""
+ [email protected] "\"hello\""
diff --git a/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast b/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast
index d42a7e2957..20fd2c3f43 100644
--- a/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast
@@ -111,6 +111,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast b/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast
index 75982c3dee..1a8979db89 100644
--- a/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast
@@ -9,90 +9,91 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast b/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast
index 6155726e91..075d49bcc8 100644
--- a/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast
@@ -9,50 +9,52 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast b/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast
index a9ae1aa595..baa12c92d5 100644
--- a/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast
@@ -9,116 +9,117 @@ [email protected]
- [email protected] "Default"
- [email protected] "default"
- [email protected] "TupleStruct"
+ [email protected] "Default"
+ [email protected] "default"
+ [email protected] "TupleStruct"
diff --git a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast
index 583dcac7ed..2deaf07030 100644
--- a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast
@@ -9,8 +9,9 @@ [email protected]
[email protected] "macro_rules"
diff --git a/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast b/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast
index 5871600034..5d8a8620cf 100644
--- a/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast
@@ -9,113 +9,124 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast b/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast
index 566b478ea8..7d8ce82d97 100644
--- a/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast
@@ -9,143 +9,144 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast b/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast
index 509c54c2ac..1a7dcd1bc2 100644
--- a/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast
@@ -9,42 +9,45 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast b/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast
index d34d98ced0..2897bedfb7 100644
--- a/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast
@@ -9,85 +9,88 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast b/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast
index 437d7ac042..be96f8f43f 100644
--- a/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast
@@ -9,20 +9,21 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast b/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast
index 3a789b9f51..43e85c53a9 100644
--- a/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast
@@ -9,51 +9,55 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0075_block.rast b/crates/syntax/test_data/parser/inline/ok/0075_block.rast
index e847ce9b26..7a05874313 100644
--- a/crates/syntax/test_data/parser/inline/ok/0075_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0075_block.rast
@@ -9,8 +9,9 @@ [email protected]
@@ -22,21 +23,22 @@ [email protected]
@@ -48,19 +50,20 @@ [email protected]
@@ -72,15 +75,16 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast b/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast
index 96217a7fdb..24e41f7928 100644
--- a/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast
@@ -34,6 +34,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast b/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast
index 33e6fb93f7..89fcbadbe5 100644
--- a/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast
@@ -9,17 +9,18 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast b/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast
index b3003577cc..b431028a45 100644
--- a/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast
@@ -9,87 +9,88 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast
index 70b975c0b1..9fda28a271 100644
--- a/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast
@@ -9,130 +9,131 @@ [email protected]
- [email protected] "// reference operator"
- [email protected] "// raw reference oper ..."
+ [email protected] "// reference operator"
+ [email protected] "// raw reference oper ..."
diff --git a/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast b/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast
index f784e96e00..ca68b4b109 100644
--- a/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast
@@ -9,127 +9,128 @@ [email protected]
- [email protected] "br\"f\""
+ [email protected] "br\"f\""
diff --git a/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast b/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast
index 70e05a859b..71d5d127ca 100644
--- a/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast
@@ -9,8 +9,9 @@ [email protected]
@@ -29,6 +30,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast b/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast
index f7b839303c..698b4c40ff 100644
--- a/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast
@@ -8,58 +8,62 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast b/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast
index 82f03f9c18..ef3ef692a0 100644
--- a/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast
@@ -9,25 +9,26 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast b/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast
index c1fdc6e259..2450b66d79 100644
--- a/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast
@@ -9,20 +9,21 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast b/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast
index e84b9164ff..0a6ea549c4 100644
--- a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast
@@ -9,111 +9,118 @@ [email protected]
- [email protected] "macro_rules"
+ [email protected] "macro_rules"
diff --git a/crates/syntax/test_data/parser/inline/ok/0099_param_list.rast b/crates/syntax/test_data/parser/inline/ok/0099_param_list.rast
index f19e9fd522..2f2f2b6889 100644
--- a/crates/syntax/test_data/parser/inline/ok/0099_param_list.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0099_param_list.rast
@@ -9,8 +9,9 @@ [email protected]
@@ -33,8 +34,9 @@ [email protected]
@@ -59,8 +61,9 @@ [email protected]
@@ -94,6 +97,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast b/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast
index 5c4055e44b..f195f2369c 100644
--- a/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast
@@ -9,26 +9,28 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast b/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast
index 866e60ed8a..4c44da9d55 100644
--- a/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast
@@ -9,124 +9,125 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast b/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast
index c4c0a0568a..1e0d2fa07a 100644
--- a/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast
@@ -9,46 +9,47 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast b/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast
index 9b8381619a..3497de01c5 100644
--- a/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast
@@ -9,127 +9,132 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast b/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
index be8365e057..9cddb373ff 100644
--- a/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
@@ -9,54 +9,55 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast b/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast
index ca7e4a5c36..a6b247c0ac 100644
--- a/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast
@@ -9,30 +9,31 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0109_label.rast b/crates/syntax/test_data/parser/inline/ok/0109_label.rast
index 8540b85200..688e9dca4f 100644
--- a/crates/syntax/test_data/parser/inline/ok/0109_label.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0109_label.rast
@@ -9,59 +9,63 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast b/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast
index b82ed0230b..994c345c9d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast
@@ -9,81 +9,82 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast b/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast
index 7b9a498c8e..70f764944e 100644
--- a/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast
@@ -9,119 +9,120 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast b/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast
index d761c1c68e..538b3577ac 100644
--- a/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast
@@ -8,48 +8,50 @@ [email protected]
- [email protected] "some_expr"
+ [email protected] "some_expr"
diff --git a/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast b/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast
index 646e2d1fd9..8d5fe502fe 100644
--- a/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast
@@ -9,67 +9,68 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast b/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast
index 443f368532..517b221d4e 100644
--- a/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast
@@ -9,75 +9,76 @@ [email protected]
- [email protected] "\"Inner attribute\""
- [email protected] "\"Can be\""
- [email protected] "\"Stacked\""
+ [email protected] "\"Inner attribute\""
+ [email protected] "\"Can be\""
+ [email protected] "\"Stacked\""
diff --git a/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast b/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast
index 1b2db27e4f..54cf1d0892 100644
--- a/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast
@@ -9,142 +9,143 @@ [email protected]
- [email protected] "feature"
- [email protected] "\"some\""
- [email protected] "feature"
- [email protected] "\"other\""
- [email protected] "feature"
- [email protected] "\"many\""
- [email protected] "feature"
- [email protected] "\"attributes\""
- [email protected] "feature"
- [email protected] "\"before\""
+ [email protected] "feature"
+ [email protected] "\"some\""
+ [email protected] "feature"
+ [email protected] "\"other\""
+ [email protected] "feature"
+ [email protected] "\"many\""
+ [email protected] "feature"
+ [email protected] "\"attributes\""
+ [email protected] "feature"
+ [email protected] "\"before\""
diff --git a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast b/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast
index 0fed2d3111..69633b8e50 100644
--- a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast
@@ -9,24 +9,25 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast b/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast
index 5e82214c0e..1755a53b51 100644
--- a/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast
@@ -9,40 +9,41 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast b/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast
index 2a4a52eeb5..b69276ceeb 100644
--- a/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast
@@ -9,94 +9,96 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast b/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast
index e283966ca2..0e26273564 100644
--- a/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast
@@ -9,28 +9,29 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast b/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast
index af3b11376b..c3141e1545 100644
--- a/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast
@@ -9,27 +9,28 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast b/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast
index ffdffe2f80..bd3652280b 100644
--- a/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast
@@ -9,23 +9,24 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast b/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast
index c550382472..29f97a3a77 100644
--- a/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast
@@ -9,81 +9,82 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
index 429a0506e1..f0b45b4a16 100644
--- a/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
@@ -9,54 +9,56 @@ [email protected]
- [email protected] "LocalEnum"
+ [email protected] "LocalEnum"
diff --git a/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast b/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast
index 923effe383..cacd3fa816 100644
--- a/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast
@@ -9,61 +9,62 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast b/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
index a34aff3cbe..c3f03c49b7 100644
--- a/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
@@ -105,6 +105,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast b/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast
index f7c0e0ab0b..134438715a 100644
--- a/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast
@@ -9,56 +9,58 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast
index 891eace599..6a80b72e45 100644
--- a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast
@@ -22,6 +22,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast b/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast
index a363e592b7..7cdd38917d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast
@@ -30,6 +30,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast b/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast
index 36e448c94e..4f859c30e5 100644
--- a/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast
@@ -9,32 +9,34 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast b/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast
index 65887b9621..a5f990cff9 100644
--- a/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast
@@ -9,102 +9,103 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast b/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast
index 8a5bde0b6a..6a423ff14c 100644
--- a/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast
@@ -9,447 +9,448 @@ [email protected]
- [email protected] "// Tuples"
- [email protected] "// Slices"
+ [email protected] "// Tuples"
+ [email protected] "// Slices"
diff --git a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast
index c606a7c9b0..b79690b9ed 100644
--- a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast
@@ -9,114 +9,115 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast b/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast
index c9cfb97ef3..5a51b3bbea 100644
--- a/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast
@@ -9,34 +9,35 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0151_fn.rast b/crates/syntax/test_data/parser/inline/ok/0151_fn.rast
index 23c4269b30..ec93d4a1c7 100644
--- a/crates/syntax/test_data/parser/inline/ok/0151_fn.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0151_fn.rast
@@ -9,6 +9,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast b/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast
index 1d20765b03..7a6d2daa38 100644
--- a/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast
@@ -9,29 +9,30 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast b/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast
index 31671b4201..ca5fb62a85 100644
--- a/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast
@@ -9,61 +9,62 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast b/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast
index 8ff4822c4e..1144d5684d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast
@@ -9,68 +9,71 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast b/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast
index 508b4aca7d..241ae090a7 100644
--- a/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast
@@ -38,6 +38,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast b/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast
index 41119dbc16..e41bf54110 100644
--- a/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast
@@ -9,103 +9,104 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0157_const_block.rast b/crates/syntax/test_data/parser/inline/ok/0157_const_block.rast
index d5d2c8fe30..82e06d3b30 100644
--- a/crates/syntax/test_data/parser/inline/ok/0157_const_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0157_const_block.rast
@@ -9,15 +9,16 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast b/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast
index 7473f4836e..da705ad9c1 100644
--- a/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast
@@ -9,28 +9,30 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast b/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast
index aa4099a929..3272b0b9da 100644
--- a/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast
@@ -9,35 +9,37 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast b/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast
index fb46d4ce40..25665dfd8d 100644
--- a/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast
@@ -9,26 +9,27 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast b/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast
index 05fc90743e..bdc880972b 100644
--- a/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast
@@ -9,20 +9,21 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast b/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast
index 47e8859ed0..b5f9d22951 100644
--- a/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast
@@ -9,19 +9,20 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast
index 61c17333a4..e3f655b9b0 100644
--- a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast
@@ -35,8 +35,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast b/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast
index ca9a1183d6..6274f78fe8 100644
--- a/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast
@@ -9,15 +9,16 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast
index 9c43ccea52..9af407cdd6 100644
--- a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast
@@ -33,8 +33,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast b/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast
index f2e2014605..ee05ab0fe9 100644
--- a/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast
@@ -37,8 +37,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast b/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
index f8910677b4..8eb64ccb17 100644
--- a/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
@@ -9,30 +9,31 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast b/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast
index 67ac6a4633..f0cc6b3441 100644
--- a/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast
@@ -9,23 +9,24 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast b/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast
index 475c236766..4564f43e0f 100644
--- a/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast
@@ -40,6 +40,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast b/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast
index 0eb7361ce4..704c991fe1 100644
--- a/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast
@@ -19,6 +19,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast b/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast
index 9020d1b861..6bbb6c40dd 100644
--- a/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast
@@ -16,16 +16,17 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0183_type_param.rast b/crates/syntax/test_data/parser/inline/ok/0183_type_param.rast
index 9d8ab493e0..450bccff33 100644
--- a/crates/syntax/test_data/parser/inline/ok/0183_type_param.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0183_type_param.rast
@@ -24,6 +24,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast b/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast
index 9d8ab493e0..450bccff33 100644
--- a/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast
@@ -24,6 +24,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast b/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast
index cc5d72ff74..dcb7b1c459 100644
--- a/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast
@@ -9,20 +9,21 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast b/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast
index 41acb0dd98..679b0c4ce9 100644
--- a/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast
+++ b/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast
@@ -9,22 +9,23 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0005_fn_item.rast b/crates/syntax/test_data/parser/ok/0005_fn_item.rast
index a7a2b11a72..845f9a6f35 100644
--- a/crates/syntax/test_data/parser/ok/0005_fn_item.rast
+++ b/crates/syntax/test_data/parser/ok/0005_fn_item.rast
@@ -9,7 +9,8 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0008_mod_item.rast b/crates/syntax/test_data/parser/ok/0008_mod_item.rast
index 712e153462..e864641834 100644
--- a/crates/syntax/test_data/parser/ok/0008_mod_item.rast
+++ b/crates/syntax/test_data/parser/ok/0008_mod_item.rast
@@ -18,9 +18,10 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0011_outer_attribute.rast b/crates/syntax/test_data/parser/ok/0011_outer_attribute.rast
index 31f76589de..bb35b40f4e 100644
--- a/crates/syntax/test_data/parser/ok/0011_outer_attribute.rast
+++ b/crates/syntax/test_data/parser/ok/0011_outer_attribute.rast
@@ -33,8 +33,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0012_visibility.rast b/crates/syntax/test_data/parser/ok/0012_visibility.rast
index 79dc9001a2..e046b0bb1c 100644
--- a/crates/syntax/test_data/parser/ok/0012_visibility.rast
+++ b/crates/syntax/test_data/parser/ok/0012_visibility.rast
@@ -9,8 +9,9 @@ [email protected]
@@ -25,8 +26,9 @@ [email protected]
@@ -67,8 +69,9 @@ [email protected]
@@ -89,8 +92,9 @@ [email protected]
@@ -123,6 +127,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast b/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast
index 94791f771c..938a3f17b6 100644
--- a/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast
+++ b/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast
@@ -24,6 +24,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast b/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast
index bb6527b484..21ed8ebfa4 100644
--- a/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast
+++ b/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast
@@ -9,23 +9,25 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast b/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast
index 5bcf54deb6..ad4cd31cb6 100644
--- a/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast
+++ b/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast
@@ -9,22 +9,24 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast b/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast
index a7cc122951..eb1fa2819c 100644
--- a/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast
+++ b/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast
@@ -9,33 +9,35 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast b/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast
index 3271a4695d..96c75052fa 100644
--- a/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast
+++ b/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast
@@ -9,177 +9,178 @@ [email protected]
- [email protected] "//1 || 2 && 2;"
- [email protected] "//1 .. 2 || 3;"
- [email protected] "//1 = 2 .. 3;"
- [email protected] "//---&*1 - --2 * 9;"
+ [email protected] "//1 || 2 && 2;"
+ [email protected] "//1 .. 2 || 3;"
+ [email protected] "//1 = 2 .. 3;"
+ [email protected] "//---&*1 - --2 * 9;"
diff --git a/crates/syntax/test_data/parser/ok/0029_range_forms.rast b/crates/syntax/test_data/parser/ok/0029_range_forms.rast
index a732f11c43..486bab8df1 100644
--- a/crates/syntax/test_data/parser/ok/0029_range_forms.rast
+++ b/crates/syntax/test_data/parser/ok/0029_range_forms.rast
@@ -9,143 +9,144 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0030_string_suffixes.rast b/crates/syntax/test_data/parser/ok/0030_string_suffixes.rast
index 115861585f..9f59c0ecb6 100644
--- a/crates/syntax/test_data/parser/ok/0030_string_suffixes.rast
+++ b/crates/syntax/test_data/parser/ok/0030_string_suffixes.rast
@@ -9,55 +9,56 @@ [email protected]
- [email protected] "\"string\"invalid"
- [email protected] "b'b'_suff"
- [email protected] "b\"bs\"invalid"
+ [email protected] "\"string\"invalid"
+ [email protected] "b'b'_suff"
+ [email protected] "b\"bs\"invalid"
diff --git a/crates/syntax/test_data/parser/ok/0032_where_for.rast b/crates/syntax/test_data/parser/ok/0032_where_for.rast
index b527cc3acf..ee66eab530 100644
--- a/crates/syntax/test_data/parser/ok/0032_where_for.rast
+++ b/crates/syntax/test_data/parser/ok/0032_where_for.rast
@@ -87,6 +87,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0033_label_break.rast b/crates/syntax/test_data/parser/ok/0033_label_break.rast
index 4b0f0997eb..fbda85797e 100644
--- a/crates/syntax/test_data/parser/ok/0033_label_break.rast
+++ b/crates/syntax/test_data/parser/ok/0033_label_break.rast
@@ -11,212 +11,217 @@ [email protected]
- [email protected] "'empty_block"
- [email protected] "do_thing"
- [email protected] "condition_not_met"
- [email protected] "do_next_thing"
- [email protected] "condition_not_met"
- [email protected] "do_last_thing"
- [email protected] "// comment"
- [email protected] "/* comment */"
+ [email protected] "'empty_block"
+ [email protected] "do_thing"
+ [email protected] "condition_not_met"
+ [email protected] "do_next_thing"
+ [email protected] "condition_not_met"
+ [email protected] "do_last_thing"
+ [email protected] "// comment"
+ [email protected] "/* comment */"
diff --git a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast b/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast
index a0a5ca7f5b..9a6010d362 100644
--- a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast
+++ b/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast
@@ -9,34 +9,35 @@ [email protected]
- [email protected] "make_query"
- [email protected] "module_map"
- [email protected] "module_tree"
+ [email protected] "make_query"
+ [email protected] "module_map"
+ [email protected] "module_tree"
diff --git a/crates/syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/syntax/test_data/parser/ok/0035_weird_exprs.rast
index 5b114df801..672a12d087 100644
--- a/crates/syntax/test_data/parser/ok/0035_weird_exprs.rast
+++ b/crates/syntax/test_data/parser/ok/0035_weird_exprs.rast
@@ -144,32 +144,33 @@ [email protected]
@@ -181,46 +182,48 @@ [email protected]
@@ -232,185 +235,189 @@ [email protected]
@@ -422,160 +429,170 @@ [email protected]
@@ -587,232 +604,233 @@ [email protected]
@@ -833,165 +851,167 @@ [email protected]
- [email protected] "println"
+ [email protected] "println"
@@ -1003,138 +1023,144 @@ [email protected]
- [email protected] "continue"
- [email protected] "\"wat\""
+ [email protected] "continue"
+ [email protected] "\"wat\""
@@ -1146,30 +1172,31 @@ [email protected]
- [email protected] "println"
- [email protected] "\"lincoln\""
+ [email protected] "println"
+ [email protected] "\"lincoln\""
@@ -1181,113 +1208,114 @@ [email protected]
- [email protected] "assert_eq"
- [email protected] "\".................... ..."
- [email protected] "\"{:?}\""
+ [email protected] "assert_eq"
+ [email protected] "\".................... ..."
+ [email protected] "\"{:?}\""
@@ -1310,168 +1338,170 @@ [email protected]
- [email protected] "assert_eq"
- [email protected] "macro_rules"
+ [email protected] "assert_eq"
+ [email protected] "macro_rules"
@@ -1483,75 +1513,76 @@ [email protected]
- [email protected] "assert_eq"
- [email protected] "\"><>\""
- [email protected] "\"><>\""
- [email protected] "collect"
+ [email protected] "assert_eq"
+ [email protected] "\"><>\""
+ [email protected] "\"><>\""
+ [email protected] "collect"
@@ -1563,49 +1594,50 @@ [email protected]
@@ -1617,118 +1649,121 @@ [email protected]
- [email protected] "\"\\\\\""
- [email protected] "'🤔'"
+ [email protected] "\"\\\\\""
+ [email protected] "'🤔'"
@@ -1764,305 +1799,306 @@ [email protected]
@@ -2074,29 +2110,30 @@ [email protected]
@@ -2111,189 +2148,190 @@ [email protected]
- [email protected] "strange"
- [email protected] "zombiejesus"
- [email protected] "notsure"
- [email protected] "canttouchthis"
- [email protected] "angrydome"
- [email protected] "evil_lincoln"
- [email protected] "special_characters"
- [email protected] "punch_card"
+ [email protected] "strange"
+ [email protected] "zombiejesus"
+ [email protected] "notsure"
+ [email protected] "canttouchthis"
+ [email protected] "angrydome"
+ [email protected] "evil_lincoln"
+ [email protected] "special_characters"
+ [email protected] "punch_card"
diff --git a/crates/syntax/test_data/parser/ok/0036_fully_qualified.rast b/crates/syntax/test_data/parser/ok/0036_fully_qualified.rast
index c4da317b9f..2aa7fffd1c 100644
--- a/crates/syntax/test_data/parser/ok/0036_fully_qualified.rast
+++ b/crates/syntax/test_data/parser/ok/0036_fully_qualified.rast
@@ -76,17 +76,18 @@ [email protected]
- [email protected] "to_owned"
+ [email protected] "to_owned"
diff --git a/crates/syntax/test_data/parser/ok/0038_where_pred_type.rast b/crates/syntax/test_data/parser/ok/0038_where_pred_type.rast
index 22168eaf1a..09aa2e60d9 100644
--- a/crates/syntax/test_data/parser/ok/0038_where_pred_type.rast
+++ b/crates/syntax/test_data/parser/ok/0038_where_pred_type.rast
@@ -38,5 +38,6 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast b/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast
index 68a366354e..186dea82d4 100644
--- a/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast
+++ b/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast
@@ -9,7 +9,8 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0041_raw_keywords.rast b/crates/syntax/test_data/parser/ok/0041_raw_keywords.rast
index 4035aef6f2..a8971b466e 100644
--- a/crates/syntax/test_data/parser/ok/0041_raw_keywords.rast
+++ b/crates/syntax/test_data/parser/ok/0041_raw_keywords.rast
@@ -9,41 +9,42 @@ [email protected]
- [email protected] "r#struct"
- [email protected] "r#trait"
- [email protected] "r#struct"
+ [email protected] "r#struct"
+ [email protected] "r#trait"
+ [email protected] "r#struct"
diff --git a/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast
index e71e069f1f..aa7a4dc745 100644
--- a/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast
+++ b/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast
@@ -39,19 +39,20 @@ [email protected]
- [email protected] "unimplemented"
+ [email protected] "unimplemented"
@@ -75,8 +76,9 @@ [email protected]
@@ -88,36 +90,37 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0043_complex_assignment.rast b/crates/syntax/test_data/parser/ok/0043_complex_assignment.rast
index adc4a22e96..12d776c7bf 100644
--- a/crates/syntax/test_data/parser/ok/0043_complex_assignment.rast
+++ b/crates/syntax/test_data/parser/ok/0043_complex_assignment.rast
@@ -40,70 +40,71 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0044_let_attrs.rast b/crates/syntax/test_data/parser/ok/0044_let_attrs.rast
index d0e7a1dbe6..80c1d6b87a 100644
--- a/crates/syntax/test_data/parser/ok/0044_let_attrs.rast
+++ b/crates/syntax/test_data/parser/ok/0044_let_attrs.rast
@@ -11,66 +11,67 @@ [email protected]
- [email protected] "feature"
- [email protected] "\"backtrace\""
- [email protected] "exit_code"
- [email protected] "catch_unwind"
+ [email protected] "feature"
+ [email protected] "\"backtrace\""
+ [email protected] "exit_code"
+ [email protected] "catch_unwind"
diff --git a/crates/syntax/test_data/parser/ok/0045_block_attrs.rast b/crates/syntax/test_data/parser/ok/0045_block_attrs.rast
index 7fbd635d00..a45f88def1 100644
--- a/crates/syntax/test_data/parser/ok/0045_block_attrs.rast
+++ b/crates/syntax/test_data/parser/ok/0045_block_attrs.rast
@@ -9,87 +9,90 @@ [email protected]
- [email protected] "\"Inner attributes all ..."
- [email protected] "//! As are ModuleDoc ..."
- [email protected] "\"Inner attributes are ..."
- [email protected] "\"Being validated is n ..."
- [email protected] "//! As are ModuleDoc ..."
- [email protected] "\"Inner attributes are ..."
- [email protected] "//! As are ModuleDoc ..."
+ [email protected] "\"Inner attributes all ..."
+ [email protected] "//! As are ModuleDoc ..."
+ [email protected] "\"Inner attributes are ..."
+ [email protected] "\"Being validated is n ..."
+ [email protected] "//! As are ModuleDoc ..."
+ [email protected] "\"Inner attributes are ..."
+ [email protected] "//! As are ModuleDoc ..."
@@ -101,36 +104,38 @@ [email protected]
- [email protected] "\"Outer attributes are ..."
+ [email protected] "\"Outer attributes are ..."
[email protected] "// https://github.com ..."
@@ -199,26 +204,27 @@ [email protected]
- [email protected] "unused_variables"
- [email protected] "// this is `inner_at ..."
+ [email protected] "unused_variables"
+ [email protected] "// this is `inner_at ..."
diff --git a/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
index 731a2315aa..9b6101edb1 100644
--- a/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
+++ b/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
@@ -11,250 +11,252 @@ [email protected]
@@ -315,6 +317,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0048_compound_assignment.rast b/crates/syntax/test_data/parser/ok/0048_compound_assignment.rast
index eaab478433..b19a0b5f8b 100644
--- a/crates/syntax/test_data/parser/ok/0048_compound_assignment.rast
+++ b/crates/syntax/test_data/parser/ok/0048_compound_assignment.rast
@@ -11,190 +11,191 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0049_async_block.rast b/crates/syntax/test_data/parser/ok/0049_async_block.rast
index 57ecad3cfa..a254214595 100644
--- a/crates/syntax/test_data/parser/ok/0049_async_block.rast
+++ b/crates/syntax/test_data/parser/ok/0049_async_block.rast
@@ -9,27 +9,28 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast b/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast
index c7ce12e93a..f54c0c1664 100644
--- a/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast
+++ b/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast
@@ -49,8 +49,9 @@ [email protected]
@@ -62,29 +63,30 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast
index a7f0f7bc66..e4e76645ce 100644
--- a/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast
+++ b/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast
@@ -40,8 +40,9 @@ [email protected]
@@ -74,8 +75,9 @@ [email protected]
@@ -189,8 +191,9 @@ [email protected]
@@ -294,8 +297,9 @@ [email protected]
@@ -320,8 +324,9 @@ [email protected]
@@ -347,8 +352,9 @@ [email protected]
@@ -382,8 +388,9 @@ [email protected]
@@ -418,8 +425,9 @@ [email protected]
@@ -456,8 +464,9 @@ [email protected]
@@ -489,8 +498,9 @@ [email protected]
@@ -531,7 +541,8 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0052_for_range_block.rast b/crates/syntax/test_data/parser/ok/0052_for_range_block.rast
index 350823ba36..949ddc3797 100644
--- a/crates/syntax/test_data/parser/ok/0052_for_range_block.rast
+++ b/crates/syntax/test_data/parser/ok/0052_for_range_block.rast
@@ -9,70 +9,73 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
index f25c9ac36f..e85cb15961 100644
--- a/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
+++ b/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
@@ -32,8 +32,9 @@ [email protected]
@@ -74,8 +75,9 @@ [email protected]
@@ -118,6 +120,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast b/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast
index 7447d516ed..b43c38b9e0 100644
--- a/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast
+++ b/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast
@@ -22,28 +22,29 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0056_neq_in_type.rast b/crates/syntax/test_data/parser/ok/0056_neq_in_type.rast
index 3ef916e556..7393f1df83 100644
--- a/crates/syntax/test_data/parser/ok/0056_neq_in_type.rast
+++ b/crates/syntax/test_data/parser/ok/0056_neq_in_type.rast
@@ -9,56 +9,58 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0057_loop_in_call.rast b/crates/syntax/test_data/parser/ok/0057_loop_in_call.rast
index 76301004a5..f8efd8ea4c 100644
--- a/crates/syntax/test_data/parser/ok/0057_loop_in_call.rast
+++ b/crates/syntax/test_data/parser/ok/0057_loop_in_call.rast
@@ -20,8 +20,9 @@ [email protected]
@@ -33,24 +34,26 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast b/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast
index a1dfd58f26..476a19307a 100644
--- a/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast
+++ b/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast
@@ -9,88 +9,89 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast b/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast
index 213f7b3815..0cb1ccf044 100644
--- a/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast
+++ b/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast
@@ -9,89 +9,93 @@ [email protected]
- [email protected] "into_iter"
+ [email protected] "into_iter"
diff --git a/crates/syntax/test_data/parser/ok/0060_as_range.rast b/crates/syntax/test_data/parser/ok/0060_as_range.rast
index 1fd1a28884..f692108505 100644
--- a/crates/syntax/test_data/parser/ok/0060_as_range.rast
+++ b/crates/syntax/test_data/parser/ok/0060_as_range.rast
@@ -9,47 +9,48 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0061_match_full_range.rast b/crates/syntax/test_data/parser/ok/0061_match_full_range.rast
index ba49c115b5..bcc8732c97 100644
--- a/crates/syntax/test_data/parser/ok/0061_match_full_range.rast
+++ b/crates/syntax/test_data/parser/ok/0061_match_full_range.rast
@@ -9,18 +9,19 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0062_macro_2.0.rast b/crates/syntax/test_data/parser/ok/0062_macro_2.0.rast
index e75848f0f8..80f331bec3 100644
--- a/crates/syntax/test_data/parser/ok/0062_macro_2.0.rast
+++ b/crates/syntax/test_data/parser/ok/0062_macro_2.0.rast
@@ -71,106 +71,107 @@ [email protected]
- [email protected] "test_merge"
- [email protected] "assert_eq"
- [email protected] "merge_use_trees"
- [email protected] "parse_use_trees"
- [email protected] "parse_use_trees"
+ [email protected] "test_merge"
+ [email protected] "assert_eq"
+ [email protected] "merge_use_trees"
+ [email protected] "parse_use_trees"
+ [email protected] "parse_use_trees"
diff --git a/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast
index 8eda599762..979058d032 100644
--- a/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast
+++ b/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast
@@ -47,8 +47,9 @@ [email protected]
@@ -89,8 +90,9 @@ [email protected]
@@ -120,8 +122,9 @@ [email protected]
@@ -152,8 +155,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast b/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast
index a3c6ed82e1..dbfc2f9260 100644
--- a/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast
+++ b/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast
@@ -50,8 +50,9 @@ [email protected]
@@ -92,8 +93,9 @@ [email protected]
@@ -123,8 +125,9 @@ [email protected]
@@ -155,8 +158,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0065_comment_newline.rast b/crates/syntax/test_data/parser/ok/0065_comment_newline.rast
index 29bd38c051..162830d95f 100644
--- a/crates/syntax/test_data/parser/ok/0065_comment_newline.rast
+++ b/crates/syntax/test_data/parser/ok/0065_comment_newline.rast
@@ -11,6 +11,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast b/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast
index 2c699ffcb6..9efa6ec0b6 100644
--- a/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast
+++ b/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast
@@ -55,6 +55,7 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0066_default_modifier.rast b/crates/syntax/test_data/parser/ok/0066_default_modifier.rast
index e9b57ec3b3..0479c5f60f 100644
--- a/crates/syntax/test_data/parser/ok/0066_default_modifier.rast
+++ b/crates/syntax/test_data/parser/ok/0066_default_modifier.rast
@@ -58,8 +58,9 @@ [email protected]
@@ -75,8 +76,9 @@ [email protected]
@@ -150,8 +152,9 @@ [email protected]
@@ -167,8 +170,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0067_where_for_pred.rast b/crates/syntax/test_data/parser/ok/0067_where_for_pred.rast
index 79e2b28678..d1bf63d507 100644
--- a/crates/syntax/test_data/parser/ok/0067_where_for_pred.rast
+++ b/crates/syntax/test_data/parser/ok/0067_where_for_pred.rast
@@ -57,9 +57,10 @@ [email protected]
@@ -110,9 +111,10 @@ [email protected]
@@ -180,9 +182,10 @@ [email protected]
@@ -236,9 +239,10 @@ [email protected]
@@ -320,9 +324,10 @@ [email protected]
@@ -401,7 +406,8 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0068_item_modifiers.rast b/crates/syntax/test_data/parser/ok/0068_item_modifiers.rast
index 87eebf1857..8b635d0a03 100644
--- a/crates/syntax/test_data/parser/ok/0068_item_modifiers.rast
+++ b/crates/syntax/test_data/parser/ok/0068_item_modifiers.rast
@@ -11,8 +11,9 @@ [email protected]
@@ -27,8 +28,9 @@ [email protected]
@@ -42,8 +44,9 @@ [email protected]
@@ -59,8 +62,9 @@ [email protected]
@@ -79,8 +83,9 @@ [email protected]
@@ -94,8 +99,9 @@ [email protected]
@@ -111,8 +117,9 @@ [email protected]
@@ -128,8 +135,9 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast b/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast
index 026c776e29..7967b88f20 100644
--- a/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast
+++ b/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast
@@ -126,78 +126,79 @@ [email protected]
- [email protected] "Addable"
+ [email protected] "Addable"
diff --git a/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast b/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast
index 925fa4cbf6..b52161a401 100644
--- a/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast
+++ b/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast
@@ -9,50 +9,51 @@ [email protected]
diff --git a/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast b/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast
index 3a00212e80..075d15f249 100644
--- a/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast
+++ b/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast
@@ -9,61 +9,63 @@ [email protected]