├── .cargo └── config.toml ├── .editorconfig ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── critical_nightly_regression.md │ └── feature_request.md ├── actions │ └── github-release │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── action.yml │ │ ├── main.js │ │ └── package.json ├── rust.json └── workflows │ ├── autopublish.yaml │ ├── ci.yaml │ ├── fuzz.yml │ ├── metrics.yaml │ ├── publish-libs.yaml │ ├── release.yaml │ └── rustdoc.yaml ├── .gitignore ├── .typos.toml ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── PRIVACY.md ├── README.md ├── assets ├── logo-square.svg └── logo-wide.svg ├── bench_data ├── glorious_old_parser └── numerous_macro_rules ├── clippy.toml ├── crates ├── base-db │ ├── Cargo.toml │ └── src │ │ ├── change.rs │ │ ├── input.rs │ │ └── lib.rs ├── cfg │ ├── Cargo.toml │ └── src │ │ ├── cfg_expr.rs │ │ ├── dnf.rs │ │ ├── lib.rs │ │ └── tests.rs ├── edition │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── hir-def │ ├── Cargo.toml │ └── src │ │ ├── attr.rs │ │ ├── builtin_type.rs │ │ ├── db.rs │ │ ├── dyn_map.rs │ │ ├── expr_store.rs │ │ ├── expr_store │ │ ├── body.rs │ │ ├── expander.rs │ │ ├── lower.rs │ │ ├── lower │ │ │ ├── asm.rs │ │ │ ├── generics.rs │ │ │ ├── path.rs │ │ │ └── path │ │ │ │ └── tests.rs │ │ ├── path.rs │ │ ├── pretty.rs │ │ ├── scope.rs │ │ ├── tests.rs │ │ └── tests │ │ │ ├── body.rs │ │ │ ├── body │ │ │ └── block.rs │ │ │ └── signatures.rs │ │ ├── find_path.rs │ │ ├── hir.rs │ │ ├── hir │ │ ├── format_args.rs │ │ ├── generics.rs │ │ └── type_ref.rs │ │ ├── import_map.rs │ │ ├── item_scope.rs │ │ ├── item_tree.rs │ │ ├── item_tree │ │ ├── lower.rs │ │ ├── pretty.rs │ │ └── tests.rs │ │ ├── lang_item.rs │ │ ├── lib.rs │ │ ├── macro_expansion_tests │ │ ├── builtin_derive_macro.rs │ │ ├── builtin_fn_macro.rs │ │ ├── mbe.rs │ │ ├── mbe │ │ │ ├── matching.rs │ │ │ ├── meta_syntax.rs │ │ │ ├── metavar_expr.rs │ │ │ ├── regression.rs │ │ │ └── tt_conversion.rs │ │ ├── mod.rs │ │ └── proc_macros.rs │ │ ├── nameres.rs │ │ ├── nameres │ │ ├── assoc.rs │ │ ├── attr_resolution.rs │ │ ├── collector.rs │ │ ├── diagnostics.rs │ │ ├── mod_resolution.rs │ │ ├── path_resolution.rs │ │ ├── proc_macro.rs │ │ ├── tests.rs │ │ └── tests │ │ │ ├── globs.rs │ │ │ ├── incremental.rs │ │ │ ├── macros.rs │ │ │ ├── mod_resolution.rs │ │ │ └── primitives.rs │ │ ├── per_ns.rs │ │ ├── resolver.rs │ │ ├── signatures.rs │ │ ├── src.rs │ │ ├── test_db.rs │ │ └── visibility.rs ├── hir-expand │ ├── Cargo.toml │ └── src │ │ ├── attrs.rs │ │ ├── builtin.rs │ │ ├── builtin │ │ ├── attr_macro.rs │ │ ├── derive_macro.rs │ │ ├── fn_macro.rs │ │ └── quote.rs │ │ ├── cfg_process.rs │ │ ├── change.rs │ │ ├── db.rs │ │ ├── declarative.rs │ │ ├── eager.rs │ │ ├── files.rs │ │ ├── fixup.rs │ │ ├── hygiene.rs │ │ ├── inert_attr_macro.rs │ │ ├── lib.rs │ │ ├── mod_path.rs │ │ ├── name.rs │ │ ├── prettify_macro_expansion_.rs │ │ ├── proc_macro.rs │ │ └── span_map.rs ├── hir-ty │ ├── Cargo.toml │ └── src │ │ ├── autoderef.rs │ │ ├── builder.rs │ │ ├── chalk_db.rs │ │ ├── chalk_ext.rs │ │ ├── consteval.rs │ │ ├── consteval │ │ ├── tests.rs │ │ └── tests │ │ │ └── intrinsics.rs │ │ ├── db.rs │ │ ├── diagnostics.rs │ │ ├── diagnostics │ │ ├── decl_check.rs │ │ ├── decl_check │ │ │ └── case_conv.rs │ │ ├── expr.rs │ │ ├── match_check.rs │ │ ├── match_check │ │ │ ├── pat_analysis.rs │ │ │ └── pat_util.rs │ │ └── unsafe_check.rs │ │ ├── display.rs │ │ ├── drop.rs │ │ ├── dyn_compatibility.rs │ │ ├── dyn_compatibility │ │ └── tests.rs │ │ ├── generics.rs │ │ ├── infer.rs │ │ ├── infer │ │ ├── cast.rs │ │ ├── closure.rs │ │ ├── coerce.rs │ │ ├── diagnostics.rs │ │ ├── expr.rs │ │ ├── mutability.rs │ │ ├── pat.rs │ │ ├── path.rs │ │ └── unify.rs │ │ ├── inhabitedness.rs │ │ ├── interner.rs │ │ ├── lang_items.rs │ │ ├── layout.rs │ │ ├── layout │ │ ├── adt.rs │ │ ├── target.rs │ │ ├── tests.rs │ │ └── tests │ │ │ └── closure.rs │ │ ├── lib.rs │ │ ├── lower.rs │ │ ├── lower │ │ ├── diagnostics.rs │ │ └── path.rs │ │ ├── mapping.rs │ │ ├── method_resolution.rs │ │ ├── mir.rs │ │ ├── mir │ │ ├── borrowck.rs │ │ ├── eval.rs │ │ ├── eval │ │ │ ├── shim.rs │ │ │ ├── shim │ │ │ │ └── simd.rs │ │ │ └── tests.rs │ │ ├── lower.rs │ │ ├── lower │ │ │ ├── as_place.rs │ │ │ └── pattern_matching.rs │ │ ├── monomorphization.rs │ │ └── pretty.rs │ │ ├── primitive.rs │ │ ├── target_feature.rs │ │ ├── test_db.rs │ │ ├── tests.rs │ │ ├── tests │ │ ├── closure_captures.rs │ │ ├── coercion.rs │ │ ├── diagnostics.rs │ │ ├── display_source_code.rs │ │ ├── incremental.rs │ │ ├── macros.rs │ │ ├── method_resolution.rs │ │ ├── never_type.rs │ │ ├── patterns.rs │ │ ├── regression.rs │ │ ├── simple.rs │ │ ├── traits.rs │ │ └── type_alias_impl_traits.rs │ │ ├── tls.rs │ │ ├── traits.rs │ │ ├── utils.rs │ │ └── variance.rs ├── hir │ ├── Cargo.toml │ └── src │ │ ├── attrs.rs │ │ ├── db.rs │ │ ├── diagnostics.rs │ │ ├── display.rs │ │ ├── from_id.rs │ │ ├── has_source.rs │ │ ├── lib.rs │ │ ├── semantics.rs │ │ ├── semantics │ │ ├── child_by_source.rs │ │ └── source_to_def.rs │ │ ├── source_analyzer.rs │ │ ├── symbols.rs │ │ ├── term_search.rs │ │ └── term_search │ │ ├── expr.rs │ │ └── tactics.rs ├── ide-assists │ ├── Cargo.toml │ └── src │ │ ├── assist_config.rs │ │ ├── assist_context.rs │ │ ├── handlers │ │ ├── add_braces.rs │ │ ├── add_explicit_enum_discriminant.rs │ │ ├── add_explicit_type.rs │ │ ├── add_label_to_loop.rs │ │ ├── add_lifetime_to_type.rs │ │ ├── add_missing_impl_members.rs │ │ ├── add_missing_match_arms.rs │ │ ├── add_return_type.rs │ │ ├── add_turbo_fish.rs │ │ ├── apply_demorgan.rs │ │ ├── auto_import.rs │ │ ├── bind_unused_param.rs │ │ ├── change_visibility.rs │ │ ├── convert_bool_then.rs │ │ ├── convert_bool_to_enum.rs │ │ ├── convert_closure_to_fn.rs │ │ ├── convert_comment_block.rs │ │ ├── convert_comment_from_or_to_doc.rs │ │ ├── convert_for_to_while_let.rs │ │ ├── convert_from_to_tryfrom.rs │ │ ├── convert_integer_literal.rs │ │ ├── convert_into_to_from.rs │ │ ├── convert_iter_for_each_to_for.rs │ │ ├── convert_let_else_to_match.rs │ │ ├── convert_match_to_let_else.rs │ │ ├── convert_named_struct_to_tuple_struct.rs │ │ ├── convert_nested_function_to_closure.rs │ │ ├── convert_to_guarded_return.rs │ │ ├── convert_tuple_return_type_to_struct.rs │ │ ├── convert_tuple_struct_to_named_struct.rs │ │ ├── convert_two_arm_bool_match_to_matches_macro.rs │ │ ├── convert_while_to_loop.rs │ │ ├── destructure_struct_binding.rs │ │ ├── destructure_tuple_binding.rs │ │ ├── desugar_doc_comment.rs │ │ ├── desugar_try_expr.rs │ │ ├── expand_glob_import.rs │ │ ├── expand_rest_pattern.rs │ │ ├── extract_expressions_from_format_string.rs │ │ ├── extract_function.rs │ │ ├── extract_module.rs │ │ ├── extract_struct_from_enum_variant.rs │ │ ├── extract_type_alias.rs │ │ ├── extract_variable.rs │ │ ├── fix_visibility.rs │ │ ├── flip_binexpr.rs │ │ ├── flip_comma.rs │ │ ├── flip_or_pattern.rs │ │ ├── flip_trait_bound.rs │ │ ├── generate_constant.rs │ │ ├── generate_default_from_enum_variant.rs │ │ ├── generate_default_from_new.rs │ │ ├── generate_delegate_methods.rs │ │ ├── generate_delegate_trait.rs │ │ ├── generate_deref.rs │ │ ├── generate_derive.rs │ │ ├── generate_documentation_template.rs │ │ ├── generate_enum_is_method.rs │ │ ├── generate_enum_projection_method.rs │ │ ├── generate_enum_variant.rs │ │ ├── generate_fn_type_alias.rs │ │ ├── generate_from_impl_for_enum.rs │ │ ├── generate_function.rs │ │ ├── generate_getter_or_setter.rs │ │ ├── generate_impl.rs │ │ ├── generate_is_empty_from_len.rs │ │ ├── generate_mut_trait_impl.rs │ │ ├── generate_new.rs │ │ ├── generate_trait_from_impl.rs │ │ ├── inline_call.rs │ │ ├── inline_const_as_literal.rs │ │ ├── inline_local_variable.rs │ │ ├── inline_macro.rs │ │ ├── inline_type_alias.rs │ │ ├── into_to_qualified_from.rs │ │ ├── introduce_named_lifetime.rs │ │ ├── introduce_named_type_parameter.rs │ │ ├── invert_if.rs │ │ ├── merge_imports.rs │ │ ├── merge_match_arms.rs │ │ ├── merge_nested_if.rs │ │ ├── move_bounds.rs │ │ ├── move_const_to_impl.rs │ │ ├── move_from_mod_rs.rs │ │ ├── move_guard.rs │ │ ├── move_module_to_file.rs │ │ ├── move_to_mod_rs.rs │ │ ├── normalize_import.rs │ │ ├── number_representation.rs │ │ ├── promote_local_to_const.rs │ │ ├── pull_assignment_up.rs │ │ ├── qualify_method_call.rs │ │ ├── qualify_path.rs │ │ ├── raw_string.rs │ │ ├── remove_dbg.rs │ │ ├── remove_mut.rs │ │ ├── remove_parentheses.rs │ │ ├── remove_underscore.rs │ │ ├── remove_unused_imports.rs │ │ ├── remove_unused_param.rs │ │ ├── reorder_fields.rs │ │ ├── reorder_impl_items.rs │ │ ├── replace_arith_op.rs │ │ ├── replace_derive_with_manual_impl.rs │ │ ├── replace_if_let_with_match.rs │ │ ├── replace_is_method_with_if_let_method.rs │ │ ├── replace_let_with_if_let.rs │ │ ├── replace_method_eager_lazy.rs │ │ ├── replace_named_generic_with_impl.rs │ │ ├── replace_qualified_name_with_use.rs │ │ ├── replace_string_with_char.rs │ │ ├── replace_turbofish_with_explicit_type.rs │ │ ├── sort_items.rs │ │ ├── split_import.rs │ │ ├── term_search.rs │ │ ├── toggle_async_sugar.rs │ │ ├── toggle_ignore.rs │ │ ├── toggle_macro_delimiter.rs │ │ ├── unmerge_imports.rs │ │ ├── unmerge_match_arm.rs │ │ ├── unnecessary_async.rs │ │ ├── unqualify_method_call.rs │ │ ├── unwrap_block.rs │ │ ├── unwrap_return_type.rs │ │ ├── unwrap_tuple.rs │ │ ├── unwrap_type_to_generic_arg.rs │ │ ├── wrap_return_type.rs │ │ └── wrap_unwrap_cfg_attr.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ ├── tests │ │ └── generated.rs │ │ ├── utils.rs │ │ └── utils │ │ ├── gen_trait_fn_body.rs │ │ └── ref_field_expr.rs ├── ide-completion │ ├── Cargo.toml │ └── src │ │ ├── completions.rs │ │ ├── completions │ │ ├── attribute.rs │ │ ├── attribute │ │ │ ├── cfg.rs │ │ │ ├── derive.rs │ │ │ ├── lint.rs │ │ │ ├── macro_use.rs │ │ │ └── repr.rs │ │ ├── dot.rs │ │ ├── env_vars.rs │ │ ├── expr.rs │ │ ├── extern_abi.rs │ │ ├── extern_crate.rs │ │ ├── field.rs │ │ ├── flyimport.rs │ │ ├── fn_param.rs │ │ ├── format_string.rs │ │ ├── item_list.rs │ │ ├── item_list │ │ │ └── trait_impl.rs │ │ ├── keyword.rs │ │ ├── lifetime.rs │ │ ├── mod_.rs │ │ ├── pattern.rs │ │ ├── postfix.rs │ │ ├── postfix │ │ │ └── format_like.rs │ │ ├── record.rs │ │ ├── snippet.rs │ │ ├── type.rs │ │ ├── use_.rs │ │ └── vis.rs │ │ ├── config.rs │ │ ├── context.rs │ │ ├── context │ │ ├── analysis.rs │ │ └── tests.rs │ │ ├── item.rs │ │ ├── lib.rs │ │ ├── render.rs │ │ ├── render │ │ ├── const_.rs │ │ ├── function.rs │ │ ├── literal.rs │ │ ├── macro_.rs │ │ ├── pattern.rs │ │ ├── type_alias.rs │ │ ├── union_literal.rs │ │ └── variant.rs │ │ ├── snippet.rs │ │ ├── tests.rs │ │ └── tests │ │ ├── attribute.rs │ │ ├── expression.rs │ │ ├── flyimport.rs │ │ ├── fn_param.rs │ │ ├── item.rs │ │ ├── item_list.rs │ │ ├── pattern.rs │ │ ├── predicate.rs │ │ ├── proc_macros.rs │ │ ├── raw_identifiers.rs │ │ ├── record.rs │ │ ├── special.rs │ │ ├── type_pos.rs │ │ ├── use_tree.rs │ │ └── visibility.rs ├── ide-db │ ├── Cargo.toml │ └── src │ │ ├── active_parameter.rs │ │ ├── apply_change.rs │ │ ├── assists.rs │ │ ├── defs.rs │ │ ├── documentation.rs │ │ ├── famous_defs.rs │ │ ├── generated │ │ └── lints.rs │ │ ├── helpers.rs │ │ ├── imports │ │ ├── import_assets.rs │ │ ├── insert_use.rs │ │ ├── insert_use │ │ │ └── tests.rs │ │ └── merge_imports.rs │ │ ├── items_locator.rs │ │ ├── label.rs │ │ ├── lib.rs │ │ ├── path_transform.rs │ │ ├── prime_caches.rs │ │ ├── rename.rs │ │ ├── rust_doc.rs │ │ ├── search.rs │ │ ├── source_change.rs │ │ ├── symbol_index.rs │ │ ├── syntax_helpers │ │ ├── format_string.rs │ │ ├── format_string_exprs.rs │ │ ├── node_ext.rs │ │ ├── suggest_name.rs │ │ └── tree_diff.rs │ │ ├── test_data │ │ ├── test_doc_alias.txt │ │ └── test_symbol_index_collection.txt │ │ ├── text_edit.rs │ │ ├── traits.rs │ │ ├── ty_filter.rs │ │ └── use_trivial_constructor.rs ├── ide-diagnostics │ ├── Cargo.toml │ └── src │ │ ├── handlers │ │ ├── await_outside_of_async.rs │ │ ├── bad_rtn.rs │ │ ├── break_outside_of_loop.rs │ │ ├── elided_lifetimes_in_path.rs │ │ ├── expected_function.rs │ │ ├── field_shorthand.rs │ │ ├── generic_args_prohibited.rs │ │ ├── inactive_code.rs │ │ ├── incoherent_impl.rs │ │ ├── incorrect_case.rs │ │ ├── incorrect_generics_len.rs │ │ ├── incorrect_generics_order.rs │ │ ├── invalid_cast.rs │ │ ├── invalid_derive_target.rs │ │ ├── json_is_not_rust.rs │ │ ├── macro_error.rs │ │ ├── malformed_derive.rs │ │ ├── mismatched_arg_count.rs │ │ ├── missing_fields.rs │ │ ├── missing_lifetime.rs │ │ ├── missing_match_arms.rs │ │ ├── missing_unsafe.rs │ │ ├── moved_out_of_ref.rs │ │ ├── mutability_errors.rs │ │ ├── no_such_field.rs │ │ ├── non_exhaustive_let.rs │ │ ├── parenthesized_generic_args_without_fn_trait.rs │ │ ├── private_assoc_item.rs │ │ ├── private_field.rs │ │ ├── remove_trailing_return.rs │ │ ├── remove_unnecessary_else.rs │ │ ├── replace_filter_map_next_with_find_map.rs │ │ ├── trait_impl_incorrect_safety.rs │ │ ├── trait_impl_missing_assoc_item.rs │ │ ├── trait_impl_orphan.rs │ │ ├── trait_impl_redundant_assoc_item.rs │ │ ├── type_mismatch.rs │ │ ├── typed_hole.rs │ │ ├── undeclared_label.rs │ │ ├── unimplemented_builtin_macro.rs │ │ ├── unlinked_file.rs │ │ ├── unreachable_label.rs │ │ ├── unresolved_assoc_item.rs │ │ ├── unresolved_extern_crate.rs │ │ ├── unresolved_field.rs │ │ ├── unresolved_ident.rs │ │ ├── unresolved_import.rs │ │ ├── unresolved_macro_call.rs │ │ ├── unresolved_method.rs │ │ ├── unresolved_module.rs │ │ ├── unused_variables.rs │ │ └── useless_braces.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── tests │ │ └── overly_long_real_world_cases.rs ├── ide-ssr │ ├── Cargo.toml │ └── src │ │ ├── errors.rs │ │ ├── fragments.rs │ │ ├── from_comment.rs │ │ ├── lib.rs │ │ ├── matching.rs │ │ ├── nester.rs │ │ ├── parsing.rs │ │ ├── replacing.rs │ │ ├── resolving.rs │ │ ├── search.rs │ │ └── tests.rs ├── ide │ ├── Cargo.toml │ └── src │ │ ├── annotations.rs │ │ ├── annotations │ │ └── fn_references.rs │ │ ├── call_hierarchy.rs │ │ ├── child_modules.rs │ │ ├── doc_links.rs │ │ ├── doc_links │ │ ├── intra_doc_links.rs │ │ └── tests.rs │ │ ├── expand_macro.rs │ │ ├── extend_selection.rs │ │ ├── fetch_crates.rs │ │ ├── file_structure.rs │ │ ├── fixture.rs │ │ ├── folding_ranges.rs │ │ ├── goto_declaration.rs │ │ ├── goto_definition.rs │ │ ├── goto_implementation.rs │ │ ├── goto_type_definition.rs │ │ ├── highlight_related.rs │ │ ├── hover.rs │ │ ├── hover │ │ ├── render.rs │ │ └── tests.rs │ │ ├── inlay_hints.rs │ │ ├── inlay_hints │ │ ├── adjustment.rs │ │ ├── bind_pat.rs │ │ ├── binding_mode.rs │ │ ├── bounds.rs │ │ ├── chaining.rs │ │ ├── closing_brace.rs │ │ ├── closure_captures.rs │ │ ├── closure_ret.rs │ │ ├── discriminant.rs │ │ ├── extern_block.rs │ │ ├── generic_param.rs │ │ ├── implicit_drop.rs │ │ ├── implicit_static.rs │ │ ├── lifetime.rs │ │ ├── param_name.rs │ │ └── range_exclusive.rs │ │ ├── interpret.rs │ │ ├── join_lines.rs │ │ ├── lib.rs │ │ ├── markdown_remove.rs │ │ ├── markup.rs │ │ ├── matching_brace.rs │ │ ├── moniker.rs │ │ ├── move_item.rs │ │ ├── navigation_target.rs │ │ ├── parent_module.rs │ │ ├── references.rs │ │ ├── rename.rs │ │ ├── runnables.rs │ │ ├── signature_help.rs │ │ ├── ssr.rs │ │ ├── static_index.rs │ │ ├── status.rs │ │ ├── syntax_highlighting.rs │ │ ├── syntax_highlighting │ │ ├── escape.rs │ │ ├── format.rs │ │ ├── highlight.rs │ │ ├── highlights.rs │ │ ├── html.rs │ │ ├── inject.rs │ │ ├── injector.rs │ │ ├── tags.rs │ │ ├── test_data │ │ │ ├── highlight_asm.html │ │ │ ├── highlight_assoc_functions.html │ │ │ ├── highlight_attributes.html │ │ │ ├── highlight_block_mod_items.html │ │ │ ├── highlight_const.html │ │ │ ├── highlight_crate_root.html │ │ │ ├── highlight_default_library.html │ │ │ ├── highlight_doctest.html │ │ │ ├── highlight_extern_crate.html │ │ │ ├── highlight_general.html │ │ │ ├── highlight_injection.html │ │ │ ├── highlight_issue_18089.html │ │ │ ├── highlight_issue_19357.html │ │ │ ├── highlight_keywords.html │ │ │ ├── highlight_keywords_2015.html │ │ │ ├── highlight_keywords_2018.html │ │ │ ├── highlight_keywords_2021.html │ │ │ ├── highlight_keywords_2024.html │ │ │ ├── highlight_keywords_macros.html │ │ │ ├── highlight_lifetimes.html │ │ │ ├── highlight_macros.html │ │ │ ├── highlight_module_docs_inline.html │ │ │ ├── highlight_module_docs_outline.html │ │ │ ├── highlight_operators.html │ │ │ ├── highlight_rainbow.html │ │ │ ├── highlight_strings.html │ │ │ └── highlight_unsafe.html │ │ └── tests.rs │ │ ├── test_explorer.rs │ │ ├── typing.rs │ │ ├── typing │ │ └── on_enter.rs │ │ ├── view_crate_graph.rs │ │ ├── view_hir.rs │ │ ├── view_item_tree.rs │ │ ├── view_memory_layout.rs │ │ ├── view_mir.rs │ │ └── view_syntax_tree.rs ├── intern │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── symbol.rs │ │ └── symbol │ │ └── symbols.rs ├── load-cargo │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── mbe │ ├── Cargo.toml │ └── src │ │ ├── benchmark.rs │ │ ├── expander.rs │ │ ├── expander │ │ ├── matcher.rs │ │ └── transcriber.rs │ │ ├── lib.rs │ │ ├── parser.rs │ │ └── tests.rs ├── parser │ ├── Cargo.toml │ ├── src │ │ ├── event.rs │ │ ├── grammar.rs │ │ ├── grammar │ │ │ ├── attributes.rs │ │ │ ├── expressions.rs │ │ │ ├── expressions │ │ │ │ └── atom.rs │ │ │ ├── generic_args.rs │ │ │ ├── generic_params.rs │ │ │ ├── items.rs │ │ │ ├── items │ │ │ │ ├── adt.rs │ │ │ │ ├── consts.rs │ │ │ │ ├── traits.rs │ │ │ │ └── use_item.rs │ │ │ ├── params.rs │ │ │ ├── paths.rs │ │ │ ├── patterns.rs │ │ │ └── types.rs │ │ ├── input.rs │ │ ├── lexed_str.rs │ │ ├── lib.rs │ │ ├── output.rs │ │ ├── parser.rs │ │ ├── shortcuts.rs │ │ ├── syntax_kind.rs │ │ ├── syntax_kind │ │ │ └── generated.rs │ │ ├── tests.rs │ │ ├── tests │ │ │ ├── prefix_entries.rs │ │ │ └── top_entries.rs │ │ └── token_set.rs │ └── test_data │ │ ├── generated │ │ └── runner.rs │ │ ├── lexer │ │ ├── err │ │ │ ├── byte_char_literals.rast │ │ │ ├── byte_char_literals.rs │ │ │ ├── byte_strings.rast │ │ │ ├── byte_strings.rs │ │ │ ├── c_strings.rast │ │ │ ├── c_strings.rs │ │ │ ├── char_literals.rast │ │ │ ├── char_literals.rs │ │ │ ├── empty_exponent.rast │ │ │ ├── empty_exponent.rs │ │ │ ├── empty_exponent.txt │ │ │ ├── empty_int.rast │ │ │ ├── empty_int.rs │ │ │ ├── empty_int.txt │ │ │ ├── lifetime_starts_with_a_number.rast │ │ │ ├── lifetime_starts_with_a_number.rs │ │ │ ├── lifetime_starts_with_a_number.txt │ │ │ ├── strings.rast │ │ │ ├── strings.rs │ │ │ ├── unclosed_block_comment_at_eof.rast │ │ │ ├── unclosed_block_comment_at_eof.rs │ │ │ ├── unclosed_block_comment_at_eof.txt │ │ │ ├── unclosed_block_comment_with_content.rast │ │ │ ├── unclosed_block_comment_with_content.rs │ │ │ ├── unclosed_block_comment_with_content.txt │ │ │ ├── unclosed_byte_at_eof.rast │ │ │ ├── unclosed_byte_at_eof.rs │ │ │ ├── unclosed_byte_at_eof.txt │ │ │ ├── unclosed_byte_string_at_eof.rast │ │ │ ├── unclosed_byte_string_at_eof.rs │ │ │ ├── unclosed_byte_string_at_eof.txt │ │ │ ├── unclosed_byte_string_with_ascii_escape.rast │ │ │ ├── unclosed_byte_string_with_ascii_escape.rs │ │ │ ├── unclosed_byte_string_with_ascii_escape.txt │ │ │ ├── unclosed_byte_string_with_ferris.rast │ │ │ ├── unclosed_byte_string_with_ferris.rs │ │ │ ├── unclosed_byte_string_with_ferris.txt │ │ │ ├── unclosed_byte_string_with_slash.rast │ │ │ ├── unclosed_byte_string_with_slash.rs │ │ │ ├── unclosed_byte_string_with_slash.txt │ │ │ ├── unclosed_byte_string_with_slash_double_quote.rast │ │ │ ├── unclosed_byte_string_with_slash_double_quote.rs │ │ │ ├── unclosed_byte_string_with_slash_double_quote.txt │ │ │ ├── unclosed_byte_string_with_slash_n.rast │ │ │ ├── unclosed_byte_string_with_slash_n.rs │ │ │ ├── unclosed_byte_string_with_slash_n.txt │ │ │ ├── unclosed_byte_string_with_space.rast │ │ │ ├── unclosed_byte_string_with_space.rs │ │ │ ├── unclosed_byte_string_with_space.txt │ │ │ ├── unclosed_byte_string_with_unicode_escape.rast │ │ │ ├── unclosed_byte_string_with_unicode_escape.rs │ │ │ ├── unclosed_byte_string_with_unicode_escape.txt │ │ │ ├── unclosed_byte_with_ascii_escape.rast │ │ │ ├── unclosed_byte_with_ascii_escape.rs │ │ │ ├── unclosed_byte_with_ascii_escape.txt │ │ │ ├── unclosed_byte_with_ferris.rast │ │ │ ├── unclosed_byte_with_ferris.rs │ │ │ ├── unclosed_byte_with_ferris.txt │ │ │ ├── unclosed_byte_with_slash.rast │ │ │ ├── unclosed_byte_with_slash.rs │ │ │ ├── unclosed_byte_with_slash.txt │ │ │ ├── unclosed_byte_with_slash_n.rast │ │ │ ├── unclosed_byte_with_slash_n.rs │ │ │ ├── unclosed_byte_with_slash_n.txt │ │ │ ├── unclosed_byte_with_slash_single_quote.rast │ │ │ ├── unclosed_byte_with_slash_single_quote.rs │ │ │ ├── unclosed_byte_with_slash_single_quote.txt │ │ │ ├── unclosed_byte_with_space.rast │ │ │ ├── unclosed_byte_with_space.rs │ │ │ ├── unclosed_byte_with_space.txt │ │ │ ├── unclosed_byte_with_unicode_escape.rast │ │ │ ├── unclosed_byte_with_unicode_escape.rs │ │ │ ├── unclosed_byte_with_unicode_escape.txt │ │ │ ├── unclosed_char_at_eof.rast │ │ │ ├── unclosed_char_at_eof.rs │ │ │ ├── unclosed_char_at_eof.txt │ │ │ ├── unclosed_char_with_ascii_escape.rast │ │ │ ├── unclosed_char_with_ascii_escape.rs │ │ │ ├── unclosed_char_with_ascii_escape.txt │ │ │ ├── unclosed_char_with_ferris.rast │ │ │ ├── unclosed_char_with_ferris.rs │ │ │ ├── unclosed_char_with_ferris.txt │ │ │ ├── unclosed_char_with_slash.rast │ │ │ ├── unclosed_char_with_slash.rs │ │ │ ├── unclosed_char_with_slash.txt │ │ │ ├── unclosed_char_with_slash_n.rast │ │ │ ├── unclosed_char_with_slash_n.rs │ │ │ ├── unclosed_char_with_slash_n.txt │ │ │ ├── unclosed_char_with_slash_single_quote.rast │ │ │ ├── unclosed_char_with_slash_single_quote.rs │ │ │ ├── unclosed_char_with_slash_single_quote.txt │ │ │ ├── unclosed_char_with_space.rast │ │ │ ├── unclosed_char_with_space.rs │ │ │ ├── unclosed_char_with_space.txt │ │ │ ├── unclosed_char_with_unicode_escape.rast │ │ │ ├── unclosed_char_with_unicode_escape.rs │ │ │ ├── unclosed_char_with_unicode_escape.txt │ │ │ ├── unclosed_nested_block_comment_entirely.rast │ │ │ ├── unclosed_nested_block_comment_entirely.rs │ │ │ ├── unclosed_nested_block_comment_entirely.txt │ │ │ ├── unclosed_nested_block_comment_partially.rast │ │ │ ├── unclosed_nested_block_comment_partially.rs │ │ │ ├── unclosed_nested_block_comment_partially.txt │ │ │ ├── unclosed_raw_byte_string_at_eof.rast │ │ │ ├── unclosed_raw_byte_string_at_eof.rs │ │ │ ├── unclosed_raw_byte_string_at_eof.txt │ │ │ ├── unclosed_raw_byte_string_with_ascii_escape.rast │ │ │ ├── unclosed_raw_byte_string_with_ascii_escape.rs │ │ │ ├── unclosed_raw_byte_string_with_ascii_escape.txt │ │ │ ├── unclosed_raw_byte_string_with_ferris.rast │ │ │ ├── unclosed_raw_byte_string_with_ferris.rs │ │ │ ├── unclosed_raw_byte_string_with_ferris.txt │ │ │ ├── unclosed_raw_byte_string_with_slash.rast │ │ │ ├── unclosed_raw_byte_string_with_slash.rs │ │ │ ├── unclosed_raw_byte_string_with_slash.txt │ │ │ ├── unclosed_raw_byte_string_with_slash_n.rast │ │ │ ├── unclosed_raw_byte_string_with_slash_n.rs │ │ │ ├── unclosed_raw_byte_string_with_slash_n.txt │ │ │ ├── unclosed_raw_byte_string_with_space.rast │ │ │ ├── unclosed_raw_byte_string_with_space.rs │ │ │ ├── unclosed_raw_byte_string_with_space.txt │ │ │ ├── unclosed_raw_byte_string_with_unicode_escape.rast │ │ │ ├── unclosed_raw_byte_string_with_unicode_escape.rs │ │ │ ├── unclosed_raw_byte_string_with_unicode_escape.txt │ │ │ ├── unclosed_raw_string_at_eof.rast │ │ │ ├── unclosed_raw_string_at_eof.rs │ │ │ ├── unclosed_raw_string_at_eof.txt │ │ │ ├── unclosed_raw_string_with_ascii_escape.rast │ │ │ ├── unclosed_raw_string_with_ascii_escape.rs │ │ │ ├── unclosed_raw_string_with_ascii_escape.txt │ │ │ ├── unclosed_raw_string_with_ferris.rast │ │ │ ├── unclosed_raw_string_with_ferris.rs │ │ │ ├── unclosed_raw_string_with_ferris.txt │ │ │ ├── unclosed_raw_string_with_slash.rast │ │ │ ├── unclosed_raw_string_with_slash.rs │ │ │ ├── unclosed_raw_string_with_slash.txt │ │ │ ├── unclosed_raw_string_with_slash_n.rast │ │ │ ├── unclosed_raw_string_with_slash_n.rs │ │ │ ├── unclosed_raw_string_with_slash_n.txt │ │ │ ├── unclosed_raw_string_with_space.rast │ │ │ ├── unclosed_raw_string_with_space.rs │ │ │ ├── unclosed_raw_string_with_space.txt │ │ │ ├── unclosed_raw_string_with_unicode_escape.rast │ │ │ ├── unclosed_raw_string_with_unicode_escape.rs │ │ │ ├── unclosed_raw_string_with_unicode_escape.txt │ │ │ ├── unclosed_string_at_eof.rast │ │ │ ├── unclosed_string_at_eof.rs │ │ │ ├── unclosed_string_at_eof.txt │ │ │ ├── unclosed_string_with_ascii_escape.rast │ │ │ ├── unclosed_string_with_ascii_escape.rs │ │ │ ├── unclosed_string_with_ascii_escape.txt │ │ │ ├── unclosed_string_with_ferris.rast │ │ │ ├── unclosed_string_with_ferris.rs │ │ │ ├── unclosed_string_with_ferris.txt │ │ │ ├── unclosed_string_with_slash.rast │ │ │ ├── unclosed_string_with_slash.rs │ │ │ ├── unclosed_string_with_slash.txt │ │ │ ├── unclosed_string_with_slash_double_quote.rast │ │ │ ├── unclosed_string_with_slash_double_quote.rs │ │ │ ├── unclosed_string_with_slash_double_quote.txt │ │ │ ├── unclosed_string_with_slash_n.rast │ │ │ ├── unclosed_string_with_slash_n.rs │ │ │ ├── unclosed_string_with_slash_n.txt │ │ │ ├── unclosed_string_with_space.rast │ │ │ ├── unclosed_string_with_space.rs │ │ │ ├── unclosed_string_with_space.txt │ │ │ ├── unclosed_string_with_unicode_escape.rast │ │ │ ├── unclosed_string_with_unicode_escape.rs │ │ │ ├── unclosed_string_with_unicode_escape.txt │ │ │ ├── unstarted_raw_byte_string_at_eof.rast │ │ │ ├── unstarted_raw_byte_string_at_eof.rs │ │ │ ├── unstarted_raw_byte_string_at_eof.txt │ │ │ ├── unstarted_raw_byte_string_with_ascii.rast │ │ │ ├── unstarted_raw_byte_string_with_ascii.rs │ │ │ ├── unstarted_raw_byte_string_with_ascii.txt │ │ │ ├── unstarted_raw_string_at_eof.rast │ │ │ ├── unstarted_raw_string_at_eof.rs │ │ │ ├── unstarted_raw_string_at_eof.txt │ │ │ ├── unstarted_raw_string_with_ascii.rast │ │ │ ├── unstarted_raw_string_with_ascii.rs │ │ │ └── unstarted_raw_string_with_ascii.txt │ │ └── ok │ │ │ ├── block_comment.rast │ │ │ ├── block_comment.rs │ │ │ ├── block_comment.txt │ │ │ ├── byte_strings.rast │ │ │ ├── byte_strings.rs │ │ │ ├── byte_strings.txt │ │ │ ├── chars.rast │ │ │ ├── chars.rs │ │ │ ├── chars.txt │ │ │ ├── guarded_str_prefix_edition_2021.rast │ │ │ ├── guarded_str_prefix_edition_2021.rs │ │ │ ├── hello.rast │ │ │ ├── hello.rs │ │ │ ├── hello.txt │ │ │ ├── ident.rast │ │ │ ├── ident.rs │ │ │ ├── ident.txt │ │ │ ├── keywords.rast │ │ │ ├── keywords.rs │ │ │ ├── keywords.txt │ │ │ ├── lifetimes.rast │ │ │ ├── lifetimes.rs │ │ │ ├── lifetimes.txt │ │ │ ├── numbers.rast │ │ │ ├── numbers.rs │ │ │ ├── numbers.txt │ │ │ ├── raw_ident.rast │ │ │ ├── raw_ident.rs │ │ │ ├── raw_ident.txt │ │ │ ├── raw_strings.rast │ │ │ ├── raw_strings.rs │ │ │ ├── raw_strings.txt │ │ │ ├── single_line_comments.rast │ │ │ ├── single_line_comments.rs │ │ │ ├── single_line_comments.txt │ │ │ ├── strings.rast │ │ │ ├── strings.rs │ │ │ ├── strings.txt │ │ │ ├── symbols.rast │ │ │ ├── symbols.rs │ │ │ ├── symbols.txt │ │ │ ├── whitespace.rast │ │ │ ├── whitespace.rs │ │ │ └── whitespace.txt │ │ └── parser │ │ ├── err │ │ ├── 0000_struct_field_missing_comma.rast │ │ ├── 0000_struct_field_missing_comma.rs │ │ ├── 0001_item_recovery_in_file.rast │ │ ├── 0001_item_recovery_in_file.rs │ │ ├── 0002_duplicate_shebang.rast │ │ ├── 0002_duplicate_shebang.rs │ │ ├── 0003_C++_semicolon.rast │ │ ├── 0003_C++_semicolon.rs │ │ ├── 0004_use_path_bad_segment.rast │ │ ├── 0004_use_path_bad_segment.rs │ │ ├── 0005_attribute_recover.rast │ │ ├── 0005_attribute_recover.rs │ │ ├── 0006_named_field_recovery.rast │ │ ├── 0006_named_field_recovery.rs │ │ ├── 0007_stray_curly_in_file.rast │ │ ├── 0007_stray_curly_in_file.rs │ │ ├── 0008_item_block_recovery.rast │ │ ├── 0008_item_block_recovery.rs │ │ ├── 0009_broken_struct_type_parameter.rast │ │ ├── 0009_broken_struct_type_parameter.rs │ │ ├── 0010_unsafe_lambda_block.rast │ │ ├── 0010_unsafe_lambda_block.rs │ │ ├── 0011_extern_struct.rast │ │ ├── 0011_extern_struct.rs │ │ ├── 0012_broken_lambda.rast │ │ ├── 0013_invalid_type.rast │ │ ├── 0013_invalid_type.rs │ │ ├── 0014_where_no_bounds.rast │ │ ├── 0014_where_no_bounds.rs │ │ ├── 0015_curly_in_params.rast │ │ ├── 0015_curly_in_params.rs │ │ ├── 0016_missing_semi.rast │ │ ├── 0016_missing_semi.rs │ │ ├── 0017_incomplete_binexpr.rast │ │ ├── 0017_incomplete_binexpr.rs │ │ ├── 0018_incomplete_fn.rast │ │ ├── 0018_incomplete_fn.rs │ │ ├── 0019_let_recover.rast │ │ ├── 0019_let_recover.rs │ │ ├── 0020_fn_recover.rast │ │ ├── 0020_fn_recover.rs │ │ ├── 0021_incomplete_param.rast │ │ ├── 0021_incomplete_param.rs │ │ ├── 0022_bad_exprs.rast │ │ ├── 0022_bad_exprs.rs │ │ ├── 0023_mismatched_paren.rast │ │ ├── 0023_mismatched_paren.rs │ │ ├── 0024_many_type_parens.rast │ │ ├── 0024_many_type_parens.rs │ │ ├── 0025_nope.rast │ │ ├── 0025_nope.rs │ │ ├── 0026_imp_recovery.rast │ │ ├── 0026_imp_recovery.rs │ │ ├── 0027_incomplete_where_for.rast │ │ ├── 0027_incomplete_where_for.rs │ │ ├── 0029_field_completion.rast │ │ ├── 0029_field_completion.rs │ │ ├── 0032_match_arms_inner_attrs.rast │ │ ├── 0032_match_arms_inner_attrs.rs │ │ ├── 0033_match_arms_outer_attrs.rast │ │ ├── 0033_match_arms_outer_attrs.rs │ │ ├── 0034_bad_box_pattern.rast │ │ ├── 0034_bad_box_pattern.rs │ │ ├── 0035_use_recover.rast │ │ ├── 0035_use_recover.rs │ │ ├── 0036_partial_use.rast │ │ ├── 0036_partial_use.rs │ │ ├── 0039_lambda_recovery.rast │ │ ├── 0039_lambda_recovery.rs │ │ ├── 0042_weird_blocks.rast │ │ ├── 0042_weird_blocks.rs │ │ ├── 0043_unexpected_for_type.rast │ │ ├── 0043_unexpected_for_type.rs │ │ ├── 0044_item_modifiers.rast │ │ ├── 0044_item_modifiers.rs │ │ ├── 0047_repeated_extern_modifier.rast │ │ ├── 0047_repeated_extern_modifier.rs │ │ ├── 0048_double_fish.rast │ │ ├── 0048_double_fish.rs │ │ ├── 0049_let_else_right_curly_brace_for.rast │ │ ├── 0049_let_else_right_curly_brace_for.rs │ │ ├── 0050_let_else_right_curly_brace_loop.rast │ │ ├── 0050_let_else_right_curly_brace_loop.rs │ │ ├── 0051_let_else_right_curly_brace_match.rast │ │ ├── 0051_let_else_right_curly_brace_match.rs │ │ ├── 0052_let_else_right_curly_brace_while.rast │ │ ├── 0052_let_else_right_curly_brace_while.rs │ │ ├── 0053_let_else_right_curly_brace_if.rast │ │ ├── 0053_let_else_right_curly_brace_if.rs │ │ ├── 0054_float_split_scientific_notation.rast │ │ ├── 0054_float_split_scientific_notation.rs │ │ ├── 0055_impl_use.rast │ │ ├── 0055_impl_use.rs │ │ ├── 0056_let_else_right_curly_brace_struct.rast │ │ ├── 0056_let_else_right_curly_brace_struct.rs │ │ ├── 0057_let_else_right_curly_brace_arithmetic.rast │ │ ├── 0057_let_else_right_curly_brace_arithmetic.rs │ │ ├── 0057_let_else_right_curly_brace_format_args.rast │ │ ├── 0057_let_else_right_curly_brace_format_args.rs │ │ ├── 0058_let_else_right_curly_brace_range.rast │ │ ├── 0058_let_else_right_curly_brace_range.rs │ │ ├── 0059_let_else_right_curly_brace_closure.rast │ │ ├── 0059_let_else_right_curly_brace_closure.rs │ │ ├── 0060_let_else_right_curly_brace_unary.rast │ │ ├── 0060_let_else_right_curly_brace_unary.rs │ │ ├── 0061_let_else_right_curly_brace_do_yeet.rast │ │ ├── 0061_let_else_right_curly_brace_do_yeet.rs │ │ ├── 0062_let_else_right_curly_brace_become.rast │ │ ├── 0062_let_else_right_curly_brace_become.rs │ │ ├── 0063_let_else_right_curly_brace_reference.rast │ │ ├── 0063_let_else_right_curly_brace_reference.rs │ │ ├── 0064_let_else_right_curly_brace_assignment.rast │ │ └── 0064_let_else_right_curly_brace_assignment.rs │ │ ├── inline │ │ ├── err │ │ │ ├── angled_path_without_qual.rast │ │ │ ├── angled_path_without_qual.rs │ │ │ ├── anonymous_static.rast │ │ │ ├── anonymous_static.rs │ │ │ ├── arg_list_recovery.rast │ │ │ ├── arg_list_recovery.rs │ │ │ ├── array_type_missing_semi.rast │ │ │ ├── array_type_missing_semi.rs │ │ │ ├── async_without_semicolon.rast │ │ │ ├── async_without_semicolon.rs │ │ │ ├── bad_asm_expr.rast │ │ │ ├── bad_asm_expr.rs │ │ │ ├── comma_after_default_values_syntax.rast │ │ │ ├── comma_after_default_values_syntax.rs │ │ │ ├── comma_after_functional_update_syntax.rast │ │ │ ├── comma_after_functional_update_syntax.rs │ │ │ ├── crate_visibility_empty_recover.rast │ │ │ ├── crate_visibility_empty_recover.rs │ │ │ ├── empty_param_slot.rast │ │ │ ├── empty_param_slot.rs │ │ │ ├── empty_segment.rast │ │ │ ├── empty_segment.rs │ │ │ ├── fn_pointer_type_missing_fn.rast │ │ │ ├── fn_pointer_type_missing_fn.rs │ │ │ ├── gen_fn.rast │ │ │ ├── gen_fn.rs │ │ │ ├── generic_arg_list_recover.rast │ │ │ ├── generic_arg_list_recover.rs │ │ │ ├── generic_arg_list_recover_expr.rast │ │ │ ├── generic_arg_list_recover_expr.rs │ │ │ ├── generic_param_list_recover.rast │ │ │ ├── generic_param_list_recover.rs │ │ │ ├── generic_static.rast │ │ │ ├── generic_static.rs │ │ │ ├── impl_type.rast │ │ │ ├── impl_type.rs │ │ │ ├── let_else_right_curly_brace.rast │ │ │ ├── let_else_right_curly_brace.rs │ │ │ ├── macro_rules_as_macro_name.rast │ │ │ ├── macro_rules_as_macro_name.rs │ │ │ ├── match_arms_recovery.rast │ │ │ ├── match_arms_recovery.rs │ │ │ ├── meta_recovery.rast │ │ │ ├── meta_recovery.rs │ │ │ ├── method_call_missing_argument_list.rast │ │ │ ├── method_call_missing_argument_list.rs │ │ │ ├── misplaced_label_err.rast │ │ │ ├── misplaced_label_err.rs │ │ │ ├── missing_fn_param_type.rast │ │ │ ├── missing_fn_param_type.rs │ │ │ ├── path_item_without_excl.rast │ │ │ ├── path_item_without_excl.rs │ │ │ ├── pointer_type_no_mutability.rast │ │ │ ├── pointer_type_no_mutability.rs │ │ │ ├── precise_capturing_invalid.rast │ │ │ ├── precise_capturing_invalid.rs │ │ │ ├── pub_expr.rast │ │ │ ├── pub_expr.rs │ │ │ ├── record_literal_before_ellipsis_recovery.rast │ │ │ ├── record_literal_before_ellipsis_recovery.rs │ │ │ ├── record_literal_field_eq_recovery.rast │ │ │ ├── record_literal_field_eq_recovery.rs │ │ │ ├── record_literal_missing_ellipsis_recovery.rast │ │ │ ├── record_literal_missing_ellipsis_recovery.rs │ │ │ ├── record_pat_field_eq_recovery.rast │ │ │ ├── record_pat_field_eq_recovery.rs │ │ │ ├── recover_from_missing_assoc_item_binding.rast │ │ │ ├── recover_from_missing_assoc_item_binding.rs │ │ │ ├── recover_from_missing_const_default.rast │ │ │ ├── recover_from_missing_const_default.rs │ │ │ ├── static_where_clause.rast │ │ │ ├── static_where_clause.rs │ │ │ ├── struct_field_recover.rast │ │ │ ├── struct_field_recover.rs │ │ │ ├── top_level_let.rast │ │ │ ├── top_level_let.rs │ │ │ ├── tuple_expr_leading_comma.rast │ │ │ ├── tuple_expr_leading_comma.rs │ │ │ ├── tuple_field_list_recovery.rast │ │ │ ├── tuple_field_list_recovery.rs │ │ │ ├── tuple_pat_leading_comma.rast │ │ │ ├── tuple_pat_leading_comma.rs │ │ │ ├── type_in_array_recover.rast │ │ │ ├── type_in_array_recover.rs │ │ │ ├── unsafe_block_in_mod.rast │ │ │ ├── unsafe_block_in_mod.rs │ │ │ ├── use_tree_list_err_recovery.rast │ │ │ └── use_tree_list_err_recovery.rs │ │ └── ok │ │ │ ├── anonymous_const.rast │ │ │ ├── anonymous_const.rs │ │ │ ├── arb_self_types.rast │ │ │ ├── arb_self_types.rs │ │ │ ├── arg_with_attr.rast │ │ │ ├── arg_with_attr.rs │ │ │ ├── array_attrs.rast │ │ │ ├── array_attrs.rs │ │ │ ├── array_expr.rast │ │ │ ├── array_expr.rs │ │ │ ├── array_type.rast │ │ │ ├── array_type.rs │ │ │ ├── as_precedence.rast │ │ │ ├── as_precedence.rs │ │ │ ├── asm_expr.rast │ │ │ ├── asm_expr.rs │ │ │ ├── asm_label.rast │ │ │ ├── asm_label.rs │ │ │ ├── assoc_const_eq.rast │ │ │ ├── assoc_const_eq.rs │ │ │ ├── assoc_item_list.rast │ │ │ ├── assoc_item_list.rs │ │ │ ├── assoc_item_list_inner_attrs.rast │ │ │ ├── assoc_item_list_inner_attrs.rs │ │ │ ├── assoc_type_bound.rast │ │ │ ├── assoc_type_bound.rs │ │ │ ├── assoc_type_eq.rast │ │ │ ├── assoc_type_eq.rs │ │ │ ├── associated_return_type_bounds.rast │ │ │ ├── async_trait_bound.rast │ │ │ ├── async_trait_bound.rs │ │ │ ├── attr_on_expr_stmt.rast │ │ │ ├── attr_on_expr_stmt.rs │ │ │ ├── await_expr.rast │ │ │ ├── await_expr.rs │ │ │ ├── bare_dyn_types_with_leading_lifetime.rast │ │ │ ├── bare_dyn_types_with_leading_lifetime.rs │ │ │ ├── become_expr.rast │ │ │ ├── become_expr.rs │ │ │ ├── bind_pat.rast │ │ │ ├── bind_pat.rs │ │ │ ├── binop_resets_statementness.rast │ │ │ ├── binop_resets_statementness.rs │ │ │ ├── block.rast │ │ │ ├── block.rs │ │ │ ├── block_items.rast │ │ │ ├── block_items.rs │ │ │ ├── box_pat.rast │ │ │ ├── box_pat.rs │ │ │ ├── break_ambiguity.rast │ │ │ ├── break_ambiguity.rs │ │ │ ├── break_expr.rast │ │ │ ├── break_expr.rs │ │ │ ├── builtin_expr.rast │ │ │ ├── builtin_expr.rs │ │ │ ├── call_expr.rast │ │ │ ├── call_expr.rs │ │ │ ├── cast_expr.rast │ │ │ ├── cast_expr.rs │ │ │ ├── closure_binder.rast │ │ │ ├── closure_binder.rs │ │ │ ├── closure_body_underscore_assignment.rast │ │ │ ├── closure_body_underscore_assignment.rs │ │ │ ├── closure_params.rast │ │ │ ├── closure_params.rs │ │ │ ├── closure_range_method_call.rast │ │ │ ├── closure_range_method_call.rs │ │ │ ├── const_arg.rast │ │ │ ├── const_arg.rs │ │ │ ├── const_arg_block.rast │ │ │ ├── const_arg_block.rs │ │ │ ├── const_arg_bool_literal.rast │ │ │ ├── const_arg_bool_literal.rs │ │ │ ├── const_arg_literal.rast │ │ │ ├── const_arg_literal.rs │ │ │ ├── const_arg_negative_number.rast │ │ │ ├── const_arg_negative_number.rs │ │ │ ├── const_block_pat.rast │ │ │ ├── const_block_pat.rs │ │ │ ├── const_closure.rast │ │ │ ├── const_closure.rs │ │ │ ├── const_item.rast │ │ │ ├── const_item.rs │ │ │ ├── const_param.rast │ │ │ ├── const_param.rs │ │ │ ├── const_param_default_expression.rast │ │ │ ├── const_param_default_expression.rs │ │ │ ├── const_param_default_literal.rast │ │ │ ├── const_param_default_literal.rs │ │ │ ├── const_param_default_path.rast │ │ │ ├── const_param_default_path.rs │ │ │ ├── const_trait_bound.rast │ │ │ ├── const_trait_bound.rs │ │ │ ├── const_where_clause.rast │ │ │ ├── const_where_clause.rs │ │ │ ├── continue_expr.rast │ │ │ ├── continue_expr.rs │ │ │ ├── crate_path.rast │ │ │ ├── crate_path.rs │ │ │ ├── crate_visibility.rast │ │ │ ├── crate_visibility.rs │ │ │ ├── crate_visibility_in.rast │ │ │ ├── crate_visibility_in.rs │ │ │ ├── default_async_fn.rast │ │ │ ├── default_async_fn.rs │ │ │ ├── default_async_unsafe_fn.rast │ │ │ ├── default_async_unsafe_fn.rs │ │ │ ├── default_item.rast │ │ │ ├── default_item.rs │ │ │ ├── default_unsafe_item.rast │ │ │ ├── default_unsafe_item.rs │ │ │ ├── destructuring_assignment_struct_rest_pattern.rast │ │ │ ├── destructuring_assignment_struct_rest_pattern.rs │ │ │ ├── destructuring_assignment_wildcard_pat.rast │ │ │ ├── destructuring_assignment_wildcard_pat.rs │ │ │ ├── dot_dot_pat.rast │ │ │ ├── dot_dot_pat.rs │ │ │ ├── dyn_trait_type.rast │ │ │ ├── dyn_trait_type.rs │ │ │ ├── dyn_trait_type_weak.rast │ │ │ ├── dyn_trait_type_weak.rs │ │ │ ├── edition_2015_dyn_prefix_inside_generic_arg.rast │ │ │ ├── edition_2015_dyn_prefix_inside_generic_arg.rs │ │ │ ├── effect_blocks.rast │ │ │ ├── effect_blocks.rs │ │ │ ├── exclusive_range_pat.rast │ │ │ ├── exclusive_range_pat.rs │ │ │ ├── expr_literals.rast │ │ │ ├── expr_literals.rs │ │ │ ├── expression_after_block.rast │ │ │ ├── expression_after_block.rs │ │ │ ├── extern_block.rast │ │ │ ├── extern_block.rs │ │ │ ├── extern_crate.rast │ │ │ ├── extern_crate.rs │ │ │ ├── extern_crate_rename.rast │ │ │ ├── extern_crate_rename.rs │ │ │ ├── field_expr.rast │ │ │ ├── field_expr.rs │ │ │ ├── fn_.rast │ │ │ ├── fn_.rs │ │ │ ├── fn_decl.rast │ │ │ ├── fn_decl.rs │ │ │ ├── fn_def_param.rast │ │ │ ├── fn_def_param.rs │ │ │ ├── fn_pointer_param_ident_path.rast │ │ │ ├── fn_pointer_param_ident_path.rs │ │ │ ├── fn_pointer_type.rast │ │ │ ├── fn_pointer_type.rs │ │ │ ├── fn_pointer_type_with_ret.rast │ │ │ ├── fn_pointer_type_with_ret.rs │ │ │ ├── fn_pointer_unnamed_arg.rast │ │ │ ├── fn_pointer_unnamed_arg.rs │ │ │ ├── for_expr.rast │ │ │ ├── for_expr.rs │ │ │ ├── for_range_from.rast │ │ │ ├── for_range_from.rs │ │ │ ├── for_type.rast │ │ │ ├── for_type.rs │ │ │ ├── full_range_expr.rast │ │ │ ├── full_range_expr.rs │ │ │ ├── function_ret_type.rast │ │ │ ├── function_ret_type.rs │ │ │ ├── function_type_params.rast │ │ │ ├── function_type_params.rs │ │ │ ├── function_where_clause.rast │ │ │ ├── function_where_clause.rs │ │ │ ├── gen_blocks.rast │ │ │ ├── gen_blocks.rs │ │ │ ├── generic_arg.rast │ │ │ ├── generic_arg.rs │ │ │ ├── generic_arg_bounds.rast │ │ │ ├── generic_arg_bounds.rs │ │ │ ├── generic_const.rast │ │ │ ├── generic_const.rs │ │ │ ├── generic_param_attribute.rast │ │ │ ├── generic_param_attribute.rs │ │ │ ├── generic_param_list.rast │ │ │ ├── generic_param_list.rs │ │ │ ├── half_open_range_pat.rast │ │ │ ├── half_open_range_pat.rs │ │ │ ├── if_expr.rast │ │ │ ├── if_expr.rs │ │ │ ├── impl_item.rast │ │ │ ├── impl_item.rs │ │ │ ├── impl_item_const.rast │ │ │ ├── impl_item_const.rs │ │ │ ├── impl_item_neg.rast │ │ │ ├── impl_item_neg.rs │ │ │ ├── impl_trait_type.rast │ │ │ ├── impl_trait_type.rs │ │ │ ├── impl_type_params.rast │ │ │ ├── impl_type_params.rs │ │ │ ├── index_expr.rast │ │ │ ├── index_expr.rs │ │ │ ├── label.rast │ │ │ ├── label.rs │ │ │ ├── labeled_block.rast │ │ │ ├── labeled_block.rs │ │ │ ├── lambda_expr.rast │ │ │ ├── lambda_expr.rs │ │ │ ├── lambda_ret_block.rast │ │ │ ├── lambda_ret_block.rs │ │ │ ├── let_else.rast │ │ │ ├── let_else.rs │ │ │ ├── let_expr.rast │ │ │ ├── let_expr.rs │ │ │ ├── let_stmt.rast │ │ │ ├── let_stmt.rs │ │ │ ├── let_stmt_ascription.rast │ │ │ ├── let_stmt_ascription.rs │ │ │ ├── let_stmt_init.rast │ │ │ ├── let_stmt_init.rs │ │ │ ├── lifetime_arg.rast │ │ │ ├── lifetime_arg.rs │ │ │ ├── lifetime_param.rast │ │ │ ├── lifetime_param.rs │ │ │ ├── literal_pattern.rast │ │ │ ├── literal_pattern.rs │ │ │ ├── loop_expr.rast │ │ │ ├── loop_expr.rs │ │ │ ├── macro_call_type.rast │ │ │ ├── macro_call_type.rs │ │ │ ├── macro_def.rast │ │ │ ├── macro_def.rs │ │ │ ├── macro_def_curly.rast │ │ │ ├── macro_def_curly.rs │ │ │ ├── macro_inside_generic_arg.rast │ │ │ ├── macro_inside_generic_arg.rs │ │ │ ├── macro_rules_as_macro_name.rast │ │ │ ├── macro_rules_as_macro_name.rs │ │ │ ├── macro_rules_non_brace.rast │ │ │ ├── macro_rules_non_brace.rs │ │ │ ├── marco_pat.rast │ │ │ ├── marco_pat.rs │ │ │ ├── match_arm.rast │ │ │ ├── match_arm.rs │ │ │ ├── match_arms_commas.rast │ │ │ ├── match_arms_commas.rs │ │ │ ├── match_arms_inner_attribute.rast │ │ │ ├── match_arms_inner_attribute.rs │ │ │ ├── match_arms_outer_attributes.rast │ │ │ ├── match_arms_outer_attributes.rs │ │ │ ├── match_expr.rast │ │ │ ├── match_expr.rs │ │ │ ├── match_guard.rast │ │ │ ├── match_guard.rs │ │ │ ├── metas.rast │ │ │ ├── metas.rs │ │ │ ├── method_call_expr.rast │ │ │ ├── method_call_expr.rs │ │ │ ├── mod_contents.rast │ │ │ ├── mod_contents.rs │ │ │ ├── mod_item.rast │ │ │ ├── mod_item.rs │ │ │ ├── mod_item_curly.rast │ │ │ ├── mod_item_curly.rs │ │ │ ├── never_type.rast │ │ │ ├── never_type.rs │ │ │ ├── no_dyn_trait_leading_for.rast │ │ │ ├── no_dyn_trait_leading_for.rs │ │ │ ├── no_semi_after_block.rast │ │ │ ├── no_semi_after_block.rs │ │ │ ├── nocontentexpr.rast │ │ │ ├── nocontentexpr.rs │ │ │ ├── nocontentexpr_after_item.rast │ │ │ ├── nocontentexpr_after_item.rs │ │ │ ├── offset_of_parens.rast │ │ │ ├── offset_of_parens.rs │ │ │ ├── or_pattern.rast │ │ │ ├── or_pattern.rs │ │ │ ├── param_list.rast │ │ │ ├── param_list.rs │ │ │ ├── param_list_vararg.rast │ │ │ ├── param_list_vararg.rs │ │ │ ├── param_outer_arg.rast │ │ │ ├── param_outer_arg.rs │ │ │ ├── paren_type.rast │ │ │ ├── paren_type.rs │ │ │ ├── path_expr.rast │ │ │ ├── path_expr.rs │ │ │ ├── path_fn_trait_args.rast │ │ │ ├── path_fn_trait_args.rs │ │ │ ├── path_part.rast │ │ │ ├── path_part.rs │ │ │ ├── path_type.rast │ │ │ ├── path_type.rs │ │ │ ├── path_type_with_bounds.rast │ │ │ ├── path_type_with_bounds.rs │ │ │ ├── placeholder_pat.rast │ │ │ ├── placeholder_pat.rs │ │ │ ├── placeholder_type.rast │ │ │ ├── placeholder_type.rs │ │ │ ├── pointer_type_mut.rast │ │ │ ├── pointer_type_mut.rs │ │ │ ├── postfix_range.rast │ │ │ ├── postfix_range.rs │ │ │ ├── precise_capturing.rast │ │ │ ├── precise_capturing.rs │ │ │ ├── pub_parens_typepath.rast │ │ │ ├── pub_parens_typepath.rs │ │ │ ├── pub_tuple_field.rast │ │ │ ├── pub_tuple_field.rs │ │ │ ├── qual_paths.rast │ │ │ ├── qual_paths.rs │ │ │ ├── question_for_type_trait_bound.rast │ │ │ ├── question_for_type_trait_bound.rs │ │ │ ├── range_pat.rast │ │ │ ├── range_pat.rs │ │ │ ├── record_field_attrs.rast │ │ │ ├── record_field_attrs.rs │ │ │ ├── record_field_default_values.rast │ │ │ ├── record_field_default_values.rs │ │ │ ├── record_field_list.rast │ │ │ ├── record_field_list.rs │ │ │ ├── record_field_pat_leading_or.rast │ │ │ ├── record_field_pat_leading_or.rs │ │ │ ├── record_lit.rast │ │ │ ├── record_lit.rs │ │ │ ├── record_literal_field_with_attr.rast │ │ │ ├── record_literal_field_with_attr.rs │ │ │ ├── record_pat_field.rast │ │ │ ├── record_pat_field.rs │ │ │ ├── record_pat_field_list.rast │ │ │ ├── record_pat_field_list.rs │ │ │ ├── ref_expr.rast │ │ │ ├── ref_expr.rs │ │ │ ├── ref_pat.rast │ │ │ ├── ref_pat.rs │ │ │ ├── reference_type.rast │ │ │ ├── reference_type.rs │ │ │ ├── return_expr.rast │ │ │ ├── return_expr.rs │ │ │ ├── return_type_syntax_in_path.rast │ │ │ ├── return_type_syntax_in_path.rs │ │ │ ├── safe_outside_of_extern.rast │ │ │ ├── safe_outside_of_extern.rs │ │ │ ├── self_param.rast │ │ │ ├── self_param.rs │ │ │ ├── self_param_outer_attr.rast │ │ │ ├── self_param_outer_attr.rs │ │ │ ├── singleton_tuple_type.rast │ │ │ ├── singleton_tuple_type.rs │ │ │ ├── slice_pat.rast │ │ │ ├── slice_pat.rs │ │ │ ├── slice_type.rast │ │ │ ├── slice_type.rs │ │ │ ├── stmt_bin_expr_ambiguity.rast │ │ │ ├── stmt_bin_expr_ambiguity.rs │ │ │ ├── stmt_postfix_expr_ambiguity.rast │ │ │ ├── stmt_postfix_expr_ambiguity.rs │ │ │ ├── struct_initializer_with_defaults.rast │ │ │ ├── struct_initializer_with_defaults.rs │ │ │ ├── struct_item.rast │ │ │ ├── struct_item.rs │ │ │ ├── trait_alias.rast │ │ │ ├── trait_alias.rs │ │ │ ├── trait_alias_where_clause.rast │ │ │ ├── trait_alias_where_clause.rs │ │ │ ├── trait_item.rast │ │ │ ├── trait_item.rs │ │ │ ├── trait_item_bounds.rast │ │ │ ├── trait_item_bounds.rs │ │ │ ├── trait_item_generic_params.rast │ │ │ ├── trait_item_generic_params.rs │ │ │ ├── trait_item_where_clause.rast │ │ │ ├── trait_item_where_clause.rs │ │ │ ├── try_block_expr.rast │ │ │ ├── try_block_expr.rs │ │ │ ├── try_expr.rast │ │ │ ├── try_expr.rs │ │ │ ├── try_macro_fallback.rast │ │ │ ├── try_macro_fallback.rs │ │ │ ├── try_macro_rules.rast │ │ │ ├── try_macro_rules.rs │ │ │ ├── tuple_attrs.rast │ │ │ ├── tuple_attrs.rs │ │ │ ├── tuple_expr.rast │ │ │ ├── tuple_expr.rs │ │ │ ├── tuple_field_attrs.rast │ │ │ ├── tuple_field_attrs.rs │ │ │ ├── tuple_pat.rast │ │ │ ├── tuple_pat.rs │ │ │ ├── tuple_pat_fields.rast │ │ │ ├── tuple_pat_fields.rs │ │ │ ├── tuple_struct.rast │ │ │ ├── tuple_struct.rs │ │ │ ├── tuple_struct_where.rast │ │ │ ├── tuple_struct_where.rs │ │ │ ├── type_alias.rast │ │ │ ├── type_alias.rs │ │ │ ├── type_item_type_params.rast │ │ │ ├── type_item_type_params.rs │ │ │ ├── type_item_where_clause.rast │ │ │ ├── type_item_where_clause.rs │ │ │ ├── type_item_where_clause_deprecated.rast │ │ │ ├── type_item_where_clause_deprecated.rs │ │ │ ├── type_param.rast │ │ │ ├── type_param.rs │ │ │ ├── type_param_bounds.rast │ │ │ ├── type_param_bounds.rs │ │ │ ├── type_param_default.rast │ │ │ ├── type_param_default.rs │ │ │ ├── type_path_in_pattern.rast │ │ │ ├── type_path_in_pattern.rs │ │ │ ├── typepathfn_with_coloncolon.rast │ │ │ ├── typepathfn_with_coloncolon.rs │ │ │ ├── unary_expr.rast │ │ │ ├── unary_expr.rs │ │ │ ├── union_item.rast │ │ │ ├── union_item.rs │ │ │ ├── unit_struct.rast │ │ │ ├── unit_struct.rs │ │ │ ├── unit_type.rast │ │ │ ├── unit_type.rs │ │ │ ├── use_item.rast │ │ │ ├── use_item.rs │ │ │ ├── use_tree.rast │ │ │ ├── use_tree.rs │ │ │ ├── use_tree_abs_star.rast │ │ │ ├── use_tree_abs_star.rs │ │ │ ├── use_tree_alias.rast │ │ │ ├── use_tree_alias.rs │ │ │ ├── use_tree_list.rast │ │ │ ├── use_tree_list.rs │ │ │ ├── use_tree_path.rast │ │ │ ├── use_tree_path.rs │ │ │ ├── use_tree_path_star.rast │ │ │ ├── use_tree_path_star.rs │ │ │ ├── use_tree_path_use_tree.rast │ │ │ ├── use_tree_path_use_tree.rs │ │ │ ├── use_tree_star.rast │ │ │ ├── use_tree_star.rs │ │ │ ├── variant_discriminant.rast │ │ │ ├── variant_discriminant.rs │ │ │ ├── where_clause.rast │ │ │ ├── where_clause.rs │ │ │ ├── where_pred_for.rast │ │ │ ├── where_pred_for.rs │ │ │ ├── while_expr.rast │ │ │ ├── while_expr.rs │ │ │ ├── yeet_expr.rast │ │ │ ├── yeet_expr.rs │ │ │ ├── yield_expr.rast │ │ │ └── yield_expr.rs │ │ └── ok │ │ ├── 0000_empty.rast │ │ ├── 0000_empty.rs │ │ ├── 0001_struct_item.rast │ │ ├── 0001_struct_item.rs │ │ ├── 0002_struct_item_field.rast │ │ ├── 0002_struct_item_field.rs │ │ ├── 0004_file_shebang.rast │ │ ├── 0004_file_shebang.rs │ │ ├── 0005_fn_item.rast │ │ ├── 0005_fn_item.rs │ │ ├── 0006_inner_attributes.rast │ │ ├── 0006_inner_attributes.rs │ │ ├── 0007_extern_crate.rast │ │ ├── 0007_extern_crate.rs │ │ ├── 0008_mod_item.rast │ │ ├── 0008_mod_item.rs │ │ ├── 0009_use_item.rast │ │ ├── 0009_use_item.rs │ │ ├── 0010_use_path_segments.rast │ │ ├── 0010_use_path_segments.rs │ │ ├── 0011_outer_attribute.rast │ │ ├── 0011_outer_attribute.rs │ │ ├── 0012_visibility.rast │ │ ├── 0012_visibility.rs │ │ ├── 0013_use_path_self_super.rast │ │ ├── 0013_use_path_self_super.rs │ │ ├── 0014_use_tree.rast │ │ ├── 0014_use_tree.rs │ │ ├── 0015_use_tree.rast │ │ ├── 0015_use_tree.rs │ │ ├── 0016_struct_flavors.rast │ │ ├── 0016_struct_flavors.rs │ │ ├── 0017_attr_trailing_comma.rast │ │ ├── 0017_attr_trailing_comma.rs │ │ ├── 0018_struct_type_params.rast │ │ ├── 0018_struct_type_params.rs │ │ ├── 0019_enums.rast │ │ ├── 0019_enums.rs │ │ ├── 0020_type_param_bounds.rast │ │ ├── 0020_type_param_bounds.rs │ │ ├── 0022_empty_extern_block.rast │ │ ├── 0022_empty_extern_block.rs │ │ ├── 0023_static_items.rast │ │ ├── 0023_static_items.rs │ │ ├── 0024_const_item.rast │ │ ├── 0024_const_item.rs │ │ ├── 0025_extern_fn_in_block.rast │ │ ├── 0025_extern_fn_in_block.rs │ │ ├── 0026_const_fn_in_block.rast │ │ ├── 0026_const_fn_in_block.rs │ │ ├── 0027_unsafe_fn_in_block.rast │ │ ├── 0027_unsafe_fn_in_block.rs │ │ ├── 0028_operator_binding_power.rast │ │ ├── 0028_operator_binding_power.rs │ │ ├── 0029_range_forms.rast │ │ ├── 0029_range_forms.rs │ │ ├── 0030_string_suffixes.rast │ │ ├── 0030_string_suffixes.rs │ │ ├── 0030_traits.rast │ │ ├── 0030_traits.rs │ │ ├── 0031_extern.rast │ │ ├── 0031_extern.rs │ │ ├── 0032_where_for.rast │ │ ├── 0032_where_for.rs │ │ ├── 0033_label_break.rast │ │ ├── 0033_label_break.rs │ │ ├── 0034_crate_path_in_call.rast │ │ ├── 0034_crate_path_in_call.rs │ │ ├── 0035_weird_exprs.rast │ │ ├── 0035_weird_exprs.rs │ │ ├── 0036_fully_qualified.rast │ │ ├── 0036_fully_qualified.rs │ │ ├── 0037_mod.rast │ │ ├── 0037_mod.rs │ │ ├── 0038_where_pred_type.rast │ │ ├── 0038_where_pred_type.rs │ │ ├── 0039_raw_fn_item.rast │ │ ├── 0039_raw_fn_item.rs │ │ ├── 0040_raw_struct_item_field.rast │ │ ├── 0040_raw_struct_item_field.rs │ │ ├── 0041_raw_keywords.rast │ │ ├── 0041_raw_keywords.rs │ │ ├── 0042_ufcs_call_list.rast │ │ ├── 0042_ufcs_call_list.rs │ │ ├── 0043_complex_assignment.rast │ │ ├── 0043_complex_assignment.rs │ │ ├── 0044_let_attrs.rast │ │ ├── 0044_let_attrs.rs │ │ ├── 0045_block_attrs.rast │ │ ├── 0045_block_attrs.rs │ │ ├── 0046_extern_inner_attributes.rast │ │ ├── 0046_extern_inner_attributes.rs │ │ ├── 0047_minus_in_inner_pattern.rast │ │ ├── 0047_minus_in_inner_pattern.rs │ │ ├── 0048_compound_assignment.rast │ │ ├── 0048_compound_assignment.rs │ │ ├── 0049_async_block.rast │ │ ├── 0049_async_block.rs │ │ ├── 0050_async_block_as_argument.rast │ │ ├── 0050_async_block_as_argument.rs │ │ ├── 0051_parameter_attrs.rast │ │ ├── 0051_parameter_attrs.rs │ │ ├── 0052_for_range_block.rast │ │ ├── 0052_for_range_block.rs │ │ ├── 0053_outer_attribute_on_macro_rules.rast │ │ ├── 0053_outer_attribute_on_macro_rules.rs │ │ ├── 0054_qual_path_in_type_arg.rast │ │ ├── 0054_qual_path_in_type_arg.rs │ │ ├── 0055_dot_dot_dot.rast │ │ ├── 0055_dot_dot_dot.rs │ │ ├── 0056_neq_in_type.rast │ │ ├── 0056_neq_in_type.rs │ │ ├── 0057_loop_in_call.rast │ │ ├── 0057_loop_in_call.rs │ │ ├── 0058_unary_expr_precedence.rast │ │ ├── 0058_unary_expr_precedence.rs │ │ ├── 0059_loops_in_parens.rast │ │ ├── 0059_loops_in_parens.rs │ │ ├── 0060_as_range.rast │ │ ├── 0060_as_range.rs │ │ ├── 0061_match_full_range.rast │ │ ├── 0061_match_full_range.rs │ │ ├── 0062_macro_2.0.rast │ │ ├── 0062_macro_2.0.rs │ │ ├── 0063_trait_fn_patterns.rast │ │ ├── 0063_trait_fn_patterns.rs │ │ ├── 0063_variadic_fun.rast │ │ ├── 0063_variadic_fun.rs │ │ ├── 0064_impl_fn_params.rast │ │ ├── 0064_impl_fn_params.rs │ │ ├── 0065_comment_newline.rast │ │ ├── 0065_comment_newline.rs │ │ ├── 0065_plus_after_fn_trait_bound.rast │ │ ├── 0065_plus_after_fn_trait_bound.rs │ │ ├── 0066_default_modifier.rast │ │ ├── 0066_default_modifier.rs │ │ ├── 0067_where_for_pred.rast │ │ ├── 0067_where_for_pred.rs │ │ ├── 0068_item_modifiers.rast │ │ ├── 0068_item_modifiers.rs │ │ ├── 0069_multi_trait_object.rast │ │ ├── 0069_multi_trait_object.rs │ │ ├── 0070_expr_attr_placement.rast │ │ ├── 0070_expr_attr_placement.rs │ │ ├── 0071_stmt_attr_placement.rast │ │ ├── 0071_stmt_attr_placement.rs │ │ ├── 0072_destructuring_assignment.rast │ │ ├── 0072_destructuring_assignment.rs │ │ ├── 0073_safe_declarations_in_extern_blocks.rast │ │ └── 0073_safe_declarations_in_extern_blocks.rs ├── paths │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── proc-macro-api │ ├── Cargo.toml │ └── src │ │ ├── legacy_protocol │ │ ├── json.rs │ │ ├── msg.rs │ │ └── msg │ │ │ └── flat.rs │ │ ├── lib.rs │ │ └── process.rs ├── proc-macro-srv-cli │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ ├── main.rs │ │ └── main_loop.rs ├── proc-macro-srv │ ├── Cargo.toml │ ├── build.rs │ ├── proc-macro-test │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── imp │ │ │ ├── .gitignore │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── dylib.rs │ │ ├── dylib │ │ └── version.rs │ │ ├── lib.rs │ │ ├── proc_macros.rs │ │ ├── server_impl.rs │ │ ├── server_impl │ │ ├── rust_analyzer_span.rs │ │ ├── token_id.rs │ │ └── token_stream.rs │ │ └── tests │ │ ├── mod.rs │ │ └── utils.rs ├── profile │ ├── Cargo.toml │ └── src │ │ ├── google_cpu_profiler.rs │ │ ├── lib.rs │ │ ├── memory_usage.rs │ │ └── stop_watch.rs ├── project-model │ ├── Cargo.toml │ ├── src │ │ ├── build_dependencies.rs │ │ ├── cargo_workspace.rs │ │ ├── env.rs │ │ ├── lib.rs │ │ ├── manifest_path.rs │ │ ├── project_json.rs │ │ ├── sysroot.rs │ │ ├── tests.rs │ │ ├── toolchain_info │ │ │ ├── rustc_cfg.rs │ │ │ ├── target_data_layout.rs │ │ │ ├── target_tuple.rs │ │ │ └── version.rs │ │ └── workspace.rs │ └── test_data │ │ ├── cfg-groups.json │ │ ├── hello-world-metadata.json │ │ ├── hello-world-project.json │ │ ├── output │ │ ├── cargo_hello_world_project_model.txt │ │ ├── cargo_hello_world_project_model_with_selective_overrides.txt │ │ ├── cargo_hello_world_project_model_with_wildcard_overrides.txt │ │ ├── rust_project_cfg_groups.txt │ │ └── rust_project_hello_world_project_model.txt │ │ ├── regex-metadata.json │ │ └── ripgrep-metadata.json ├── query-group-macro │ ├── Cargo.toml │ ├── src │ │ ├── lib.rs │ │ └── queries.rs │ └── tests │ │ ├── arity.rs │ │ ├── hello_world.rs │ │ ├── interned.rs │ │ ├── logger_db.rs │ │ ├── lru.rs │ │ ├── multiple_dbs.rs │ │ ├── old_and_new.rs │ │ ├── result.rs │ │ ├── supertrait.rs │ │ └── tuples.rs ├── rust-analyzer │ ├── Cargo.toml │ ├── build.rs │ ├── src │ │ ├── bin │ │ │ ├── main.rs │ │ │ └── rustc_wrapper.rs │ │ ├── cli.rs │ │ ├── cli │ │ │ ├── analysis_stats.rs │ │ │ ├── diagnostics.rs │ │ │ ├── flags.rs │ │ │ ├── highlight.rs │ │ │ ├── lsif.rs │ │ │ ├── parse.rs │ │ │ ├── prime_caches.rs │ │ │ ├── progress_report.rs │ │ │ ├── run_tests.rs │ │ │ ├── rustc_tests.rs │ │ │ ├── scip.rs │ │ │ ├── ssr.rs │ │ │ ├── symbols.rs │ │ │ └── unresolved_references.rs │ │ ├── command.rs │ │ ├── config.rs │ │ ├── config │ │ │ └── patch_old_style.rs │ │ ├── diagnostics.rs │ │ ├── diagnostics │ │ │ ├── test_data │ │ │ │ ├── clippy_pass_by_ref.txt │ │ │ │ ├── handles_macro_location.txt │ │ │ │ ├── macro_compiler_error.txt │ │ │ │ ├── reasonable_line_numbers_from_empty_file.txt │ │ │ │ ├── rustc_incompatible_type_for_trait.txt │ │ │ │ ├── rustc_mismatched_type.txt │ │ │ │ ├── rustc_range_map_lsp_position.txt │ │ │ │ ├── rustc_unused_variable.txt │ │ │ │ ├── rustc_unused_variable_as_hint.txt │ │ │ │ ├── rustc_unused_variable_as_info.txt │ │ │ │ ├── rustc_wrong_number_of_parameters.txt │ │ │ │ └── snap_multi_line_fix.txt │ │ │ └── to_proto.rs │ │ ├── discover.rs │ │ ├── flycheck.rs │ │ ├── global_state.rs │ │ ├── handlers │ │ │ ├── dispatch.rs │ │ │ ├── notification.rs │ │ │ └── request.rs │ │ ├── integrated_benchmarks.rs │ │ ├── lib.rs │ │ ├── line_index.rs │ │ ├── lsp.rs │ │ ├── lsp │ │ │ ├── capabilities.rs │ │ │ ├── ext.rs │ │ │ ├── from_proto.rs │ │ │ ├── semantic_tokens.rs │ │ │ ├── to_proto.rs │ │ │ └── utils.rs │ │ ├── main_loop.rs │ │ ├── mem_docs.rs │ │ ├── op_queue.rs │ │ ├── reload.rs │ │ ├── target_spec.rs │ │ ├── task_pool.rs │ │ ├── test_runner.rs │ │ ├── tracing │ │ │ ├── config.rs │ │ │ ├── hprof.rs │ │ │ └── json.rs │ │ └── version.rs │ └── tests │ │ └── slow-tests │ │ ├── cli.rs │ │ ├── main.rs │ │ ├── ratoml.rs │ │ ├── support.rs │ │ └── testdir.rs ├── span │ ├── Cargo.toml │ └── src │ │ ├── ast_id.rs │ │ ├── hygiene.rs │ │ ├── lib.rs │ │ └── map.rs ├── stdx │ ├── Cargo.toml │ └── src │ │ ├── anymap.rs │ │ ├── assert.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── non_empty_vec.rs │ │ ├── panic_context.rs │ │ ├── process.rs │ │ ├── rand.rs │ │ ├── thread.rs │ │ └── thread │ │ ├── intent.rs │ │ └── pool.rs ├── syntax-bridge │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── prettify_macro_expansion.rs │ │ ├── tests.rs │ │ └── to_parser_input.rs ├── syntax │ ├── Cargo.toml │ ├── fuzz │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ └── fuzz_targets │ │ │ ├── parser.rs │ │ │ └── reparse.rs │ ├── rust.ungram │ ├── src │ │ ├── algo.rs │ │ ├── ast.rs │ │ ├── ast │ │ │ ├── edit.rs │ │ │ ├── edit_in_place.rs │ │ │ ├── expr_ext.rs │ │ │ ├── generated.rs │ │ │ ├── generated │ │ │ │ ├── nodes.rs │ │ │ │ └── tokens.rs │ │ │ ├── make.rs │ │ │ ├── make │ │ │ │ └── quote.rs │ │ │ ├── node_ext.rs │ │ │ ├── operators.rs │ │ │ ├── prec.rs │ │ │ ├── syntax_factory.rs │ │ │ ├── syntax_factory │ │ │ │ └── constructors.rs │ │ │ ├── token_ext.rs │ │ │ └── traits.rs │ │ ├── fuzz.rs │ │ ├── hacks.rs │ │ ├── lib.rs │ │ ├── parsing.rs │ │ ├── parsing │ │ │ └── reparsing.rs │ │ ├── ptr.rs │ │ ├── syntax_editor.rs │ │ ├── syntax_editor │ │ │ ├── edit_algo.rs │ │ │ ├── edits.rs │ │ │ └── mapping.rs │ │ ├── syntax_error.rs │ │ ├── syntax_node.rs │ │ ├── ted.rs │ │ ├── tests.rs │ │ ├── token_text.rs │ │ ├── utils.rs │ │ ├── validation.rs │ │ └── validation │ │ │ └── block.rs │ └── test_data │ │ ├── parser │ │ ├── fuzz-failures │ │ │ ├── 0000.rs │ │ │ ├── 0001.rs │ │ │ ├── 0002.rs │ │ │ ├── 0003.rs │ │ │ └── 0004.rs │ │ └── validation │ │ │ ├── 0031_block_inner_attrs.rast │ │ │ ├── 0031_block_inner_attrs.rs │ │ │ ├── 0037_visibility_in_traits.rast │ │ │ ├── 0037_visibility_in_traits.rs │ │ │ ├── 0038_endless_inclusive_range.rast │ │ │ ├── 0038_endless_inclusive_range.rs │ │ │ ├── 0040_illegal_crate_kw_location.rast │ │ │ ├── 0040_illegal_crate_kw_location.rs │ │ │ ├── 0041_illegal_self_keyword_location.rast │ │ │ ├── 0041_illegal_self_keyword_location.rs │ │ │ ├── 0045_ambiguous_trait_object.rast │ │ │ ├── 0045_ambiguous_trait_object.rs │ │ │ ├── 0046_mutable_const_item.rast │ │ │ ├── 0046_mutable_const_item.rs │ │ │ ├── 0224_dangling_dyn.rast │ │ │ ├── 0224_dangling_dyn.rs │ │ │ ├── 0261_dangling_impl_undeclared_lifetime.rast │ │ │ ├── 0261_dangling_impl_undeclared_lifetime.rs │ │ │ ├── dangling_impl.rast │ │ │ ├── dangling_impl.rs │ │ │ ├── dangling_impl_reference.rast │ │ │ ├── dangling_impl_reference.rs │ │ │ ├── impl_trait_lifetime_only.rast │ │ │ ├── impl_trait_lifetime_only.rs │ │ │ ├── invalid_let_expr.rast │ │ │ └── invalid_let_expr.rs │ │ └── reparse │ │ └── fuzz-failures │ │ ├── 0000.rs │ │ ├── 0001.rs │ │ ├── 0002.rs │ │ ├── 0003.rs │ │ ├── 0004.rs │ │ └── 0005.rs ├── test-fixture │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── test-utils │ ├── Cargo.toml │ └── src │ │ ├── assert_linear.rs │ │ ├── bench_fixture.rs │ │ ├── fixture.rs │ │ ├── lib.rs │ │ └── minicore.rs ├── toolchain │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── tt │ ├── Cargo.toml │ └── src │ │ ├── buffer.rs │ │ ├── iter.rs │ │ └── lib.rs ├── vfs-notify │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── vfs │ ├── Cargo.toml │ └── src │ ├── anchored_path.rs │ ├── file_set.rs │ ├── file_set │ └── tests.rs │ ├── lib.rs │ ├── loader.rs │ ├── path_interner.rs │ ├── vfs_path.rs │ └── vfs_path │ └── tests.rs ├── docs └── book │ ├── README.md │ ├── book.toml │ └── src │ ├── README.md │ ├── SUMMARY.md │ ├── assists.md │ ├── configuration.md │ ├── configuration_generated.md │ ├── contributing │ ├── README.md │ ├── architecture.md │ ├── debugging.md │ ├── guide.md │ ├── lsp-extensions.md │ ├── setup.md │ ├── style.md │ └── syntax.md │ ├── diagnostics.md │ ├── editor_features.md │ ├── features.md │ ├── installation.md │ ├── non_cargo_based_projects.md │ ├── other_editors.md │ ├── privacy.md │ ├── rust_analyzer_binary.md │ ├── security.md │ ├── troubleshooting.md │ └── vs_code.md ├── editors └── code │ ├── .gitignore │ ├── .prettierignore │ ├── .vscodeignore │ ├── LICENSE │ ├── README.md │ ├── eslint.config.mts │ ├── icon.png │ ├── language-configuration.json │ ├── package-lock.json │ ├── package.json │ ├── prettier.config.mts │ ├── ra_syntax_tree.tmGrammar.json │ ├── src │ ├── bootstrap.ts │ ├── client.ts │ ├── commands.ts │ ├── config.ts │ ├── ctx.ts │ ├── debug.ts │ ├── dependencies_provider.ts │ ├── diagnostics.ts │ ├── lang_client.ts │ ├── lsp_ext.ts │ ├── main.ts │ ├── persistent_state.ts │ ├── run.ts │ ├── snippets.ts │ ├── syntax_tree_provider.ts │ ├── tasks.ts │ ├── test_explorer.ts │ ├── toolchain.ts │ └── util.ts │ ├── tests │ ├── runTests.ts │ └── unit │ │ ├── bootstrap.test.ts │ │ ├── index.ts │ │ ├── launch_config.test.ts │ │ ├── settings.test.ts │ │ └── tasks.test.ts │ ├── tsconfig.eslint.json │ ├── tsconfig.json │ └── walkthrough-setup-tips.md ├── lib ├── README.md ├── la-arena │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── map.rs ├── line-index │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── tests.rs └── lsp-server │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── examples │ └── goto_def.rs │ └── src │ ├── error.rs │ ├── lib.rs │ ├── msg.rs │ ├── req_queue.rs │ ├── socket.rs │ └── stdio.rs ├── rust-version ├── rustfmt.toml ├── triagebot.toml └── xtask ├── Cargo.toml ├── src ├── codegen.rs ├── codegen │ ├── assists_doc_tests.rs │ ├── diagnostics_docs.rs │ ├── feature_docs.rs │ ├── grammar.rs │ ├── grammar │ │ └── ast_src.rs │ ├── lints.rs │ └── parser_inline_tests.rs ├── dist.rs ├── flags.rs ├── install.rs ├── main.rs ├── metrics.rs ├── pgo.rs ├── publish.rs ├── publish │ └── notes.rs ├── release.rs ├── release │ └── changelog.rs ├── tidy.rs └── util.rs └── test_data ├── expected.md └── input.adoc /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --bin xtask --" 3 | tq = "test -- -q" 4 | qt = "tq" 5 | lint = "clippy --all-targets -- --cap-lints warn" 6 | codegen = "run --package xtask --bin xtask -- codegen" 7 | dist = "run --package xtask --bin xtask -- dist" 8 | 9 | [target.x86_64-pc-windows-msvc] 10 | linker = "rust-lld" 11 | 12 | [env] 13 | CARGO_WORKSPACE_DIR = { value = "", relative = true } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | end_of_line = lf 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 4 11 | max_line_length = 100 12 | 13 | [*.md] 14 | indent_size = 2 15 | 16 | [*.{yml,yaml}] 17 | indent_size = 2 18 | 19 | [COMMIT_EDITMSG] 20 | max_line_length = unset 21 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | # git grep shouldn't match entries in this benchmark data 4 | bench_data/** binary 5 | 6 | # Older git versions try to fix line endings on images, this prevents it. 7 | *.png binary 8 | *.jpg binary 9 | *.ico binary 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions regarding rust-analyzer 3 | url: https://github.com/rust-lang/rust-analyzer/discussions 4 | about: Please ask and answer questions here instead of opening an issue 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/critical_nightly_regression.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Critical Nightly Regression 3 | about: You are using nightly rust-analyzer and the latest version is unusable. 4 | title: '' 5 | labels: 'Broken Window' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Create a feature request for rust-analyzer. 4 | title: '' 5 | labels: 'C-feature' 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/actions/github-release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:slim 2 | 3 | COPY . /action 4 | WORKDIR /action 5 | 6 | RUN npm install --production 7 | 8 | ENTRYPOINT ["node", "/action/main.js"] 9 | -------------------------------------------------------------------------------- /.github/actions/github-release/action.yml: -------------------------------------------------------------------------------- 1 | name: 'wasmtime github releases' 2 | description: 'wasmtime github releases' 3 | inputs: 4 | token: 5 | description: '' 6 | required: true 7 | name: 8 | description: '' 9 | required: true 10 | files: 11 | description: '' 12 | required: true 13 | runs: 14 | using: 'docker' 15 | image: 'Dockerfile' 16 | -------------------------------------------------------------------------------- /.github/actions/github-release/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wasmtime-github-release", 3 | "version": "0.0.0", 4 | "main": "main.js", 5 | "dependencies": { 6 | "@actions/core": "^1.6", 7 | "@actions/github": "^5.0", 8 | "glob": "^7.1.5" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | /dist/ 3 | **/*.rs.bk 4 | **/*.rs.pending-snap 5 | .idea/* 6 | *.log 7 | *.iml 8 | .vscode/settings.json 9 | .DS_Store 10 | /out/ 11 | /dump.lsif 12 | .envrc 13 | docs/book/book 14 | docs/book/src/assists_generated.md 15 | docs/book/src/diagnostics_generated.md 16 | docs/book/src/features_generated.md 17 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": ["vadimcn.vscode-lldb"], 7 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 8 | "unwantedRecommendations": [] 9 | } 10 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | See the [Privacy](https://rust-analyzer.github.io/book/privacy.html) section of the user manual. 2 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-types = [ 2 | { path = "std::collections::HashMap", reason = "use FxHashMap" }, 3 | { path = "std::collections::HashSet", reason = "use FxHashSet" }, 4 | { path = "std::collections::hash_map::RandomState", reason = "use BuildHasherDefault"} 5 | ] 6 | 7 | disallowed-methods = [ 8 | { path = "std::process::Command::new", reason = "use `toolchain::command` instead as it forces the choice of a working directory" }, 9 | ] 10 | -------------------------------------------------------------------------------- /crates/edition/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "edition" 3 | version = "0.0.0" 4 | description = "Rust edition support crate for rust-analyzer." 5 | rust-version.workspace = true 6 | edition.workspace = true 7 | license.workspace = true 8 | authors.workspace = true 9 | repository.workspace = true 10 | 11 | [dependencies] 12 | 13 | [lints] 14 | workspace = true 15 | -------------------------------------------------------------------------------- /crates/hir-def/src/expr_store/tests.rs: -------------------------------------------------------------------------------- 1 | mod body; 2 | mod signatures; 3 | -------------------------------------------------------------------------------- /crates/hir-def/src/nameres/tests/primitives.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | #[test] 4 | fn primitive_reexport() { 5 | check( 6 | r#" 7 | //- /lib.rs 8 | mod foo; 9 | use foo::int; 10 | 11 | //- /foo.rs 12 | pub use i32 as int; 13 | "#, 14 | expect![[r#" 15 | crate 16 | foo: t 17 | int: ti 18 | 19 | crate::foo 20 | int: ti 21 | "#]], 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /crates/hir-expand/src/builtin.rs: -------------------------------------------------------------------------------- 1 | //! Builtin macros and attributes 2 | #[macro_use] 3 | pub mod quote; 4 | 5 | mod attr_macro; 6 | mod derive_macro; 7 | mod fn_macro; 8 | 9 | pub use self::{ 10 | attr_macro::{BuiltinAttrExpander, find_builtin_attr, pseudo_derive_attr_expansion}, 11 | derive_macro::{BuiltinDeriveExpander, find_builtin_derive}, 12 | fn_macro::{ 13 | BuiltinFnLikeExpander, EagerExpander, find_builtin_macro, include_input_to_file_id, 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /crates/hir-ty/src/diagnostics.rs: -------------------------------------------------------------------------------- 1 | //! Type inference-based diagnostics. 2 | mod decl_check; 3 | mod expr; 4 | mod match_check; 5 | mod unsafe_check; 6 | 7 | pub use crate::diagnostics::{ 8 | decl_check::{CaseType, IncorrectCase, incorrect_case}, 9 | expr::{ 10 | BodyValidationDiagnostic, record_literal_missing_fields, record_pattern_missing_fields, 11 | }, 12 | unsafe_check::{ 13 | InsideUnsafeBlock, UnsafetyReason, missing_unsafe, unsafe_operations, 14 | unsafe_operations_for_body, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /crates/intern/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "intern" 3 | version = "0.0.0" 4 | repository.workspace = true 5 | description = "Global `Arc`-based object interning infrastructure for rust-analyzer." 6 | 7 | authors.workspace = true 8 | edition.workspace = true 9 | license.workspace = true 10 | rust-version.workspace = true 11 | 12 | [lib] 13 | 14 | 15 | [dependencies] 16 | dashmap.workspace = true 17 | hashbrown.workspace = true 18 | rustc-hash.workspace = true 19 | triomphe.workspace = true 20 | 21 | [lints] 22 | workspace = true 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/byte_strings.rs: -------------------------------------------------------------------------------- 1 | b"\💩" 2 | b"\●" 3 | b"\u{_0000}" 4 | b"\u{0000000}" 5 | b"\u{FFFFFF}" 6 | b"\u{ffffff}" 7 | b"\u{ffffff}" 8 | b"\u{DC00}" 9 | b"\u{DDDD}" 10 | b"\u{DFFF}" 11 | b"\u{D800}" 12 | b"\u{DAAA}" 13 | b"\u{DBFF}" 14 | b"\xы" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/c_strings.rs: -------------------------------------------------------------------------------- 1 | c"\💩" 2 | c"\●" 3 | c"\u{_0000}" 4 | c"\u{0000000}" 5 | c"\u{FFFFFF}" 6 | c"\u{ffffff}" 7 | c"\u{ffffff}" 8 | c"\u{DC00}" 9 | c"\u{DDDD}" 10 | c"\u{DFFF}" 11 | c"\u{D800}" 12 | c"\u{DAAA}" 13 | c"\u{DBFF}" 14 | c"\xы" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/empty_exponent.rs: -------------------------------------------------------------------------------- 1 | 0e 2 | 0E 3 | 4 | 42e+ 5 | 42e- 6 | 42E+ 7 | 42E- 8 | 9 | 42.e+ 10 | 42.e- 11 | 42.E+ 12 | 42.E- 13 | 14 | 42.2e+ 15 | 42.2e- 16 | 42.2E+ 17 | 42.2E- 18 | 19 | 42.2e+f32 20 | 42.2e-f32 21 | 42.2E+f32 22 | 42.2E-f32 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/empty_int.rs: -------------------------------------------------------------------------------- 1 | 0b 2 | 0o 3 | 0x 4 | 5 | 0b_ 6 | 0o_ 7 | 0x_ 8 | 9 | 0bnoDigit 10 | 0onoDigit 11 | 0xnoDigit 12 | 13 | 0xG 14 | 0xg 15 | 16 | 0x_g 17 | 0x_G 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/lifetime_starts_with_a_number.rast: -------------------------------------------------------------------------------- 1 | LIFETIME_IDENT "'1" error: Lifetime name cannot start with a number 2 | WHITESPACE "\n" 3 | LIFETIME_IDENT "'1lifetime" error: Lifetime name cannot start with a number 4 | WHITESPACE "\n" 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/lifetime_starts_with_a_number.rs: -------------------------------------------------------------------------------- 1 | '1 2 | '1lifetime 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/lifetime_starts_with_a_number.txt: -------------------------------------------------------------------------------- 1 | LIFETIME_IDENT "'1" error: Lifetime name cannot start with a number 2 | WHITESPACE "\n" 3 | LIFETIME_IDENT "'1lifetime" error: Lifetime name cannot start with a number 4 | WHITESPACE "\n" 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/strings.rs: -------------------------------------------------------------------------------- 1 | "\💩" 2 | "\●" 3 | "\u{_0000}" 4 | "\u{0000000}" 5 | "\u{FFFFFF}" 6 | "\u{ffffff}" 7 | "\u{ffffff}" 8 | "\u{DC00}" 9 | "\u{DDDD}" 10 | "\u{DFFF}" 11 | "\u{D800}" 12 | "\u{DAAA}" 13 | "\u{DBFF}" 14 | "\xы" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_at_eof.rast: -------------------------------------------------------------------------------- 1 | COMMENT "/*" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_at_eof.rs: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_at_eof.txt: -------------------------------------------------------------------------------- 1 | COMMENT "/*" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_with_content.rast: -------------------------------------------------------------------------------- 1 | COMMENT "/* comment\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_with_content.rs: -------------------------------------------------------------------------------- 1 | /* comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_block_comment_with_content.txt: -------------------------------------------------------------------------------- 1 | COMMENT "/* comment\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_at_eof.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_at_eof.rs: -------------------------------------------------------------------------------- 1 | b' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_at_eof.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | b" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\x7f" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | b"\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\x7f" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ferris.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"🦀" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ferris.rs: -------------------------------------------------------------------------------- 1 | b"🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_ferris.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"🦀" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash.rs: -------------------------------------------------------------------------------- 1 | b"\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_double_quote.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\\"" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_double_quote.rs: -------------------------------------------------------------------------------- 1 | b"\" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_double_quote.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\\"" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\n" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | b"\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\n" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_space.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\" " error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_space.rs: -------------------------------------------------------------------------------- 1 | b" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_space.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\" " error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\u{20AA}" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | b"\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_string_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "b\"\\u{20AA}" error: Missing trailing `"` symbol to terminate the byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'\\x7f" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | b'\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'\\x7f" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ferris.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'🦀" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ferris.rs: -------------------------------------------------------------------------------- 1 | b'🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_ferris.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'🦀" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'\\" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash.rs: -------------------------------------------------------------------------------- 1 | b'\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'\\" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'\\n" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | b'\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'\\n" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_single_quote.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'\\'" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_single_quote.rs: -------------------------------------------------------------------------------- 1 | b'\' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_slash_single_quote.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'\\'" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_space.rast: -------------------------------------------------------------------------------- 1 | BYTE "b' " error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_space.rs: -------------------------------------------------------------------------------- 1 | b' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_space.txt: -------------------------------------------------------------------------------- 1 | BYTE "b' " error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'\\u{20AA}" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | b'\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_byte_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE "b'\\u{20AA}" error: Missing trailing `'` symbol to terminate the byte literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_at_eof.rast: -------------------------------------------------------------------------------- 1 | CHAR "'" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_at_eof.rs: -------------------------------------------------------------------------------- 1 | ' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_at_eof.txt: -------------------------------------------------------------------------------- 1 | CHAR "'" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | CHAR "'\\x7f" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | '\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | CHAR "'\\x7f" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ferris.rast: -------------------------------------------------------------------------------- 1 | CHAR "'🦀" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ferris.rs: -------------------------------------------------------------------------------- 1 | '🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_ferris.txt: -------------------------------------------------------------------------------- 1 | CHAR "'🦀" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash.rast: -------------------------------------------------------------------------------- 1 | CHAR "'\\" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash.rs: -------------------------------------------------------------------------------- 1 | '\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash.txt: -------------------------------------------------------------------------------- 1 | CHAR "'\\" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | CHAR "'\\n" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | '\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | CHAR "'\\n" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_single_quote.rast: -------------------------------------------------------------------------------- 1 | CHAR "'\\'" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_single_quote.rs: -------------------------------------------------------------------------------- 1 | '\' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_slash_single_quote.txt: -------------------------------------------------------------------------------- 1 | CHAR "'\\'" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_space.rast: -------------------------------------------------------------------------------- 1 | CHAR "' " error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_space.rs: -------------------------------------------------------------------------------- 1 | ' -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_space.txt: -------------------------------------------------------------------------------- 1 | CHAR "' " error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | CHAR "'\\u{20AA}" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | '\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_char_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | CHAR "'\\u{20AA}" error: Missing trailing `'` symbol to terminate the character literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_entirely.rast: -------------------------------------------------------------------------------- 1 | COMMENT "/* /* /*\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_entirely.rs: -------------------------------------------------------------------------------- 1 | /* /* /* 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_entirely.txt: -------------------------------------------------------------------------------- 1 | COMMENT "/* /* /*\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_partially.rast: -------------------------------------------------------------------------------- 1 | COMMENT "/** /*! /* comment */ */\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_partially.rs: -------------------------------------------------------------------------------- 1 | /** /*! /* comment */ */ 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_nested_block_comment_partially.txt: -------------------------------------------------------------------------------- 1 | COMMENT "/** /*! /* comment */ */\n" error: Missing trailing `*/` symbols to terminate the block comment 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | br##" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\x7f" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | br##"\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\x7f" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ferris.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"🦀" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ferris.rs: -------------------------------------------------------------------------------- 1 | br##"🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_ferris.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"🦀" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash.rs: -------------------------------------------------------------------------------- 1 | br##"\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\n" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | br##"\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\n" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_space.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\" " error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_space.rs: -------------------------------------------------------------------------------- 1 | br##" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_space.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\" " error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\u{20AA}" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | br##"\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_byte_string_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##\"\\u{20AA}" error: Missing trailing `"` with `#` symbols to terminate the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | r##" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\x7f" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | r##"\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\x7f" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ferris.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"🦀" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ferris.rs: -------------------------------------------------------------------------------- 1 | r##"🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_ferris.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"🦀" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash.rs: -------------------------------------------------------------------------------- 1 | r##"\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\n" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | r##"\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\n" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_space.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\" " error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_space.rs: -------------------------------------------------------------------------------- 1 | r##" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_space.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\" " error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\u{20AA}" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | r##"\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_raw_string_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | STRING "r##\"\\u{20AA}" error: Missing trailing `"` with `#` symbols to terminate the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | STRING "\"" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | STRING "\"" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ascii_escape.rast: -------------------------------------------------------------------------------- 1 | STRING "\"\\x7f" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ascii_escape.rs: -------------------------------------------------------------------------------- 1 | "\x7f -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ascii_escape.txt: -------------------------------------------------------------------------------- 1 | STRING "\"\\x7f" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ferris.rast: -------------------------------------------------------------------------------- 1 | STRING "\"🦀" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ferris.rs: -------------------------------------------------------------------------------- 1 | "🦀 -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_ferris.txt: -------------------------------------------------------------------------------- 1 | STRING "\"🦀" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash.rast: -------------------------------------------------------------------------------- 1 | STRING "\"\\" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash.rs: -------------------------------------------------------------------------------- 1 | "\ -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash.txt: -------------------------------------------------------------------------------- 1 | STRING "\"\\" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_double_quote.rast: -------------------------------------------------------------------------------- 1 | STRING "\"\\\"" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_double_quote.rs: -------------------------------------------------------------------------------- 1 | "\" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_double_quote.txt: -------------------------------------------------------------------------------- 1 | STRING "\"\\\"" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_n.rast: -------------------------------------------------------------------------------- 1 | STRING "\"\\n" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_n.rs: -------------------------------------------------------------------------------- 1 | "\n -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_slash_n.txt: -------------------------------------------------------------------------------- 1 | STRING "\"\\n" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_space.rast: -------------------------------------------------------------------------------- 1 | STRING "\" " error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_space.rs: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_space.txt: -------------------------------------------------------------------------------- 1 | STRING "\" " error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_unicode_escape.rast: -------------------------------------------------------------------------------- 1 | STRING "\"\\u{20AA}" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_unicode_escape.rs: -------------------------------------------------------------------------------- 1 | "\u{20AA} -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unclosed_string_with_unicode_escape.txt: -------------------------------------------------------------------------------- 1 | STRING "\"\\u{20AA}" error: Missing trailing `"` symbol to terminate the string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | br## -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br##" error: Missing `"` symbol after `#` symbols to begin the raw byte string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_with_ascii.rast: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br## " error: Invalid raw string literal 2 | IDENT "I" 3 | WHITESPACE " " 4 | IDENT "lack" 5 | WHITESPACE " " 6 | IDENT "a" 7 | WHITESPACE " " 8 | IDENT "quote" 9 | BANG "!" 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_with_ascii.rs: -------------------------------------------------------------------------------- 1 | br## I lack a quote! -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_byte_string_with_ascii.txt: -------------------------------------------------------------------------------- 1 | BYTE_STRING "br## " error: Missing `"` symbol after `#` symbols to begin the raw byte string literal 2 | IDENT "I" 3 | WHITESPACE " " 4 | IDENT "lack" 5 | WHITESPACE " " 6 | IDENT "a" 7 | WHITESPACE " " 8 | IDENT "quote" 9 | BANG "!" 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_at_eof.rast: -------------------------------------------------------------------------------- 1 | STRING "r##" error: Invalid raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_at_eof.rs: -------------------------------------------------------------------------------- 1 | r## -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_at_eof.txt: -------------------------------------------------------------------------------- 1 | STRING "r##" error: Missing `"` symbol after `#` symbols to begin the raw string literal 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_with_ascii.rast: -------------------------------------------------------------------------------- 1 | STRING "r## " error: Invalid raw string literal 2 | IDENT "I" 3 | WHITESPACE " " 4 | IDENT "lack" 5 | WHITESPACE " " 6 | IDENT "a" 7 | WHITESPACE " " 8 | IDENT "quote" 9 | BANG "!" 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_with_ascii.rs: -------------------------------------------------------------------------------- 1 | r## I lack a quote! -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/err/unstarted_raw_string_with_ascii.txt: -------------------------------------------------------------------------------- 1 | STRING "r## " error: Missing `"` symbol after `#` symbols to begin the raw string literal 2 | IDENT "I" 3 | WHITESPACE " " 4 | IDENT "lack" 5 | WHITESPACE " " 6 | IDENT "a" 7 | WHITESPACE " " 8 | IDENT "quote" 9 | BANG "!" 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/block_comment.rast: -------------------------------------------------------------------------------- 1 | COMMENT "/* */" 2 | WHITESPACE "\n" 3 | COMMENT "/**/" 4 | WHITESPACE "\n" 5 | COMMENT "/* /* */ */" 6 | WHITESPACE "\n" 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/block_comment.rs: -------------------------------------------------------------------------------- 1 | /* */ 2 | /**/ 3 | /* /* */ */ 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/block_comment.txt: -------------------------------------------------------------------------------- 1 | COMMENT "/* */" 2 | WHITESPACE "\n" 3 | COMMENT "/**/" 4 | WHITESPACE "\n" 5 | COMMENT "/* /* */ */" 6 | WHITESPACE "\n" 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/byte_strings.rast: -------------------------------------------------------------------------------- 1 | BYTE "b'x'" 2 | WHITESPACE " " 3 | BYTE_STRING "b\"foo\"" 4 | WHITESPACE " " 5 | BYTE_STRING "br\"\"" 6 | WHITESPACE "\n" 7 | BYTE_STRING "b\"\"ix" 8 | WHITESPACE " " 9 | BYTE_STRING "br\"\"br" 10 | WHITESPACE "\n" 11 | BYTE "b'\\n'" 12 | WHITESPACE " " 13 | BYTE "b'\\\\'" 14 | WHITESPACE " " 15 | BYTE "b'\\''" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/byte_strings.rs: -------------------------------------------------------------------------------- 1 | b'x' b"foo" br"" 2 | b""ix br""br 3 | b'\n' b'\\' b'\'' 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/byte_strings.txt: -------------------------------------------------------------------------------- 1 | BYTE "b''" 2 | WHITESPACE " " 3 | BYTE "b'x'" 4 | WHITESPACE " " 5 | BYTE_STRING "b\"foo\"" 6 | WHITESPACE " " 7 | BYTE_STRING "br\"\"" 8 | WHITESPACE "\n" 9 | BYTE "b''suf" 10 | WHITESPACE " " 11 | BYTE_STRING "b\"\"ix" 12 | WHITESPACE " " 13 | BYTE_STRING "br\"\"br" 14 | WHITESPACE "\n" 15 | BYTE "b'\\n'" 16 | WHITESPACE " " 17 | BYTE "b'\\\\'" 18 | WHITESPACE " " 19 | BYTE "b'\\''" 20 | WHITESPACE " " 21 | BYTE "b'hello'" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/chars.rast: -------------------------------------------------------------------------------- 1 | CHAR "'x'" 2 | WHITESPACE " " 3 | CHAR "' '" 4 | WHITESPACE " " 5 | CHAR "'0'" 6 | WHITESPACE " " 7 | CHAR "'\\x7f'" 8 | WHITESPACE " " 9 | CHAR "'\\n'" 10 | WHITESPACE " " 11 | CHAR "'\\\\'" 12 | WHITESPACE " " 13 | CHAR "'\\''" 14 | WHITESPACE "\n" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/chars.rs: -------------------------------------------------------------------------------- 1 | 'x' ' ' '0' '\x7f' '\n' '\\' '\'' 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/chars.txt: -------------------------------------------------------------------------------- 1 | CHAR "'x'" 2 | WHITESPACE " " 3 | CHAR "' '" 4 | WHITESPACE " " 5 | CHAR "'0'" 6 | WHITESPACE " " 7 | CHAR "'hello'" 8 | WHITESPACE " " 9 | CHAR "'\\x7f'" 10 | WHITESPACE " " 11 | CHAR "'\\n'" 12 | WHITESPACE " " 13 | CHAR "'\\\\'" 14 | WHITESPACE " " 15 | CHAR "'\\''" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/guarded_str_prefix_edition_2021.rast: -------------------------------------------------------------------------------- 1 | COMMENT "//@ edition: 2021" 2 | WHITESPACE "\n\n" 3 | POUND "#" 4 | STRING "\"foo\"" 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/guarded_str_prefix_edition_2021.rs: -------------------------------------------------------------------------------- 1 | //@ edition: 2021 2 | 3 | #"foo" -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/hello.rast: -------------------------------------------------------------------------------- 1 | IDENT "hello" 2 | WHITESPACE " " 3 | IDENT "world" 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/hello.rs: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/hello.txt: -------------------------------------------------------------------------------- 1 | IDENT "hello" 2 | WHITESPACE " " 3 | IDENT "world" 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/ident.rast: -------------------------------------------------------------------------------- 1 | IDENT "foo" 2 | WHITESPACE " " 3 | IDENT "foo_" 4 | WHITESPACE " " 5 | IDENT "_foo" 6 | WHITESPACE " " 7 | UNDERSCORE "_" 8 | WHITESPACE " " 9 | IDENT "__" 10 | WHITESPACE " " 11 | IDENT "x" 12 | WHITESPACE " " 13 | IDENT "привет" 14 | WHITESPACE "\n" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/ident.rs: -------------------------------------------------------------------------------- 1 | foo foo_ _foo _ __ x привет 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/ident.txt: -------------------------------------------------------------------------------- 1 | IDENT "foo" 2 | WHITESPACE " " 3 | IDENT "foo_" 4 | WHITESPACE " " 5 | IDENT "_foo" 6 | WHITESPACE " " 7 | UNDERSCORE "_" 8 | WHITESPACE " " 9 | IDENT "__" 10 | WHITESPACE " " 11 | IDENT "x" 12 | WHITESPACE " " 13 | IDENT "привет" 14 | WHITESPACE "\n" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/keywords.rs: -------------------------------------------------------------------------------- 1 | async fn use struct trait enum impl true false as extern crate 2 | mod pub self super in where for loop while if match const 3 | static mut type ref let else move return 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/lifetimes.rast: -------------------------------------------------------------------------------- 1 | LIFETIME_IDENT "'a" 2 | WHITESPACE " " 3 | LIFETIME_IDENT "'foo" 4 | WHITESPACE " " 5 | LIFETIME_IDENT "'foo_bar_baz" 6 | WHITESPACE " " 7 | LIFETIME_IDENT "'_" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/lifetimes.rs: -------------------------------------------------------------------------------- 1 | 'a 'foo 'foo_bar_baz '_ 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/lifetimes.txt: -------------------------------------------------------------------------------- 1 | LIFETIME_IDENT "'a" 2 | WHITESPACE " " 3 | LIFETIME_IDENT "'foo" 4 | WHITESPACE " " 5 | LIFETIME_IDENT "'foo_bar_baz" 6 | WHITESPACE " " 7 | LIFETIME_IDENT "'_" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/numbers.rs: -------------------------------------------------------------------------------- 1 | 0 00 0_ 0. 0z 2 | 01790 0b1790 0o1790 0x1790aAbBcCdDeEfF 001279 0_1279 0.1279 0e1279 0E1279 3 | 0..2 4 | 0.foo() 5 | 0e+1 6 | 0.e+1 7 | 0.0E-2 8 | 0___0.10000____0000e+111__ 9 | 1i64 92.0f32 11__s 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_ident.rast: -------------------------------------------------------------------------------- 1 | IDENT "r#raw_ident" 2 | WHITESPACE "\n" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_ident.rs: -------------------------------------------------------------------------------- 1 | r#raw_ident 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_ident.txt: -------------------------------------------------------------------------------- 1 | IDENT "r#raw_ident" 2 | WHITESPACE "\n" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_strings.rast: -------------------------------------------------------------------------------- 1 | STRING "r###\"this is a r##\"raw\"## string\"###" 2 | WHITESPACE "\n" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_strings.rs: -------------------------------------------------------------------------------- 1 | r###"this is a r##"raw"## string"### 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/raw_strings.txt: -------------------------------------------------------------------------------- 1 | STRING "r###\"this is a r##\"raw\"## string\"###" 2 | WHITESPACE "\n" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/single_line_comments.rast: -------------------------------------------------------------------------------- 1 | SHEBANG "#!/usr/bin/env bash" 2 | WHITESPACE "\n" 3 | COMMENT "// hello" 4 | WHITESPACE "\n" 5 | COMMENT "//! World" 6 | WHITESPACE "\n" 7 | COMMENT "//!! Inner line doc" 8 | WHITESPACE "\n" 9 | COMMENT "/// Outer line doc" 10 | WHITESPACE "\n" 11 | COMMENT "//// Just a comment" 12 | WHITESPACE "\n\n" 13 | COMMENT "//" 14 | WHITESPACE "\n" 15 | COMMENT "//!" 16 | WHITESPACE "\n" 17 | COMMENT "//!!" 18 | WHITESPACE "\n" 19 | COMMENT "///" 20 | WHITESPACE "\n" 21 | COMMENT "////" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/single_line_comments.rs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | // hello 3 | //! World 4 | //!! Inner line doc 5 | /// Outer line doc 6 | //// Just a comment 7 | 8 | // 9 | //! 10 | //!! 11 | /// 12 | //// 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/single_line_comments.txt: -------------------------------------------------------------------------------- 1 | SHEBANG "#!/usr/bin/env bash" 2 | WHITESPACE "\n" 3 | COMMENT "// hello" 4 | WHITESPACE "\n" 5 | COMMENT "//! World" 6 | WHITESPACE "\n" 7 | COMMENT "//!! Inner line doc" 8 | WHITESPACE "\n" 9 | COMMENT "/// Outer line doc" 10 | WHITESPACE "\n" 11 | COMMENT "//// Just a comment" 12 | WHITESPACE "\n\n" 13 | COMMENT "//" 14 | WHITESPACE "\n" 15 | COMMENT "//!" 16 | WHITESPACE "\n" 17 | COMMENT "//!!" 18 | WHITESPACE "\n" 19 | COMMENT "///" 20 | WHITESPACE "\n" 21 | COMMENT "////" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/strings.rast: -------------------------------------------------------------------------------- 1 | STRING "\"hello\"" 2 | WHITESPACE " " 3 | STRING "r\"world\"" 4 | WHITESPACE " " 5 | STRING "\"\\n\\\"\\\\no escape\"" 6 | WHITESPACE " " 7 | STRING "\"multi\nline\"" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/strings.rs: -------------------------------------------------------------------------------- 1 | "hello" r"world" "\n\"\\no escape" "multi 2 | line" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/strings.txt: -------------------------------------------------------------------------------- 1 | STRING "\"hello\"" 2 | WHITESPACE " " 3 | STRING "r\"world\"" 4 | WHITESPACE " " 5 | STRING "\"\\n\\\"\\\\no escape\"" 6 | WHITESPACE " " 7 | STRING "\"multi\nline\"" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/symbols.rs: -------------------------------------------------------------------------------- 1 | ; , ( ) { } [ ] < > @ # ~ ? $ & | + * / ^ % 2 | . .. ... ..= 3 | : :: 4 | = => 5 | ! != 6 | - -> 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/whitespace.rast: -------------------------------------------------------------------------------- 1 | IDENT "a" 2 | WHITESPACE " " 3 | IDENT "b" 4 | WHITESPACE " " 5 | IDENT "c" 6 | WHITESPACE "\n" 7 | IDENT "d" 8 | WHITESPACE "\n\n" 9 | IDENT "e" 10 | WHITESPACE "\t" 11 | IDENT "f" 12 | WHITESPACE "\n" 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/whitespace.rs: -------------------------------------------------------------------------------- 1 | a b c 2 | d 3 | 4 | e f 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/lexer/ok/whitespace.txt: -------------------------------------------------------------------------------- 1 | IDENT "a" 2 | WHITESPACE " " 3 | IDENT "b" 4 | WHITESPACE " " 5 | IDENT "c" 6 | WHITESPACE "\n" 7 | IDENT "d" 8 | WHITESPACE "\n\n" 9 | IDENT "e" 10 | WHITESPACE "\t" 11 | IDENT "f" 12 | WHITESPACE "\n" 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0000_struct_field_missing_comma.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | a: u32 3 | b: u32 4 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0001_item_recovery_in_file.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | ERROR 3 | IF_KW "if" 4 | WHITESPACE " " 5 | ERROR 6 | MATCH_KW "match" 7 | WHITESPACE "\n\n" 8 | STRUCT 9 | STRUCT_KW "struct" 10 | WHITESPACE " " 11 | NAME 12 | IDENT "S" 13 | WHITESPACE " " 14 | RECORD_FIELD_LIST 15 | L_CURLY "{" 16 | R_CURLY "}" 17 | error 0: expected an item 18 | error 3: expected an item 19 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0001_item_recovery_in_file.rs: -------------------------------------------------------------------------------- 1 | if match 2 | 3 | struct S {} -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0002_duplicate_shebang.rs: -------------------------------------------------------------------------------- 1 | #!/use/bin/env rusti 2 | #!/use/bin/env rusti 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0003_C++_semicolon.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | a: i32, 3 | b: String, 4 | }; -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0004_use_path_bad_segment.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH 8 | PATH_SEGMENT 9 | NAME_REF 10 | IDENT "foo" 11 | COLON2 "::" 12 | PATH_SEGMENT 13 | ERROR 14 | INT_NUMBER "92" 15 | SEMICOLON ";" 16 | error 9: expected identifier, `self`, `super`, `crate`, or `Self` 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0004_use_path_bad_segment.rs: -------------------------------------------------------------------------------- 1 | use foo::92; -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0005_attribute_recover.rs: -------------------------------------------------------------------------------- 1 | #[foo(foo, +, 92)] 2 | fn foo() { 3 | } 4 | 5 | 6 | #[foo( 7 | fn foo() { 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0006_named_field_recovery.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | f: u32, 3 | pub 92 4 | + - * 5 | pub x: u32, 6 | z: f64, 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0007_stray_curly_in_file.rs: -------------------------------------------------------------------------------- 1 | } 2 | 3 | struct S; 4 | 5 | } 6 | 7 | fn foo(){} 8 | 9 | } 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0008_item_block_recovery.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | } 3 | 4 | bar() { 5 | if true { 6 | 1 7 | } else { 8 | 2 + 3 9 | } 10 | } 11 | 12 | fn baz() { 13 | } 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.rs: -------------------------------------------------------------------------------- 1 | struct S<90 + 2> { 2 | f: u32 3 | } 4 | 5 | struct T; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0010_unsafe_lambda_block.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | || -> () unsafe { () }; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0011_extern_struct.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | ERROR 3 | ABI 4 | EXTERN_KW "extern" 5 | WHITESPACE " " 6 | STRUCT 7 | STRUCT_KW "struct" 8 | WHITESPACE " " 9 | NAME 10 | IDENT "Foo" 11 | SEMICOLON ";" 12 | WHITESPACE "\n" 13 | error 6: expected fn, trait or impl 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0011_extern_struct.rs: -------------------------------------------------------------------------------- 1 | extern struct Foo; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0013_invalid_type.rs: -------------------------------------------------------------------------------- 1 | pub struct Cache( 2 | RefCell, 5 | >> 6 | ); 7 | 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0014_where_no_bounds.rs: -------------------------------------------------------------------------------- 1 | fn foo() where T {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0015_curly_in_params.rs: -------------------------------------------------------------------------------- 1 | fn foo(}) { 2 | } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0016_missing_semi.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | foo( 3 | 1, 2 4 | ) 5 | return 92; 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0017_incomplete_binexpr.rs: -------------------------------------------------------------------------------- 1 | fn foo(foo: i32) { 2 | let bar = 92; 3 | 1 + 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0018_incomplete_fn.rs: -------------------------------------------------------------------------------- 1 | impl FnScopes { 2 | fn new_scope(&) -> ScopeId { 3 | let res = self.scopes.len(); 4 | self.scopes.push(ScopeData { parent: None, entries: vec![] }) 5 | } 6 | 7 | fn set_parent 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0019_let_recover.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let foo = 11 3 | let bar = 1; 4 | let 5 | let baz = 92; 6 | let 7 | if true {} 8 | let 9 | while true {} 10 | let 11 | loop {} 12 | } 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0020_fn_recover.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | FN 3 | FN_KW "fn" 4 | WHITESPACE "\n\n" 5 | FN 6 | FN_KW "fn" 7 | WHITESPACE " " 8 | NAME 9 | IDENT "foo" 10 | PARAM_LIST 11 | L_PAREN "(" 12 | R_PAREN ")" 13 | WHITESPACE " " 14 | BLOCK_EXPR 15 | STMT_LIST 16 | L_CURLY "{" 17 | R_CURLY "}" 18 | WHITESPACE "\n" 19 | error 2: expected a name 20 | error 2: expected function arguments 21 | error 2: expected a block 22 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0020_fn_recover.rs: -------------------------------------------------------------------------------- 1 | fn 2 | 3 | fn foo() {} 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0021_incomplete_param.rs: -------------------------------------------------------------------------------- 1 | fn foo(x: i32, y) { 2 | } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0022_bad_exprs.rs: -------------------------------------------------------------------------------- 1 | fn a() { [1, 2, @, struct, let] } 2 | fn b() { foo(1, 2, @, impl, let) } 3 | fn c() { foo.bar(1, 2, @, ], trait, let) } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0023_mismatched_paren.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | foo! ( 3 | bar, "baz", 1, 2.0 4 | } //~ ERROR incorrect close delimiter 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0024_many_type_parens.rs: -------------------------------------------------------------------------------- 1 | fn f Trait<'a>)>() {} 2 | 3 | fn main() { 4 | let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>; 5 | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>; 6 | let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0026_imp_recovery.rs: -------------------------------------------------------------------------------- 1 | impl 2 | impl OnceCell {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0027_incomplete_where_for.rs: -------------------------------------------------------------------------------- 1 | fn foo() 2 | where for<'a> 3 | {} 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0029_field_completion.rs: -------------------------------------------------------------------------------- 1 | fn foo(a: A) { 2 | a. 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => (), 4 | #![doc("Not allowed here")] 5 | _ => (), 6 | } 7 | 8 | match () { 9 | _ => (), 10 | _ => (), 11 | #![doc("Nor here")] 12 | } 13 | 14 | match () { 15 | #[cfg(test)] 16 | #![doc("Nor here")] 17 | _ => (), 18 | _ => (), 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => (), 4 | _ => (), 5 | #[cfg(test)] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0034_bad_box_pattern.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let ref box i = (); 3 | let mut box i = (); 4 | let ref mut box i = (); 5 | } 6 | 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0035_use_recover.rs: -------------------------------------------------------------------------------- 1 | use foo::bar; 2 | use 3 | use crate::baz; 4 | use 5 | fn f() {} 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0036_partial_use.rs: -------------------------------------------------------------------------------- 1 | use std::{error::Error; 2 | use std::io; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0039_lambda_recovery.rs: -------------------------------------------------------------------------------- 1 | fn foo() -> i32 { 2 | [1, 2, 3].iter() 3 | .map(|it|) 4 | .max::(); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0042_weird_blocks.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | { unsafe 92 } 3 | { async 92 } 4 | { try 92 } 5 | { 'label: 92 } 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0043_unexpected_for_type.rs: -------------------------------------------------------------------------------- 1 | type ForRef = for<'a> &'a u32; 2 | type ForTup = for<'a> (&'a u32,); 3 | type ForSlice = for<'a> [u32]; 4 | type ForForFn = for<'a> for<'b> fn(&'a i32, &'b i32); 5 | fn for_for_for() 6 | where 7 | for<'a> for<'b> for<'c> fn(&'a T, &'b T, &'c T): Copy, 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0044_item_modifiers.rs: -------------------------------------------------------------------------------- 1 | unsafe async fn foo() {} 2 | unsafe const fn bar() {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0047_repeated_extern_modifier.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | ERROR 3 | ABI 4 | EXTERN_KW "extern" 5 | WHITESPACE " " 6 | STRING "\"C\"" 7 | WHITESPACE " " 8 | ERROR 9 | ABI 10 | EXTERN_KW "extern" 11 | WHITESPACE " " 12 | STRING "\"C\"" 13 | WHITESPACE "\n" 14 | error 10: expected fn, trait or impl 15 | error 21: expected fn, trait or impl 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0047_repeated_extern_modifier.rs: -------------------------------------------------------------------------------- 1 | extern "C" extern "C" 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0048_double_fish.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | S::::>; 3 | } 4 | 5 | fn g() { 6 | let _: Item:::: = (); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0049_let_else_right_curly_brace_for.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = for _ in 0..10 { 3 | } else { 4 | return 5 | }; 6 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0050_let_else_right_curly_brace_loop.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = loop { 3 | } else { 4 | return 5 | }; 6 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0051_let_else_right_curly_brace_match.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = match Some(1) { 3 | Some(_) => 1, 4 | None => 2, 5 | } else { 6 | return 7 | }; 8 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0052_let_else_right_curly_brace_while.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = while true { 3 | } else { 4 | return 5 | }; 6 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0053_let_else_right_curly_brace_if.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = if true { 3 | } else { 4 | } else { 5 | return 6 | }; 7 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0054_float_split_scientific_notation.rs: -------------------------------------------------------------------------------- 1 | struct S(i32, i32); 2 | fn f() { 3 | let s = S(1, 2); 4 | let a = s.1e0; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0055_impl_use.rs: -------------------------------------------------------------------------------- 1 | impl Result<(), ()> { 2 | let foo = do yeet { 3 | () 4 | } else { 5 | return Ok(()); 6 | }; 7 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0062_let_else_right_curly_brace_become.rs: -------------------------------------------------------------------------------- 1 | let foo = become { 2 | () 3 | } else { 4 | return; 5 | }; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0063_let_else_right_curly_brace_reference.rs: -------------------------------------------------------------------------------- 1 | let foo = &{ 2 | 1 3 | } else { 4 | return; 5 | }; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/err/0064_let_else_right_curly_brace_assignment.rs: -------------------------------------------------------------------------------- 1 | let foo = bar = { 2 | 1 3 | } else { 4 | return; 5 | }; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/angled_path_without_qual.rs: -------------------------------------------------------------------------------- 1 | type X = <()>; 2 | type Y = ; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/anonymous_static.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | STATIC 3 | STATIC_KW "static" 4 | WHITESPACE " " 5 | ERROR 6 | UNDERSCORE "_" 7 | COLON ":" 8 | WHITESPACE " " 9 | PATH_TYPE 10 | PATH 11 | PATH_SEGMENT 12 | NAME_REF 13 | IDENT "i32" 14 | WHITESPACE " " 15 | EQ "=" 16 | WHITESPACE " " 17 | LITERAL 18 | INT_NUMBER "5" 19 | SEMICOLON ";" 20 | WHITESPACE "\n" 21 | error 7: expected a name 22 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/anonymous_static.rs: -------------------------------------------------------------------------------- 1 | static _: i32 = 5; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/arg_list_recovery.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | foo(bar::); 3 | foo(bar:); 4 | foo(bar+); 5 | foo(a, , b); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/array_type_missing_semi.rs: -------------------------------------------------------------------------------- 1 | type T = [() 92]; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/async_without_semicolon.rs: -------------------------------------------------------------------------------- 1 | fn foo() { let _ = async {} } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/bad_asm_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | builtin#asm( 3 | label crashy = { return; } 4 | ); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/comma_after_default_values_syntax.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | S { .., }; 3 | S { .., a: 0 } 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/comma_after_functional_update_syntax.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | S { ..x, }; 3 | S { ..x, a: 0 } 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/crate_visibility_empty_recover.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | STRUCT 3 | VISIBILITY 4 | PUB_KW "pub" 5 | L_PAREN "(" 6 | R_PAREN ")" 7 | WHITESPACE " " 8 | STRUCT_KW "struct" 9 | WHITESPACE " " 10 | NAME 11 | IDENT "S" 12 | SEMICOLON ";" 13 | WHITESPACE "\n" 14 | error 4: expected identifier, `self`, `super`, `crate`, or `Self` 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/crate_visibility_empty_recover.rs: -------------------------------------------------------------------------------- 1 | pub() struct S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/empty_param_slot.rs: -------------------------------------------------------------------------------- 1 | fn f(y: i32, ,t: i32) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/empty_segment.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH 8 | PATH_SEGMENT 9 | NAME_REF 10 | CRATE_KW "crate" 11 | COLON2 "::" 12 | SEMICOLON ";" 13 | WHITESPACE "\n" 14 | error 11: expected identifier, `self`, `super`, `crate`, or `Self` 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/empty_segment.rs: -------------------------------------------------------------------------------- 1 | use crate::; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/fn_pointer_type_missing_fn.rs: -------------------------------------------------------------------------------- 1 | type F = unsafe (); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/gen_fn.rs: -------------------------------------------------------------------------------- 1 | // 2021 2 | gen fn gen_fn() {} 3 | async gen fn async_gen_fn() {} 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/generic_arg_list_recover.rs: -------------------------------------------------------------------------------- 1 | type T = T<0, ,T>; 2 | type T = T::<0, ,T>; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/generic_arg_list_recover_expr.rs: -------------------------------------------------------------------------------- 1 | const _: () = T::<0, ,T>; 2 | const _: () = T::<0, ,T>(); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/generic_param_list_recover.rs: -------------------------------------------------------------------------------- 1 | fn f() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/generic_static.rs: -------------------------------------------------------------------------------- 1 | static C: u32 = 0; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/impl_type.rs: -------------------------------------------------------------------------------- 1 | impl Type {} 2 | impl Trait1 for T {} 3 | impl impl NotType {} 4 | impl Trait2 for impl NotType {} 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/let_else_right_curly_brace.rs: -------------------------------------------------------------------------------- 1 | fn func() { let Some(_) = {Some(1)} else { panic!("h") };} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/macro_rules_as_macro_name.rs: -------------------------------------------------------------------------------- 1 | macro_rules! {}; 2 | macro_rules! () 3 | macro_rules! [] 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/match_arms_recovery.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => (),, 4 | _ => , 5 | _ => (), 6 | => (), 7 | if true => (), 8 | _ => (), 9 | () if => (), 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/meta_recovery.rs: -------------------------------------------------------------------------------- 1 | #![] 2 | #![p = ] 3 | #![p::] 4 | #![p:: =] 5 | #![unsafe] 6 | #![unsafe =] 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/method_call_missing_argument_list.rs: -------------------------------------------------------------------------------- 1 | fn func() { 2 | foo.bar::<> 3 | foo.bar::; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/misplaced_label_err.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | 'loop: impl 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/missing_fn_param_type.rs: -------------------------------------------------------------------------------- 1 | fn f(x y: i32, z, t: i32) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/path_item_without_excl.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | ERROR 3 | PATH 4 | PATH_SEGMENT 5 | NAME_REF 6 | IDENT "foo" 7 | WHITESPACE "\n" 8 | error 3: expected an item 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/path_item_without_excl.rs: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/pointer_type_no_mutability.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | PTR_TYPE 11 | STAR "*" 12 | TUPLE_TYPE 13 | L_PAREN "(" 14 | R_PAREN ")" 15 | SEMICOLON ";" 16 | WHITESPACE "\n" 17 | error 10: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/pointer_type_no_mutability.rs: -------------------------------------------------------------------------------- 1 | type T = *(); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/precise_capturing_invalid.rs: -------------------------------------------------------------------------------- 1 | type T = impl use; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/pub_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { pub 92; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/record_literal_before_ellipsis_recovery.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | S { field ..S::default() } 3 | S { 0 ..S::default() } 4 | S { field .. } 5 | S { 0 .. } 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/record_literal_field_eq_recovery.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | S { field = foo } 3 | S { 0 = foo } 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/record_literal_missing_ellipsis_recovery.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | S { S::default() }; 3 | S { 0::default() }; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/record_pat_field_eq_recovery.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let S { field = foo }; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/recover_from_missing_assoc_item_binding.rs: -------------------------------------------------------------------------------- 1 | fn f() -> impl Iterator {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/recover_from_missing_const_default.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/static_where_clause.rs: -------------------------------------------------------------------------------- 1 | static C: u32 = 0 2 | where i32: Copy; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/struct_field_recover.rs: -------------------------------------------------------------------------------- 1 | struct S { f pub g: () } 2 | struct S { f: pub g: () } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/top_level_let.rs: -------------------------------------------------------------------------------- 1 | let ref foo: fn() = 1 + 3; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/tuple_expr_leading_comma.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | (,); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/tuple_field_list_recovery.rs: -------------------------------------------------------------------------------- 1 | struct S(struct S; 2 | struct S(A,,B); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/tuple_pat_leading_comma.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let (,); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/type_in_array_recover.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | CONST 3 | CONST_KW "const" 4 | WHITESPACE " " 5 | UNDERSCORE "_" 6 | COLON ":" 7 | WHITESPACE " " 8 | SLICE_TYPE 9 | L_BRACK "[" 10 | REF_TYPE 11 | AMP "&" 12 | R_BRACK "]" 13 | SEMICOLON ";" 14 | WHITESPACE "\n" 15 | error 11: expected type 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/type_in_array_recover.rs: -------------------------------------------------------------------------------- 1 | const _: [&]; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/unsafe_block_in_mod.rs: -------------------------------------------------------------------------------- 1 | fn foo(){} unsafe { } fn bar(){} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/err/use_tree_list_err_recovery.rs: -------------------------------------------------------------------------------- 1 | use {a; 2 | use b; 3 | struct T; 4 | fn test() {} 5 | use {a ,, b}; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/anonymous_const.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | CONST 3 | CONST_KW "const" 4 | WHITESPACE " " 5 | UNDERSCORE "_" 6 | COLON ":" 7 | WHITESPACE " " 8 | PATH_TYPE 9 | PATH 10 | PATH_SEGMENT 11 | NAME_REF 12 | IDENT "u32" 13 | WHITESPACE " " 14 | EQ "=" 15 | WHITESPACE " " 16 | LITERAL 17 | INT_NUMBER "0" 18 | SEMICOLON ";" 19 | WHITESPACE "\n" 20 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/anonymous_const.rs: -------------------------------------------------------------------------------- 1 | const _: u32 = 0; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/arb_self_types.rs: -------------------------------------------------------------------------------- 1 | impl S { 2 | fn a(self: &Self) {} 3 | fn b(mut self: Box) {} 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/arg_with_attr.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | foo(#[attr] 92) 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/array_attrs.rs: -------------------------------------------------------------------------------- 1 | const A: &[i64] = &[1, #[cfg(test)] 2]; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/array_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | []; 3 | [1]; 4 | [1, 2,]; 5 | [1; 2]; 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/array_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | ARRAY_TYPE 11 | L_BRACK "[" 12 | TUPLE_TYPE 13 | L_PAREN "(" 14 | R_PAREN ")" 15 | SEMICOLON ";" 16 | WHITESPACE " " 17 | CONST_ARG 18 | LITERAL 19 | INT_NUMBER "92" 20 | R_BRACK "]" 21 | SEMICOLON ";" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/array_type.rs: -------------------------------------------------------------------------------- 1 | type T = [(); 92]; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/as_precedence.rs: -------------------------------------------------------------------------------- 1 | fn f() { let _ = &1 as *const i32; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/asm_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | builtin#asm( 3 | "mov {tmp}, {x}", 4 | "shl {tmp}, 1", 5 | "shl {x}, 2", 6 | "add {x}, {tmp}", 7 | x = inout(reg) x, 8 | tmp = out(reg) _, 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/asm_label.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | builtin#asm("", label {}); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/assoc_const_eq.rs: -------------------------------------------------------------------------------- 1 | fn foo>() {} 2 | const TEST: usize = 3; 3 | fn bar>() {} 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/assoc_item_list.rs: -------------------------------------------------------------------------------- 1 | impl F { 2 | type A = i32; 3 | const B: i32 = 92; 4 | fn foo() {} 5 | fn bar(&self) {} 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/assoc_item_list_inner_attrs.rs: -------------------------------------------------------------------------------- 1 | impl S { #![attr] } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/assoc_type_bound.rs: -------------------------------------------------------------------------------- 1 | type T = StreamingIterator: Clone>; 2 | type T = StreamingIterator; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/assoc_type_eq.rs: -------------------------------------------------------------------------------- 1 | type T = StreamingIterator = &'a T>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/async_trait_bound.rs: -------------------------------------------------------------------------------- 1 | fn async_foo(_: impl async Fn(&i32)) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/attr_on_expr_stmt.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | #[A] foo(); 3 | #[B] bar!{} 4 | #[C] #[D] {} 5 | #[D] return (); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/await_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | x.await; 3 | x.0.await; 4 | x.0().await?.hello(); 5 | x.0.0.await; 6 | x.0. await; 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/bare_dyn_types_with_leading_lifetime.rs: -------------------------------------------------------------------------------- 1 | type A = 'static + Trait; 2 | type B = S<'static + Trait>; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/become_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | become foo(); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/bind_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = (); 3 | let mut b = (); 4 | let ref c = (); 5 | let ref mut d = (); 6 | let e @ _ = (); 7 | let ref mut f @ g @ _ = (); 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/binop_resets_statementness.rs: -------------------------------------------------------------------------------- 1 | fn f() { v = {1}&2; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/block.rs: -------------------------------------------------------------------------------- 1 | fn a() {} 2 | fn b() { let _ = 1; } 3 | fn c() { 1; 2; } 4 | fn d() { 1; 2 } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/block_items.rs: -------------------------------------------------------------------------------- 1 | fn a() { fn b() {} } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/box_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let box i = (); 3 | let box Outer { box i, j: box Inner(box &x) } = (); 4 | let box ref mut i = (); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/break_ambiguity.rs: -------------------------------------------------------------------------------- 1 | fn foo(){ 2 | if break {} 3 | while break {} 4 | for i in break {} 5 | match break {} 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/break_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | loop { 3 | break; 4 | break 'l; 5 | break 92; 6 | break 'l 92; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/builtin_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | builtin#asm(""); 3 | builtin#format_args("", 0, 1, a = 2 + 3, a + b); 4 | builtin#offset_of(Foo, bar.baz.0); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/call_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let _ = f(); 3 | let _ = f()(1)(1, 2,); 4 | let _ = f(::func()); 5 | f(::func()); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/cast_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | 82 as i32; 3 | 81 as i8 + 1; 4 | 79 as i16 - 1; 5 | 0x36 as u8 <= 0x37; 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/closure_binder.rs: -------------------------------------------------------------------------------- 1 | fn main() { for<'a> || (); } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/closure_body_underscore_assignment.rs: -------------------------------------------------------------------------------- 1 | fn main() { || _ = 0; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/closure_params.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let foo = |bar, baz: Baz, qux: Qux::Quux| (); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/closure_range_method_call.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | || .. .method(); 3 | || .. .field; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | PATH_TYPE 11 | PATH 12 | PATH_SEGMENT 13 | NAME_REF 14 | IDENT "S" 15 | GENERIC_ARG_LIST 16 | L_ANGLE "<" 17 | CONST_ARG 18 | LITERAL 19 | INT_NUMBER "92" 20 | R_ANGLE ">" 21 | SEMICOLON ";" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg.rs: -------------------------------------------------------------------------------- 1 | type T = S<92>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg_block.rs: -------------------------------------------------------------------------------- 1 | type T = S<{90 + 2}>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg_bool_literal.rs: -------------------------------------------------------------------------------- 1 | type T = S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg_literal.rs: -------------------------------------------------------------------------------- 1 | type T = S<"hello", 0xdeadbeef>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_arg_negative_number.rs: -------------------------------------------------------------------------------- 1 | type T = S<-92>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_block_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let const { 15 } = (); 3 | let const { foo(); bar() } = (); 4 | 5 | match 42 { 6 | const { 0 } .. const { 1 } => (), 7 | .. const { 0 } => (), 8 | const { 2 } .. => (), 9 | } 10 | 11 | let (const { () },) = (); 12 | } 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_closure.rs: -------------------------------------------------------------------------------- 1 | fn main() { let cl = const || _ = 0; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | CONST 3 | CONST_KW "const" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "C" 7 | COLON ":" 8 | WHITESPACE " " 9 | PATH_TYPE 10 | PATH 11 | PATH_SEGMENT 12 | NAME_REF 13 | IDENT "u32" 14 | WHITESPACE " " 15 | EQ "=" 16 | WHITESPACE " " 17 | LITERAL 18 | INT_NUMBER "92" 19 | SEMICOLON ";" 20 | WHITESPACE "\n" 21 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_item.rs: -------------------------------------------------------------------------------- 1 | const C: u32 = 92; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_param.rs: -------------------------------------------------------------------------------- 1 | struct S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_param_default_expression.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_param_default_literal.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_param_default_path.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_trait_bound.rs: -------------------------------------------------------------------------------- 1 | const fn foo(_: impl const Trait) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/const_where_clause.rs: -------------------------------------------------------------------------------- 1 | const C: u32 = 0 2 | where i32: Copy; 3 | trait Foo { 4 | const C: i32 where i32: Copy; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/continue_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | loop { 3 | continue; 4 | continue 'l; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/crate_path.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH 8 | PATH_SEGMENT 9 | NAME_REF 10 | CRATE_KW "crate" 11 | COLON2 "::" 12 | PATH_SEGMENT 13 | NAME_REF 14 | IDENT "foo" 15 | SEMICOLON ";" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/crate_path.rs: -------------------------------------------------------------------------------- 1 | use crate::foo; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/crate_visibility.rs: -------------------------------------------------------------------------------- 1 | pub(crate) struct S; 2 | pub(self) struct S; 3 | pub(super) struct S; 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/crate_visibility_in.rs: -------------------------------------------------------------------------------- 1 | pub(in super::A) struct S; 2 | pub(in crate) struct S; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/default_async_fn.rs: -------------------------------------------------------------------------------- 1 | impl T for Foo { 2 | default async fn foo() {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/default_async_unsafe_fn.rs: -------------------------------------------------------------------------------- 1 | impl T for Foo { 2 | default async unsafe fn foo() {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/default_item.rs: -------------------------------------------------------------------------------- 1 | default impl T for Foo {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/default_unsafe_item.rs: -------------------------------------------------------------------------------- 1 | default unsafe impl T for Foo { 2 | default unsafe fn foo() {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/destructuring_assignment_struct_rest_pattern.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | S { .. } = S {}; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/destructuring_assignment_wildcard_pat.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | _ = 1; 3 | Some(_) = None; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/dyn_trait_type.rs: -------------------------------------------------------------------------------- 1 | type A = dyn Iterator> + 'a; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/dyn_trait_type_weak.rs: -------------------------------------------------------------------------------- 1 | // 2015 2 | type DynPlain = dyn Path; 3 | type DynRef = &dyn Path; 4 | type DynLt = dyn 'a + Path; 5 | type DynQuestion = dyn ?Path; 6 | type DynFor = dyn for<'a> Path; 7 | type DynParen = dyn(Path); 8 | type Path = dyn::Path; 9 | type Generic = dyn; 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/edition_2015_dyn_prefix_inside_generic_arg.rs: -------------------------------------------------------------------------------- 1 | // 2015 2 | type A = Foo; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/effect_blocks.rs: -------------------------------------------------------------------------------- 1 | fn f() { unsafe { } } 2 | fn f() { const { } } 3 | fn f() { async { } } 4 | fn f() { async move { } } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/exclusive_range_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | match 42 { 3 | ..0 => {} 4 | 1..2 => {} 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/expr_literals.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let _ = true; 3 | let _ = false; 4 | let _ = 1; 5 | let _ = 2.0; 6 | let _ = b'a'; 7 | let _ = 'b'; 8 | let _ = "c"; 9 | let _ = r"d"; 10 | let _ = b"e"; 11 | let _ = br"f"; 12 | let _ = c"g"; 13 | let _ = cr"h"; 14 | } 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/expression_after_block.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let mut p = F{x: 5}; 3 | {p}.x = 10; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/extern_block.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | EXTERN_BLOCK 3 | UNSAFE_KW "unsafe" 4 | WHITESPACE " " 5 | ABI 6 | EXTERN_KW "extern" 7 | WHITESPACE " " 8 | STRING "\"C\"" 9 | WHITESPACE " " 10 | EXTERN_ITEM_LIST 11 | L_CURLY "{" 12 | R_CURLY "}" 13 | WHITESPACE "\n" 14 | EXTERN_BLOCK 15 | ABI 16 | EXTERN_KW "extern" 17 | WHITESPACE " " 18 | EXTERN_ITEM_LIST 19 | L_CURLY "{" 20 | R_CURLY "}" 21 | WHITESPACE "\n" 22 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/extern_block.rs: -------------------------------------------------------------------------------- 1 | unsafe extern "C" {} 2 | extern {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/extern_crate.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | EXTERN_CRATE 3 | EXTERN_KW "extern" 4 | WHITESPACE " " 5 | CRATE_KW "crate" 6 | WHITESPACE " " 7 | NAME_REF 8 | IDENT "foo" 9 | SEMICOLON ";" 10 | WHITESPACE "\n" 11 | EXTERN_CRATE 12 | EXTERN_KW "extern" 13 | WHITESPACE " " 14 | CRATE_KW "crate" 15 | WHITESPACE " " 16 | NAME_REF 17 | SELF_KW "self" 18 | SEMICOLON ";" 19 | WHITESPACE "\n" 20 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/extern_crate.rs: -------------------------------------------------------------------------------- 1 | extern crate foo; 2 | extern crate self; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/extern_crate_rename.rs: -------------------------------------------------------------------------------- 1 | extern crate foo as bar; 2 | extern crate self as bar; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/field_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | x.self; 3 | x.Self; 4 | x.foo; 5 | x.0.bar; 6 | x.0.1; 7 | x.0. bar; 8 | x.0(); 9 | } 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | FN 3 | FN_KW "fn" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "foo" 7 | PARAM_LIST 8 | L_PAREN "(" 9 | R_PAREN ")" 10 | WHITESPACE " " 11 | BLOCK_EXPR 12 | STMT_LIST 13 | L_CURLY "{" 14 | R_CURLY "}" 15 | WHITESPACE "\n" 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_.rs: -------------------------------------------------------------------------------- 1 | fn foo() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_decl.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TRAIT 3 | TRAIT_KW "trait" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | ASSOC_ITEM_LIST 9 | L_CURLY "{" 10 | WHITESPACE " " 11 | FN 12 | FN_KW "fn" 13 | WHITESPACE " " 14 | NAME 15 | IDENT "foo" 16 | PARAM_LIST 17 | L_PAREN "(" 18 | R_PAREN ")" 19 | SEMICOLON ";" 20 | WHITESPACE " " 21 | R_CURLY "}" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_decl.rs: -------------------------------------------------------------------------------- 1 | trait T { fn foo(); } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_def_param.rs: -------------------------------------------------------------------------------- 1 | fn foo(..., (x, y): (i32, i32)) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_pointer_param_ident_path.rs: -------------------------------------------------------------------------------- 1 | type Foo = fn(Bar::Baz); 2 | type Qux = fn(baz: Bar::Baz); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_pointer_type.rs: -------------------------------------------------------------------------------- 1 | type A = fn(); 2 | type B = unsafe fn(); 3 | type C = unsafe extern "C" fn(); 4 | type D = extern "C" fn ( u8 , ... ) -> u8; 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_pointer_type_with_ret.rs: -------------------------------------------------------------------------------- 1 | type F = fn() -> (); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/fn_pointer_unnamed_arg.rs: -------------------------------------------------------------------------------- 1 | type Foo = fn(_: bar); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/for_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | for x in [] {}; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/for_range_from.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | for x in 0 .. { 3 | break; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/for_type.rs: -------------------------------------------------------------------------------- 1 | type A = for<'a> fn() -> (); 2 | type B = for<'a> unsafe extern "C" fn(&'a ()) -> (); 3 | type Obj = for<'a> PartialEq<&'a i32>; 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/full_range_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { xs[..]; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/function_ret_type.rs: -------------------------------------------------------------------------------- 1 | fn foo() {} 2 | fn bar() -> () {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/function_type_params.rs: -------------------------------------------------------------------------------- 1 | fn foo(){} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/function_where_clause.rs: -------------------------------------------------------------------------------- 1 | fn foo() where T: Copy {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/gen_blocks.rs: -------------------------------------------------------------------------------- 1 | // 2024 2 | pub fn main() { 3 | gen { yield ""; }; 4 | async gen { yield ""; }; 5 | gen move { yield ""; }; 6 | async gen move { yield ""; }; 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/generic_arg.rs: -------------------------------------------------------------------------------- 1 | type T = S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/generic_arg_bounds.rs: -------------------------------------------------------------------------------- 1 | type Plain = Foo; 2 | type GenericArgs = Foo, Item::, Item: Bound, Item::: Bound, Item = Item, Item:: = Item>; 3 | type ParenthesizedArgs = Foo; 4 | type RTN = Foo; 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/generic_const.rs: -------------------------------------------------------------------------------- 1 | const C: u32 = 0; 2 | impl Foo { 3 | const C<'a>: &'a () = &(); 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/generic_param_attribute.rs: -------------------------------------------------------------------------------- 1 | fn foo<#[lt_attr] 'a, #[t_attr] T>() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/generic_param_list.rs: -------------------------------------------------------------------------------- 1 | fn f() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/half_open_range_pat.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let 0 .. = 1u32; 3 | let 0..: _ = 1u32; 4 | 5 | match 42 { 6 | 0 .. if true => (), 7 | _ => (), 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/if_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | if true {}; 3 | if true {} else {}; 4 | if true {} else if false {} else {}; 5 | if S {}; 6 | if { true } { } else { }; 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | IMPL 3 | IMPL_KW "impl" 4 | WHITESPACE " " 5 | PATH_TYPE 6 | PATH 7 | PATH_SEGMENT 8 | NAME_REF 9 | IDENT "S" 10 | WHITESPACE " " 11 | ASSOC_ITEM_LIST 12 | L_CURLY "{" 13 | R_CURLY "}" 14 | WHITESPACE "\n" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_item.rs: -------------------------------------------------------------------------------- 1 | impl S {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_item_const.rs: -------------------------------------------------------------------------------- 1 | impl const Send for S {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_item_neg.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | IMPL 3 | IMPL_KW "impl" 4 | WHITESPACE " " 5 | BANG "!" 6 | PATH_TYPE 7 | PATH 8 | PATH_SEGMENT 9 | NAME_REF 10 | IDENT "Send" 11 | WHITESPACE " " 12 | FOR_KW "for" 13 | WHITESPACE " " 14 | PATH_TYPE 15 | PATH 16 | PATH_SEGMENT 17 | NAME_REF 18 | IDENT "S" 19 | WHITESPACE " " 20 | ASSOC_ITEM_LIST 21 | L_CURLY "{" 22 | R_CURLY "}" 23 | WHITESPACE "\n" 24 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_item_neg.rs: -------------------------------------------------------------------------------- 1 | impl !Send for S {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_trait_type.rs: -------------------------------------------------------------------------------- 1 | type A = impl Iterator> + 'a; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/impl_type_params.rs: -------------------------------------------------------------------------------- 1 | impl Bar {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/index_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | x[1][2]; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/label.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | 'a: loop {} 3 | 'b: while true {} 4 | 'c: for x in () {} 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/labeled_block.rs: -------------------------------------------------------------------------------- 1 | fn f() { 'label: {}; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/lambda_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | || (); 3 | || -> i32 { 92 }; 4 | |x| x; 5 | move |x: i32,| x; 6 | async || {}; 7 | move || {}; 8 | async move || {}; 9 | static || {}; 10 | static move || {}; 11 | static async || {}; 12 | static async move || {}; 13 | for<'a> || {}; 14 | for<'a> move || {}; 15 | } 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/lambda_ret_block.rs: -------------------------------------------------------------------------------- 1 | fn main() { || -> i32 { 92 }(); } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/let_else.rs: -------------------------------------------------------------------------------- 1 | fn f() { let Some(x) = opt else { return }; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/let_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | if let Some(_) = None && true {} 3 | while 1 == 5 && (let None = None) {} 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/let_stmt.rs: -------------------------------------------------------------------------------- 1 | fn f() { let x: i32 = 92; super let y; super::foo; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/let_stmt_ascription.rs: -------------------------------------------------------------------------------- 1 | fn f() { let x: i32; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/let_stmt_init.rs: -------------------------------------------------------------------------------- 1 | fn f() { let x = 92; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/lifetime_arg.rs: -------------------------------------------------------------------------------- 1 | type T = S<'static>; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/lifetime_param.rs: -------------------------------------------------------------------------------- 1 | fn f<'a: 'b>() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/literal_pattern.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | match () { 3 | -1 => (), 4 | 92 => (), 5 | 'c' => (), 6 | "hello" => (), 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/loop_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | loop {}; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_call_type.rs: -------------------------------------------------------------------------------- 1 | type A = foo!(); 2 | type B = crate::foo!(); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_def.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | MACRO_DEF 3 | MACRO_KW "macro" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "m" 7 | TOKEN_TREE 8 | L_PAREN "(" 9 | DOLLAR "$" 10 | IDENT "i" 11 | COLON ":" 12 | IDENT "ident" 13 | R_PAREN ")" 14 | WHITESPACE " " 15 | TOKEN_TREE 16 | L_CURLY "{" 17 | R_CURLY "}" 18 | WHITESPACE "\n" 19 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_def.rs: -------------------------------------------------------------------------------- 1 | macro m($i:ident) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_def_curly.rs: -------------------------------------------------------------------------------- 1 | macro m { ($i:ident) => {} } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_inside_generic_arg.rs: -------------------------------------------------------------------------------- 1 | type A = Foo; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_rules_as_macro_name.rs: -------------------------------------------------------------------------------- 1 | macro_rules! {} 2 | macro_rules! (); 3 | macro_rules! []; 4 | fn main() { 5 | let foo = macro_rules!(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/macro_rules_non_brace.rs: -------------------------------------------------------------------------------- 1 | macro_rules! m ( ($i:ident) => {} ); 2 | macro_rules! m [ ($i:ident) => {} ]; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/marco_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let m!(x) = 0; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_arm.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => (), 4 | _ if Test > Test{field: 0} => (), 5 | X | Y if Z => (), 6 | | X | Y if Z => (), 7 | | X => (), 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_arms_commas.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => (), 4 | _ => {} 5 | _ => () 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_arms_inner_attribute.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | #![doc("Inner attribute")] 4 | #![doc("Can be")] 5 | #![doc("Stacked")] 6 | _ => (), 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_arms_outer_attributes.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | #[cfg(feature = "some")] 4 | _ => (), 5 | #[cfg(feature = "other")] 6 | _ => (), 7 | #[cfg(feature = "many")] 8 | #[cfg(feature = "attributes")] 9 | #[cfg(feature = "before")] 10 | _ => (), 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { }; 3 | match S {}; 4 | match { } { _ => () }; 5 | match { S {} } {}; 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/match_guard.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ if foo => (), 4 | _ if let foo = bar => (), 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/method_call_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | x.foo(); 3 | y.bar::(1, 2,); 4 | x.0.0.call(); 5 | x.0. call(); 6 | x.0() 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/mod_contents.rs: -------------------------------------------------------------------------------- 1 | fn foo() {} 2 | macro_rules! foo {} 3 | foo::bar!(); 4 | super::baz! {} 5 | struct S; 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/mod_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | MODULE 3 | MOD_KW "mod" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "a" 7 | SEMICOLON ";" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/mod_item.rs: -------------------------------------------------------------------------------- 1 | mod a; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/mod_item_curly.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | MODULE 3 | MOD_KW "mod" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "b" 7 | WHITESPACE " " 8 | ITEM_LIST 9 | L_CURLY "{" 10 | WHITESPACE " " 11 | R_CURLY "}" 12 | WHITESPACE "\n" 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/mod_item_curly.rs: -------------------------------------------------------------------------------- 1 | mod b { } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/never_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "Never" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | NEVER_TYPE 11 | BANG "!" 12 | SEMICOLON ";" 13 | WHITESPACE "\n" 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/never_type.rs: -------------------------------------------------------------------------------- 1 | type Never = !; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/no_dyn_trait_leading_for.rs: -------------------------------------------------------------------------------- 1 | type A = for<'a> Test<'a> + Send; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/no_semi_after_block.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | if true {} 3 | loop {} 4 | match () {} 5 | while true {} 6 | for _ in () {} 7 | {} 8 | {} 9 | macro_rules! test { 10 | () => {} 11 | } 12 | test!{} 13 | } 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/nocontentexpr.rs: -------------------------------------------------------------------------------- 1 | fn foo(){ 2 | ;;;some_expr();;;;{;;;};;;;Ok(()) 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/nocontentexpr_after_item.rs: -------------------------------------------------------------------------------- 1 | fn simple_function() { 2 | enum LocalEnum { 3 | One, 4 | Two, 5 | }; 6 | fn f() {}; 7 | struct S {}; 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/offset_of_parens.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | builtin#offset_of(Foo, (bar.baz.0)); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/or_pattern.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | match () { 3 | (_ | _) => (), 4 | &(_ | _) => (), 5 | (_ | _,) => (), 6 | [_ | _,] => (), 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/param_list.rs: -------------------------------------------------------------------------------- 1 | fn a() {} 2 | fn b(x: i32) {} 3 | fn c(x: i32, ) {} 4 | fn d(x: i32, y: ()) {} 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/param_list_vararg.rs: -------------------------------------------------------------------------------- 1 | extern "C" { fn printf(format: *const i8, ..., _: u8) -> i32; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/param_outer_arg.rs: -------------------------------------------------------------------------------- 1 | fn f(#[attr1] pat: Type) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/paren_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | PAREN_TYPE 11 | L_PAREN "(" 12 | PATH_TYPE 13 | PATH 14 | PATH_SEGMENT 15 | NAME_REF 16 | IDENT "i32" 17 | R_PAREN ")" 18 | SEMICOLON ";" 19 | WHITESPACE "\n" 20 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/paren_type.rs: -------------------------------------------------------------------------------- 1 | type T = (i32); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/path_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let _ = a; 3 | let _ = a::b; 4 | let _ = ::a::; 5 | let _ = format!(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/path_fn_trait_args.rs: -------------------------------------------------------------------------------- 1 | type F = Box ()>; 2 | type F = Box<::Fn(i32) -> ()>; 3 | type F = Box ()>; 4 | type F = Box<::Fn::(i32) -> ()>; 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/path_part.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let foo::Bar = (); 3 | let ::Bar = (); 4 | let Bar { .. } = (); 5 | let Bar(..) = (); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/path_type.rs: -------------------------------------------------------------------------------- 1 | type A = Foo; 2 | type B = ::Foo; 3 | type C = self::Foo; 4 | type D = super::Foo; 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/path_type_with_bounds.rs: -------------------------------------------------------------------------------- 1 | fn foo() -> Box {} 2 | fn foo() -> Box {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/placeholder_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = (); } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/placeholder_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "Placeholder" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | INFER_TYPE 11 | UNDERSCORE "_" 12 | SEMICOLON ";" 13 | WHITESPACE "\n" 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/placeholder_type.rs: -------------------------------------------------------------------------------- 1 | type Placeholder = _; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/pointer_type_mut.rs: -------------------------------------------------------------------------------- 1 | type M = *mut (); 2 | type C = *mut (); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/postfix_range.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let x = 1..; 3 | match 1.. { _ => () }; 4 | match a.b()..S { _ => () }; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/precise_capturing.rs: -------------------------------------------------------------------------------- 1 | fn captures<'a: 'a, 'b: 'b, T>() -> impl Sized + use<'b, T, Self> {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/pub_parens_typepath.rs: -------------------------------------------------------------------------------- 1 | struct B(pub (super::A)); 2 | struct B(pub (crate::A,)); 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/pub_tuple_field.rs: -------------------------------------------------------------------------------- 1 | struct MyStruct(pub (u32, u32)); 2 | struct MyStruct(pub (u32)); 3 | struct MyStruct(pub ()); 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/qual_paths.rs: -------------------------------------------------------------------------------- 1 | type X = ::Output; 2 | fn foo() { ::default(); } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/question_for_type_trait_bound.rs: -------------------------------------------------------------------------------- 1 | fn f() where T: ?for<> Sized {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_field_attrs.rs: -------------------------------------------------------------------------------- 1 | struct S { #[attr] f: f32 } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_field_default_values.rs: -------------------------------------------------------------------------------- 1 | struct S { f: f32 = 0.0 } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_field_list.rs: -------------------------------------------------------------------------------- 1 | struct S { a: i32, b: f32, unsafe c: u8 } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_field_pat_leading_or.rs: -------------------------------------------------------------------------------- 1 | fn foo() { let R { a: | 1 | 2 } = 0; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_lit.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | S {}; 3 | S { x }; 4 | S { x, y: 32, }; 5 | S { x, y: 32, ..Default::default() }; 6 | S { x, y: 32, .. }; 7 | S { .. }; 8 | S { x: ::default() }; 9 | TupleStruct { 0: 1 }; 10 | } 11 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_literal_field_with_attr.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | S { #[cfg(test)] field: 1 } 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_pat_field.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let S { 0: 1 } = (); 3 | let S { x: 1 } = (); 4 | let S { #[cfg(any())] x: 1 } = (); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/record_pat_field_list.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let S {} = (); 3 | let S { f, ref mut g } = (); 4 | let S { h: _, ..} = (); 5 | let S { h: _, } = (); 6 | let S { #[cfg(any())] .. } = (); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/ref_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | // reference operator 3 | let _ = &1; 4 | let _ = &mut &f(); 5 | let _ = &raw; 6 | let _ = &raw.0; 7 | // raw reference operator 8 | let _ = &raw mut foo; 9 | let _ = &raw const foo; 10 | let _ = &raw foo; 11 | } 12 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/ref_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let &a = (); 3 | let &mut b = (); 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/reference_type.rs: -------------------------------------------------------------------------------- 1 | type A = &(); 2 | type B = &'static (); 3 | type C = &mut (); 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/return_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | return; 3 | return 92; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/return_type_syntax_in_path.rs: -------------------------------------------------------------------------------- 1 | fn foo() 2 | where 3 | T::method(..): Send, 4 | method(..): Send, 5 | method::(..): Send, 6 | {} 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/safe_outside_of_extern.rs: -------------------------------------------------------------------------------- 1 | fn foo() { safe = true; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/self_param.rs: -------------------------------------------------------------------------------- 1 | impl S { 2 | fn a(self) {} 3 | fn b(&self,) {} 4 | fn c(&'a self,) {} 5 | fn d(&'a mut self, x: i32) {} 6 | fn e(mut self) {} 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/self_param_outer_attr.rs: -------------------------------------------------------------------------------- 1 | fn f(#[must_use] self) {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/singleton_tuple_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | TUPLE_TYPE 11 | L_PAREN "(" 12 | PATH_TYPE 13 | PATH 14 | PATH_SEGMENT 15 | NAME_REF 16 | IDENT "i32" 17 | COMMA "," 18 | R_PAREN ")" 19 | SEMICOLON ";" 20 | WHITESPACE "\n" 21 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/singleton_tuple_type.rs: -------------------------------------------------------------------------------- 1 | type T = (i32,); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/slice_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let [a, b, ..] = []; 3 | let [| a, ..] = []; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/slice_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | SLICE_TYPE 11 | L_BRACK "[" 12 | TUPLE_TYPE 13 | L_PAREN "(" 14 | R_PAREN ")" 15 | R_BRACK "]" 16 | SEMICOLON ";" 17 | WHITESPACE "\n" 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/slice_type.rs: -------------------------------------------------------------------------------- 1 | type T = [()]; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/stmt_bin_expr_ambiguity.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | let _ = {1} & 2; 3 | {1} &2; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/stmt_postfix_expr_ambiguity.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | match () { 3 | _ => {} 4 | () => {} 5 | [] => {} 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/struct_initializer_with_defaults.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let _s = S { .. }; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/struct_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | STRUCT 3 | STRUCT_KW "struct" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "S" 7 | WHITESPACE " " 8 | RECORD_FIELD_LIST 9 | L_CURLY "{" 10 | R_CURLY "}" 11 | WHITESPACE "\n" 12 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/struct_item.rs: -------------------------------------------------------------------------------- 1 | struct S {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_alias.rs: -------------------------------------------------------------------------------- 1 | trait Z = T; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_alias_where_clause.rs: -------------------------------------------------------------------------------- 1 | trait Z = T where U: Copy; 2 | trait Z = where Self: T; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_item.rs: -------------------------------------------------------------------------------- 1 | trait T { fn new() -> Self; } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_item_bounds.rs: -------------------------------------------------------------------------------- 1 | trait T: Hash + Clone {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_item_generic_params.rs: -------------------------------------------------------------------------------- 1 | trait X {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/trait_item_where_clause.rs: -------------------------------------------------------------------------------- 1 | trait T where Self: Copy {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/try_block_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let _ = try {}; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/try_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | x?; 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/try_macro_fallback.rs: -------------------------------------------------------------------------------- 1 | // 2015 2 | fn foo() { try!(Ok(())); } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/try_macro_rules.rs: -------------------------------------------------------------------------------- 1 | // 2015 2 | macro_rules! try { () => {} } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_attrs.rs: -------------------------------------------------------------------------------- 1 | const A: (i64, i64) = (1, #[cfg(test)] 2); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | (); 3 | (1); 4 | (1,); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_field_attrs.rs: -------------------------------------------------------------------------------- 1 | struct S (#[attr] f32); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_pat.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (a, b, ..) = (); 3 | let (a,) = (); 4 | let (..) = (); 5 | let () = (); 6 | let (| a | a, | b) = ((),()); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_pat_fields.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let S() = (); 3 | let S(_) = (); 4 | let S(_,) = (); 5 | let S(_, .. , x) = (); 6 | let S(| a) = (); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_struct.rs: -------------------------------------------------------------------------------- 1 | struct S(String, usize); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/tuple_struct_where.rs: -------------------------------------------------------------------------------- 1 | struct S(T) where T: Clone; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_alias.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "Foo" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | PATH_TYPE 11 | PATH 12 | PATH_SEGMENT 13 | NAME_REF 14 | IDENT "Bar" 15 | SEMICOLON ";" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_alias.rs: -------------------------------------------------------------------------------- 1 | type Foo = Bar; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_item_type_params.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "Result" 7 | GENERIC_PARAM_LIST 8 | L_ANGLE "<" 9 | TYPE_PARAM 10 | NAME 11 | IDENT "T" 12 | R_ANGLE ">" 13 | WHITESPACE " " 14 | EQ "=" 15 | WHITESPACE " " 16 | TUPLE_TYPE 17 | L_PAREN "(" 18 | R_PAREN ")" 19 | SEMICOLON ";" 20 | WHITESPACE "\n" 21 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_item_type_params.rs: -------------------------------------------------------------------------------- 1 | type Result = (); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_item_where_clause.rs: -------------------------------------------------------------------------------- 1 | type Foo = () where Foo: Copy; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_item_where_clause_deprecated.rs: -------------------------------------------------------------------------------- 1 | type Foo where Foo: Copy = (); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_param.rs: -------------------------------------------------------------------------------- 1 | fn f() {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_param_bounds.rs: -------------------------------------------------------------------------------- 1 | struct S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_param_default.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | STRUCT 3 | STRUCT_KW "struct" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "S" 7 | GENERIC_PARAM_LIST 8 | L_ANGLE "<" 9 | TYPE_PARAM 10 | NAME 11 | IDENT "T" 12 | WHITESPACE " " 13 | EQ "=" 14 | WHITESPACE " " 15 | PATH_TYPE 16 | PATH 17 | PATH_SEGMENT 18 | NAME_REF 19 | IDENT "i32" 20 | R_ANGLE ">" 21 | SEMICOLON ";" 22 | WHITESPACE "\n" 23 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_param_default.rs: -------------------------------------------------------------------------------- 1 | struct S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/type_path_in_pattern.rs: -------------------------------------------------------------------------------- 1 | fn main() { let <_>::Foo = (); } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/typepathfn_with_coloncolon.rs: -------------------------------------------------------------------------------- 1 | type F = Start::(Middle) -> (Middle)::End; 2 | type GenericArg = S; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/unary_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | **&1; 3 | !!true; 4 | --1; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/union_item.rs: -------------------------------------------------------------------------------- 1 | struct U { i: i32, f: f32 } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/unit_struct.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | STRUCT 3 | STRUCT_KW "struct" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "S" 7 | SEMICOLON ";" 8 | WHITESPACE "\n" 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/unit_struct.rs: -------------------------------------------------------------------------------- 1 | struct S; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/unit_type.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | TYPE_ALIAS 3 | TYPE_KW "type" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "T" 7 | WHITESPACE " " 8 | EQ "=" 9 | WHITESPACE " " 10 | TUPLE_TYPE 11 | L_PAREN "(" 12 | R_PAREN ")" 13 | SEMICOLON ";" 14 | WHITESPACE "\n" 15 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/unit_type.rs: -------------------------------------------------------------------------------- 1 | type T = (); 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH 8 | PATH_SEGMENT 9 | NAME_REF 10 | IDENT "std" 11 | COLON2 "::" 12 | PATH_SEGMENT 13 | NAME_REF 14 | IDENT "collections" 15 | SEMICOLON ";" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_item.rs: -------------------------------------------------------------------------------- 1 | use std::collections; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree.rs: -------------------------------------------------------------------------------- 1 | use outer::tree::{inner::tree}; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_abs_star.rs: -------------------------------------------------------------------------------- 1 | use ::*; 2 | use std::{::*}; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_alias.rs: -------------------------------------------------------------------------------- 1 | use std as stdlib; 2 | use Trait as _; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_list.rs: -------------------------------------------------------------------------------- 1 | use {a, b, c}; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_path.rs: -------------------------------------------------------------------------------- 1 | use ::std; 2 | use std::collections; 3 | 4 | use self::m; 5 | use super::m; 6 | use crate::m; 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_path_star.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH_SEGMENT 8 | NAME_REF 9 | IDENT "std" 10 | COLON2 "::" 11 | STAR "*" 12 | SEMICOLON ";" 13 | WHITESPACE "\n" 14 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_path_star.rs: -------------------------------------------------------------------------------- 1 | use std::*; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_path_use_tree.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH_SEGMENT 8 | NAME_REF 9 | IDENT "std" 10 | COLON2 "::" 11 | USE_TREE_LIST 12 | L_CURLY "{" 13 | USE_TREE 14 | PATH 15 | PATH_SEGMENT 16 | NAME_REF 17 | IDENT "collections" 18 | R_CURLY "}" 19 | SEMICOLON ";" 20 | WHITESPACE "\n" 21 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_path_use_tree.rs: -------------------------------------------------------------------------------- 1 | use std::{collections}; 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_star.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | STAR "*" 7 | SEMICOLON ";" 8 | WHITESPACE "\n" 9 | USE 10 | USE_KW "use" 11 | WHITESPACE " " 12 | USE_TREE 13 | PATH 14 | PATH_SEGMENT 15 | NAME_REF 16 | IDENT "std" 17 | COLON2 "::" 18 | USE_TREE_LIST 19 | L_CURLY "{" 20 | USE_TREE 21 | STAR "*" 22 | R_CURLY "}" 23 | SEMICOLON ";" 24 | WHITESPACE "\n" 25 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/use_tree_star.rs: -------------------------------------------------------------------------------- 1 | use *; 2 | use std::{*}; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/variant_discriminant.rs: -------------------------------------------------------------------------------- 1 | enum E { X(i32) = 10 } 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/where_clause.rs: -------------------------------------------------------------------------------- 1 | fn foo() 2 | where 3 | 'a: 'b + 'c, 4 | T: Clone + Copy + 'static, 5 | Iterator::Item: 'a, 6 | ::Item: 'a 7 | {} 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/where_pred_for.rs: -------------------------------------------------------------------------------- 1 | fn for_trait() 2 | where 3 | for<'a> F: Fn(&'a str) 4 | { } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/while_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | while true {}; 3 | while let Some(x) = it.next() {}; 4 | while { true } {}; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/yeet_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | do yeet; 3 | do yeet 1 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/inline/ok/yield_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | yield; 3 | yield 1; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0000_empty.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0000_empty.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-analyzer/b9e667135375f6f1eb70206930458086b16101c1/crates/parser/test_data/parser/ok/0000_empty.rs -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0001_struct_item.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | f: T, 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0002_struct_item_field.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | foo: u32 3 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0004_file_shebang.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | SHEBANG "#!/use/bin/env rusti" 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0004_file_shebang.rs: -------------------------------------------------------------------------------- 1 | #!/use/bin/env rusti -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0005_fn_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | FN 3 | FN_KW "fn" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "foo" 7 | PARAM_LIST 8 | L_PAREN "(" 9 | R_PAREN ")" 10 | WHITESPACE " " 11 | BLOCK_EXPR 12 | STMT_LIST 13 | L_CURLY "{" 14 | WHITESPACE "\n" 15 | R_CURLY "}" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0005_fn_item.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0006_inner_attributes.rs: -------------------------------------------------------------------------------- 1 | #![attr] 2 | #![attr(true)] 3 | #![attr(ident)] 4 | #![attr(ident, 100, true, "true", ident = 100, ident = "hello", ident(100))] 5 | #![attr(100)] 6 | #![attr(enabled = true)] 7 | #![enabled(true)] 8 | #![attr("hello")] 9 | #![repr(C, align = 4)] 10 | #![repr(C, align(4))] -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0007_extern_crate.rs: -------------------------------------------------------------------------------- 1 | extern crate foo; 2 | extern crate foo as bar; 3 | extern crate self as baz; 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0008_mod_item.rs: -------------------------------------------------------------------------------- 1 | mod c { 2 | fn foo() { 3 | } 4 | struct S {} 5 | } 6 | 7 | mod d { 8 | #![attr] 9 | mod e; 10 | mod f { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0009_use_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | USE 3 | USE_KW "use" 4 | WHITESPACE " " 5 | USE_TREE 6 | PATH 7 | PATH_SEGMENT 8 | NAME_REF 9 | IDENT "foo" 10 | SEMICOLON ";" 11 | WHITESPACE "\n" 12 | USE 13 | USE_KW "use" 14 | WHITESPACE " " 15 | USE_TREE 16 | PATH 17 | PATH_SEGMENT 18 | COLON2 "::" 19 | NAME_REF 20 | IDENT "bar" 21 | SEMICOLON ";" 22 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0009_use_item.rs: -------------------------------------------------------------------------------- 1 | use foo; 2 | use ::bar; -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0010_use_path_segments.rs: -------------------------------------------------------------------------------- 1 | use ::foo::bar::baz; 2 | use foo::bar::baz; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0011_outer_attribute.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | #[Ignore] 3 | fn foo() {} 4 | 5 | #[path = "a.rs"] 6 | mod b; 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0012_visibility.rs: -------------------------------------------------------------------------------- 1 | fn a() {} 2 | pub fn b() {} 3 | pub macro m($:ident) {} 4 | pub(crate) fn c() {} 5 | pub(super) fn d() {} 6 | pub(in foo::bar::baz) fn e() {} 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0013_use_path_self_super.rs: -------------------------------------------------------------------------------- 1 | use self::foo; 2 | use super::super::bar; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0014_use_tree.rs: -------------------------------------------------------------------------------- 1 | use *; 2 | use ::*; 3 | use ::{}; 4 | use {}; 5 | use foo::*; 6 | use foo::{}; 7 | use ::foo::{a, b, c}; 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0015_use_tree.rs: -------------------------------------------------------------------------------- 1 | use foo as bar; 2 | use foo::{a as b, *, ::*, ::foo as x}; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0016_struct_flavors.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | struct B {} 3 | struct C(); 4 | 5 | struct D { 6 | a: u32, 7 | pub b: u32 8 | } 9 | 10 | struct E(pub x, y,); 11 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0017_attr_trailing_comma.rs: -------------------------------------------------------------------------------- 1 | #[foo(a,)] 2 | fn foo() {} 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0018_struct_type_params.rs: -------------------------------------------------------------------------------- 1 | struct S1; 2 | struct S2(u32); 3 | struct S3 { u: u32 } 4 | 5 | struct S4<>; 6 | struct S5<'a>; 7 | struct S6<'a:>; 8 | struct S7<'a: 'b>; 9 | struct S8<'a: 'b + >; 10 | struct S9<'a: 'b + 'c>; 11 | struct S10<'a,>; 12 | struct S11<'a, 'b>; 13 | struct S12<'a: 'b+, 'b: 'c,>; 14 | 15 | struct S13; 16 | struct S14; 17 | struct S15<'a, T, U>; 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0019_enums.rs: -------------------------------------------------------------------------------- 1 | enum E1 { 2 | } 3 | 4 | enum E2 { 5 | } 6 | 7 | enum E3 { 8 | X 9 | } 10 | 11 | enum E4 { 12 | X, 13 | } 14 | 15 | enum E5 { 16 | A, 17 | B = 92, 18 | C { 19 | a: u32, 20 | pub b: f64, 21 | }, 22 | F {}, 23 | D(u32,), 24 | E(), 25 | } 26 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0020_type_param_bounds.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | struct B; 3 | struct C; 4 | struct D; 5 | struct E; 6 | struct F; 7 | struct G; 8 | struct H; 9 | struct I; 10 | struct K<'a: 'd, 'd: 'a + 'b, T: 'a + 'd + Clone>; -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0022_empty_extern_block.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | EXTERN_BLOCK 3 | ABI 4 | EXTERN_KW "extern" 5 | WHITESPACE " " 6 | EXTERN_ITEM_LIST 7 | L_CURLY "{" 8 | WHITESPACE "\n" 9 | R_CURLY "}" 10 | WHITESPACE "\n\n" 11 | EXTERN_BLOCK 12 | ABI 13 | EXTERN_KW "extern" 14 | WHITESPACE " " 15 | STRING "\"C\"" 16 | WHITESPACE " " 17 | EXTERN_ITEM_LIST 18 | L_CURLY "{" 19 | WHITESPACE "\n" 20 | R_CURLY "}" 21 | WHITESPACE "\n" 22 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0022_empty_extern_block.rs: -------------------------------------------------------------------------------- 1 | extern { 2 | } 3 | 4 | extern "C" { 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0023_static_items.rs: -------------------------------------------------------------------------------- 1 | static FOO: u32 = 1; 2 | static mut BAR: i32 = 92; 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0024_const_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0024_const_item.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-analyzer/b9e667135375f6f1eb70206930458086b16101c1/crates/parser/test_data/parser/ok/0024_const_item.rs -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0025_extern_fn_in_block.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | extern fn f() {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0026_const_fn_in_block.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | const fn f() {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | unsafe fn f() {} 3 | unsafe { 92 } 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0029_range_forms.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | ..1 + 1; 3 | ..z = 2; 4 | x = false..1 == 1; 5 | let x = 1..; 6 | 7 | ..=1 + 1; 8 | ..=z = 2; 9 | x = false..=1 == 1; 10 | let x = 1..; 11 | } 12 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0030_string_suffixes.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let _ = 'c'u32; 3 | let _ = "string"invalid; 4 | let _ = b'b'_suff; 5 | let _ = b"bs"invalid; 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0030_traits.rs: -------------------------------------------------------------------------------- 1 | trait Runnable { 2 | fn handler(); 3 | } 4 | 5 | trait TraitWithExpr { 6 | fn fn_with_expr(x: [i32; 1]); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0032_where_for.rs: -------------------------------------------------------------------------------- 1 | fn test_serialization() 2 | where 3 | SER: Serialize + for<'de> Deserialize<'de> + PartialEq + std::fmt::Debug, 4 | {} 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0034_crate_path_in_call.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | make_query(crate::module_map::module_tree); 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0036_fully_qualified.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/issues/311 2 | 3 | pub fn foo() -> String 4 | where 5 | ::Item: Eq, 6 | { 7 | "".to_owned() 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0037_mod.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | COMMENT "// https://github.com/rust-lang/rust-analyzer/issues/357" 3 | WHITESPACE "\n\n" 4 | COMMENT "//! docs" 5 | WHITESPACE "\n" 6 | MODULE 7 | COMMENT "// non-docs" 8 | WHITESPACE "\n" 9 | MOD_KW "mod" 10 | WHITESPACE " " 11 | NAME 12 | IDENT "foo" 13 | WHITESPACE " " 14 | ITEM_LIST 15 | L_CURLY "{" 16 | R_CURLY "}" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0037_mod.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/issues/357 2 | 3 | //! docs 4 | // non-docs 5 | mod foo {} -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0038_where_pred_type.rs: -------------------------------------------------------------------------------- 1 | fn test() where (u64, u64): Foo {} -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0039_raw_fn_item.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | FN 3 | FN_KW "fn" 4 | WHITESPACE " " 5 | NAME 6 | IDENT "r#foo" 7 | PARAM_LIST 8 | L_PAREN "(" 9 | R_PAREN ")" 10 | WHITESPACE " " 11 | BLOCK_EXPR 12 | STMT_LIST 13 | L_CURLY "{" 14 | WHITESPACE "\n" 15 | R_CURLY "}" 16 | WHITESPACE "\n" 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0039_raw_fn_item.rs: -------------------------------------------------------------------------------- 1 | fn r#foo() { 2 | } 3 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0040_raw_struct_item_field.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | r#foo: u32 3 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0041_raw_keywords.rs: -------------------------------------------------------------------------------- 1 | fn foo() { let r#struct = 92; let r#trait = r#struct * 2; } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0042_ufcs_call_list.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/issues/596 2 | 3 | struct Foo; 4 | 5 | impl Foo { 6 | fn bar() -> bool { 7 | unimplemented!() 8 | } 9 | } 10 | 11 | fn baz(_: bool) {} 12 | 13 | fn main() { 14 | baz(::bar()) 15 | } 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0043_complex_assignment.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/issues/674 2 | 3 | struct Repr { raw: [u8; 1] } 4 | 5 | fn abc() { 6 | Repr { raw: [0] }.raw[0] = 0; 7 | Repr{raw:[0]}(); 8 | } 9 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0044_let_attrs.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/issues/677 2 | fn main() { 3 | #[cfg(feature = "backtrace")] 4 | let exit_code = panic::catch_unwind(move || main()); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0046_extern_inner_attributes.rs: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | //! This is a doc comment 3 | #![doc("This is also a doc comment")] 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0048_compound_assignment.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-analyzer/pull/983 2 | 3 | fn compound_assignment() { 4 | let mut a = 0; 5 | a += 1; 6 | a -= 2; 7 | a *= 3; 8 | a %= 4; 9 | a /= 5; 10 | a |= 6; 11 | a &= 7; 12 | a ^= 8; 13 | a <= 9; 14 | a >= 10; 15 | a >>= 11; 16 | a <<= 12; 17 | } 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0049_async_block.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | async {}; 3 | async move {}; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0050_async_block_as_argument.rs: -------------------------------------------------------------------------------- 1 | fn foo(x: impl std::future::Future) {} 2 | 3 | fn main() { 4 | foo(async move { 12 }) 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0052_for_range_block.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | for _x in 0 .. (0 .. {1 + 2}).sum::() { 3 | break; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rs: -------------------------------------------------------------------------------- 1 | /// Some docs 2 | #[macro_export] 3 | macro_rules! foo { 4 | () => {}; 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.rs: -------------------------------------------------------------------------------- 1 | fn a() -> Foo {} 2 | 3 | fn b(_: impl FnMut(x::Y)) {} 4 | 5 | fn c(_: impl FnMut(&x::Y)) {} 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs: -------------------------------------------------------------------------------- 1 | type X = (); 2 | 3 | fn main() { 4 | let ():::X = (); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0056_neq_in_type.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | if 1.0f32.floor() as i64 != 1.0f32.floor() as i64 {} 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0057_loop_in_call.rs: -------------------------------------------------------------------------------- 1 | fn foo(x: i32) {} 2 | 3 | fn main() { 4 | foo(loop {}); 5 | } -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0058_unary_expr_precedence.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | 1 + *&2 + 3; 3 | *&1 as u64; 4 | *x(1); 5 | &x[1]; 6 | -1..2; 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0059_loops_in_parens.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | Some(for _ in [1].into_iter() {}); 3 | Some(loop { break; }); 4 | Some(while true {}); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0060_as_range.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | 0 as usize ..; 3 | 1 + 2 as usize ..; 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0061_match_full_range.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | match .. { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0062_macro_2.0.rs: -------------------------------------------------------------------------------- 1 | macro parse_use_trees($($s:expr),* $(,)*) { 2 | vec![ 3 | $(parse_use_tree($s),)* 4 | ] 5 | } 6 | 7 | #[test] 8 | fn test_use_tree_merge() { 9 | macro test_merge([$($input:expr),* $(,)*], [$($output:expr),* $(,)*]) { 10 | assert_eq!( 11 | merge_use_trees(parse_use_trees!($($input,)*)), 12 | parse_use_trees!($($output,)*), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0063_trait_fn_patterns.rs: -------------------------------------------------------------------------------- 1 | trait T { 2 | fn f1((a, b): (usize, usize)) {} 3 | fn f2(S { a, b }: S) {} 4 | fn f3(NewType(a): NewType) {} 5 | fn f4(&&a: &&usize) {} 6 | fn bar(_: u64, mut x: i32); 7 | } 8 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0063_variadic_fun.rs: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | fn a(_: *mut u8, ...,); 3 | fn b(_: *mut u8, _: ...); 4 | fn c(_: *mut u8, #[cfg(never)] [w, t, f]: ...,); 5 | } 6 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0064_impl_fn_params.rs: -------------------------------------------------------------------------------- 1 | impl U { 2 | fn f1((a, b): (usize, usize)) {} 3 | fn f2(S { a, b }: S) {} 4 | fn f3(NewType(a): NewType) {} 5 | fn f4(&&a: &&usize) {} 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0065_comment_newline.rast: -------------------------------------------------------------------------------- 1 | SOURCE_FILE 2 | FN 3 | COMMENT "/// Example" 4 | WHITESPACE "\n\n" 5 | FN_KW "fn" 6 | WHITESPACE " " 7 | NAME 8 | IDENT "test" 9 | PARAM_LIST 10 | L_PAREN "(" 11 | R_PAREN ")" 12 | WHITESPACE " " 13 | BLOCK_EXPR 14 | STMT_LIST 15 | L_CURLY "{" 16 | R_CURLY "}" 17 | WHITESPACE "\n" 18 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0065_comment_newline.rs: -------------------------------------------------------------------------------- 1 | /// Example 2 | 3 | fn test() {} 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.rs: -------------------------------------------------------------------------------- 1 | fn f() where T: Fn() -> u8 + Send {} 2 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0066_default_modifier.rs: -------------------------------------------------------------------------------- 1 | trait T { 2 | default type T = Bar; 3 | default const f: u8 = 0; 4 | default fn foo() {} 5 | default unsafe fn bar() {} 6 | } 7 | 8 | impl T for Foo { 9 | default type T = Bar; 10 | default const f: u8 = 0; 11 | default fn foo() {} 12 | default unsafe fn bar() {} 13 | } 14 | 15 | default impl T for () {} 16 | default unsafe impl T for () {} 17 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0068_item_modifiers.rs: -------------------------------------------------------------------------------- 1 | async fn foo() {} 2 | extern fn foo() {} 3 | const fn foo() {} 4 | const unsafe fn foo() {} 5 | unsafe extern "C" fn foo() {} 6 | unsafe fn foo() {} 7 | async unsafe fn foo() {} 8 | const unsafe fn bar() {} 9 | 10 | unsafe trait T {} 11 | auto trait T {} 12 | unsafe auto trait T {} 13 | 14 | unsafe impl Foo {} 15 | default impl Foo {} 16 | unsafe default impl Foo {} 17 | 18 | unsafe extern "C++" {} 19 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0069_multi_trait_object.rs: -------------------------------------------------------------------------------- 1 | type Foo<'a> = &'a (dyn Send + Sync); 2 | type Foo = *const (dyn Send + Sync); 3 | type Foo = fn() -> (dyn Send + 'static); 4 | fn main() { 5 | let b = (&a) as &(dyn Add + Other); 6 | } 7 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0070_expr_attr_placement.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | (#[a] lhs? + #[b] rhs.await) 3 | } 4 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0071_stmt_attr_placement.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | #[A] { #[B] bar!()? } 3 | #[C] &() 4 | } 5 | -------------------------------------------------------------------------------- /crates/parser/test_data/parser/ok/0072_destructuring_assignment.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | let (mut a, mut b) = (0, 1); 3 | (b, a, ..) = (a, b); 4 | (_) = ..; 5 | struct S { a: i32 } 6 | S { .. } = S { ..S::default() }; 7 | Some(..) = Some(0); 8 | Ok(_) = 0; 9 | let (a, b); 10 | [a, .., b] = [1, .., 2]; 11 | (_, _) = (a, b); 12 | (_) = (a, b); 13 | _ = (a, b); 14 | } 15 | -------------------------------------------------------------------------------- /crates/paths/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "paths" 3 | version = "0.0.0" 4 | repository.workspace = true 5 | description = "Path wrappers for absolute and relative paths rust-analyzer." 6 | 7 | authors.workspace = true 8 | edition.workspace = true 9 | license.workspace = true 10 | rust-version.workspace = true 11 | 12 | [lib] 13 | 14 | [dependencies] 15 | camino.workspace = true 16 | 17 | [features] 18 | serde1 = ["camino/serde1"] 19 | 20 | [lints] 21 | workspace = true 22 | -------------------------------------------------------------------------------- /crates/proc-macro-srv-cli/build.rs: -------------------------------------------------------------------------------- 1 | //! This teaches cargo about our cfg(rust_analyzer) 2 | 3 | fn main() { 4 | println!("cargo:rustc-check-cfg=cfg(rust_analyzer)"); 5 | } 6 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "proc-macro-test" 3 | version = "0.0.0" 4 | publish = false 5 | 6 | edition = "2024" 7 | license = "MIT OR Apache-2.0" 8 | 9 | [lib] 10 | 11 | [build-dependencies] 12 | cargo_metadata = "0.19.2" 13 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/imp/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/imp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "proc-macro-test-impl" 7 | version = "0.0.0" 8 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "proc-macro-test-impl" 3 | version = "0.0.0" 4 | license = "MIT OR Apache-2.0" 5 | edition = "2024" 6 | publish = false 7 | 8 | [lib] 9 | proc-macro = true 10 | 11 | [dependencies] 12 | # this crate should not have any dependencies, since it uses its own workspace, 13 | # and its own `Cargo.lock` 14 | 15 | [workspace] 16 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/imp/build.rs: -------------------------------------------------------------------------------- 1 | //! This teaches cargo about our cfg(rust_analyzer) 2 | 3 | fn main() { 4 | println!("cargo:rustc-check-cfg=cfg(rust_analyzer)"); 5 | } 6 | -------------------------------------------------------------------------------- /crates/proc-macro-srv/proc-macro-test/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Exports a few trivial procedural macros for testing. 2 | 3 | pub static PROC_MACRO_TEST_LOCATION: &str = env!("PROC_MACRO_TEST_LOCATION"); 4 | -------------------------------------------------------------------------------- /crates/project-model/test_data/hello-world-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "sysroot_src": null, 3 | "crates": [ 4 | { 5 | "display_name": "hello_world", 6 | "root_module": "$ROOT$src/lib.rs", 7 | "edition": "2018", 8 | "deps": [], 9 | "is_workspace_member": true 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /crates/rust-analyzer/src/cli/highlight.rs: -------------------------------------------------------------------------------- 1 | //! Read Rust code on stdin, print HTML highlighted version to stdout. 2 | 3 | use ide::Analysis; 4 | 5 | use crate::cli::{flags, read_stdin}; 6 | 7 | impl flags::Highlight { 8 | pub fn run(self) -> anyhow::Result<()> { 9 | let (analysis, file_id) = Analysis::from_single_file(read_stdin()?); 10 | let html = analysis.highlight_as_html(file_id, self.rainbow).unwrap(); 11 | println!("{html}"); 12 | Ok(()) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /crates/rust-analyzer/src/cli/symbols.rs: -------------------------------------------------------------------------------- 1 | //! Read Rust code on stdin, print syntax tree on stdout. 2 | use ide::Analysis; 3 | 4 | use crate::cli::{flags, read_stdin}; 5 | 6 | impl flags::Symbols { 7 | pub fn run(self) -> anyhow::Result<()> { 8 | let text = read_stdin()?; 9 | let (analysis, file_id) = Analysis::from_single_file(text); 10 | let structure = analysis.file_structure(file_id).unwrap(); 11 | for s in structure { 12 | println!("{s:?}"); 13 | } 14 | Ok(()) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/syntax/fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | target 3 | corpus 4 | artifacts 5 | -------------------------------------------------------------------------------- /crates/syntax/fuzz/fuzz_targets/parser.rs: -------------------------------------------------------------------------------- 1 | //! Fuzzing for from-scratch parsing. 2 | 3 | #![no_main] 4 | use libfuzzer_sys::fuzz_target; 5 | use syntax::fuzz::check_parser; 6 | 7 | fuzz_target!(|data: &[u8]| { 8 | if let Ok(text) = std::str::from_utf8(data) { 9 | check_parser(text) 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /crates/syntax/fuzz/fuzz_targets/reparse.rs: -------------------------------------------------------------------------------- 1 | //! Fuzzing for incremental parsing. 2 | 3 | #![no_main] 4 | use libfuzzer_sys::fuzz_target; 5 | use syntax::fuzz::CheckReparse; 6 | 7 | fuzz_target!(|data: &[u8]| { 8 | if let Some(check) = CheckReparse::from_data(data) { 9 | check.run(); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /crates/syntax/src/utils.rs: -------------------------------------------------------------------------------- 1 | //! A set of utils methods to reuse on other abstraction levels 2 | 3 | use crate::SyntaxKind; 4 | 5 | #[inline] 6 | pub fn is_raw_identifier(name: &str, edition: parser::Edition) -> bool { 7 | let is_keyword = SyntaxKind::from_keyword(name, edition).is_some(); 8 | is_keyword && !matches!(name, "self" | "crate" | "super" | "Self") 9 | } 10 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/fuzz-failures/0002.rs: -------------------------------------------------------------------------------- 1 | !('\ -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/fuzz-failures/0003.rs: -------------------------------------------------------------------------------- 1 | if'\xɿ -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/fuzz-failures/0004.rs: -------------------------------------------------------------------------------- 1 | b"\xʿ -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs: -------------------------------------------------------------------------------- 1 | fn block() { 2 | let inner = { 3 | #![doc("Inner attributes not allowed here")] 4 | //! Nor are ModuleDoc comments 5 | }; 6 | if true { 7 | #![doc("Nor here")] 8 | #![doc("We error on each attr")] 9 | //! Nor are ModuleDoc comments 10 | } 11 | while true { 12 | #![doc("Nor here")] 13 | //! Nor are ModuleDoc comments 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0037_visibility_in_traits.rs: -------------------------------------------------------------------------------- 1 | impl T for () { 2 | fn foo() {} 3 | pub fn bar() {} 4 | pub(crate) type Baz = (); 5 | pub(crate) const C: i32 = 92; 6 | } 7 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | 0..=; 3 | ..=; 4 | } 5 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0040_illegal_crate_kw_location.rs: -------------------------------------------------------------------------------- 1 | use ::crate; 2 | use {crate, foo::{crate::foo::bar::baz}}; 3 | use hello::crate; 4 | use hello::crate::there; 5 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0041_illegal_self_keyword_location.rs: -------------------------------------------------------------------------------- 1 | use ::self; 2 | use a::self; 3 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs: -------------------------------------------------------------------------------- 1 | type Foo<'a> = &'a dyn Send + Sync; 2 | type Foo = *const dyn Send + Sync; 3 | type Foo = fn() -> dyn Send + 'static; 4 | fn main() { 5 | let b = (&a) as &dyn Add + Other; 6 | } 7 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs: -------------------------------------------------------------------------------- 1 | const mut FOO: () = (); 2 | -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0224_dangling_dyn.rs: -------------------------------------------------------------------------------- 1 | fn f(_: &dyn) {} -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/0261_dangling_impl_undeclared_lifetime.rs: -------------------------------------------------------------------------------- 1 | fn f(_: &impl 'a + Sized) {} -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/dangling_impl.rs: -------------------------------------------------------------------------------- 1 | fn f(_: impl) {} -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/dangling_impl_reference.rs: -------------------------------------------------------------------------------- 1 | fn f(_: &impl) {} -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/impl_trait_lifetime_only.rs: -------------------------------------------------------------------------------- 1 | fn f(_: &impl 'a) {} -------------------------------------------------------------------------------- /crates/syntax/test_data/parser/validation/invalid_let_expr.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | const _: () = let _ = None; 3 | 4 | let _ = if true { (let _ = None) }; 5 | 6 | if true && (let _ = None) { 7 | (let _ = None); 8 | while let _ = None { 9 | match None { 10 | _ if let _ = None => { let _ = None; } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0000.rs: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 4 | 5 | 6 | 0 -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0001.rs: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 4 | bb" -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0002.rs: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 4 | ""! -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0003.rs: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 4 | __ -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0004.rs: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | } 4 | {; -------------------------------------------------------------------------------- /crates/syntax/test_data/reparse/fuzz-failures/0005.rs: -------------------------------------------------------------------------------- 1 | 05 2 | 1 3 | 4 | 5 | 6 | b' 7 | -------------------------------------------------------------------------------- /crates/toolchain/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "toolchain" 3 | version = "0.0.0" 4 | repository.workspace = true 5 | description = "Discovery of `cargo` & `rustc` executables for rust-analyzer." 6 | 7 | authors.workspace = true 8 | edition.workspace = true 9 | license.workspace = true 10 | rust-version.workspace = true 11 | 12 | [lib] 13 | 14 | [dependencies] 15 | home = "0.5.11" 16 | camino.workspace = true 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /docs/book/src/assists.md: -------------------------------------------------------------------------------- 1 | # Assists 2 | 3 | Assists, or code actions, are small local refactorings, available in a 4 | particular context. They are usually triggered by a shortcut or by 5 | clicking a light bulb icon in the editor. Cursor position or selection 6 | is signified by `┃` character. 7 | 8 | {{#include assists_generated.md:2:}} 9 | -------------------------------------------------------------------------------- /docs/book/src/features.md: -------------------------------------------------------------------------------- 1 | # Features 2 | 3 | {{#include features_generated.md:2:}} 4 | -------------------------------------------------------------------------------- /editors/code/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | server 4 | .vscode-test/ 5 | *.vsix 6 | bundle 7 | vscode.proposed.d.ts 8 | -------------------------------------------------------------------------------- /editors/code/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode-test 3 | out 4 | -------------------------------------------------------------------------------- /editors/code/.vscodeignore: -------------------------------------------------------------------------------- 1 | ** 2 | !icon.png 3 | !language-configuration.json 4 | !LICENSE 5 | !node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm 6 | !node_modules/@hpcc-js/wasm/dist/index.min.js 7 | !node_modules/d3-graphviz/build/d3-graphviz.min.js 8 | !node_modules/d3/dist/d3.min.js 9 | !out/main.js 10 | !package-lock.json 11 | !package.json 12 | !ra_syntax_tree.tmGrammar.json 13 | !server 14 | !README.md 15 | !walkthrough-setup-tips.md 16 | -------------------------------------------------------------------------------- /editors/code/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-analyzer/b9e667135375f6f1eb70206930458086b16101c1/editors/code/icon.png -------------------------------------------------------------------------------- /editors/code/prettier.config.mts: -------------------------------------------------------------------------------- 1 | import { type Config } from "prettier"; 2 | 3 | const config: Config = { 4 | // use 4 because it's Rustfmt's default 5 | // https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#%5C34%20%5C%20%5C(default%5C)%5C%3A 6 | tabWidth: 4, 7 | // use 100 because it's Rustfmt's default 8 | // https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#max_width 9 | printWidth: 100, 10 | }; 11 | 12 | export default config; 13 | -------------------------------------------------------------------------------- /editors/code/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | // Special typescript project file, used by eslint only. 2 | { 3 | "extends": "./tsconfig.json", 4 | "include": [ 5 | // repeated from base config's "include" setting 6 | "src", 7 | "tests", 8 | // these are the eslint-only inclusions 9 | "eslint.config.mts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /editors/code/walkthrough-setup-tips.md: -------------------------------------------------------------------------------- 1 | # Settings Example 2 | 3 | Add the following to settings.json to mark Rust library sources as read-only: 4 | 5 | ```json 6 | "files.readonlyInclude": { 7 | "**/.cargo/registry/src/**/*.rs": true, 8 | "**/.cargo/git/checkouts/**/*.rs": true, 9 | "**/lib/rustlib/src/rust/library/**/*.rs": true, 10 | }, 11 | ``` 12 | -------------------------------------------------------------------------------- /lib/la-arena/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "la-arena" 3 | version = "0.3.1" 4 | description = "Simple index-based arena without deletion." 5 | license = "MIT OR Apache-2.0" 6 | repository = "https://github.com/rust-lang/rust-analyzer/tree/master/lib/la-arena" 7 | documentation = "https://docs.rs/la-arena" 8 | categories = ["data-structures", "memory-management", "rust-patterns"] 9 | edition = "2024" 10 | rust-version = "1.85" 11 | 12 | [lints] 13 | workspace = true 14 | -------------------------------------------------------------------------------- /lib/line-index/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "line-index" 3 | version = "0.1.2" 4 | description = "Maps flat `TextSize` offsets to/from `(line, column)` representation." 5 | license = "MIT OR Apache-2.0" 6 | repository = "https://github.com/rust-lang/rust-analyzer/tree/master/lib/line-index" 7 | edition = "2024" 8 | 9 | [dependencies] 10 | text-size = "1.1.1" 11 | nohash-hasher = "0.2.0" 12 | 13 | [dev-dependencies] 14 | oorandom = "11.1.5" 15 | 16 | [lints] 17 | workspace = true 18 | -------------------------------------------------------------------------------- /lib/lsp-server/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /lib/lsp-server/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /rust-version: -------------------------------------------------------------------------------- 1 | a8e4c68dcb4dc1e48a0db294c5323cab0227fcb9 2 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | reorder_modules = true 2 | use_small_heuristics = "Max" 3 | --------------------------------------------------------------------------------