rust/compiler
bors c3f35504d1 Auto merge of #98189 - mystor:fast_ident_literal, r=eddyb
proc_macro/bridge: stop using a remote object handle for proc_macro Ident and Literal

This is the fourth part of https://github.com/rust-lang/rust/pull/86822, split off as requested in https://github.com/rust-lang/rust/pull/86822#pullrequestreview-1008655452. This patch transforms the `Ident` and `Group` types into structs serialized over IPC rather than handles.

Symbol values are interned on both the client and server when deserializing, to avoid unnecessary string copies and keep the size of `TokenTree` down. To do the interning efficiently on the client, the proc-macro crate is given a vendored version of the fxhash hasher, as `SipHash` appeared to cause performance issues. This was done rather than depending on `rustc_hash` as it is unfortunately difficult to depend on crates from within `proc_macro` due to it being built at the same time as `std`.

In addition, a custom arena allocator and symbol store was also added, inspired by those in `rustc_arena` and `rustc_span`. To prevent symbol re-use across multiple invocations of a macro on the same thread, a new range of `Symbol` names are used for each invocation of the macro, and symbols from previous invocations are cleaned-up.

In order to keep `Ident` creation efficient, a special ASCII-only case was added to perform ident validation without using RPC for simple identifiers. Full identifier validation couldn't be easily added, as it would require depending on the `rustc_lexer` and `unicode-normalization` crates from within `proc_macro`. Unicode identifiers are validated and normalized using RPC.

See the individual commit messages for more details on trade-offs and design decisions behind these patches.
2022-07-19 05:46:45 +00:00
..
rustc Don't rerun the build script for the compiler each time on linux 2022-07-10 23:57:25 -05:00
rustc_apfloat Update smallvec to 1.8.1. 2022-06-27 08:48:55 +10:00
rustc_arena Rollup merge of #97711 - Nilstrieb:rustc-arena-ub, r=wesleywiser 2022-07-07 18:06:49 +05:30
rustc_ast Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_ast_lowering Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_ast_passes Rollup merge of #99360 - compiler-errors:issue-99331, r=fee1-dead 2022-07-18 08:40:00 +09:00
rustc_ast_pretty Parse closure binders 2022-07-12 16:25:16 +04:00
rustc_attr Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_borrowck Auto merge of #99181 - lcnr:arenaGTrc, r=wesleywiser 2022-07-18 05:50:54 +00:00
rustc_builtin_macros Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_codegen_cranelift Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk 2022-07-17 19:28:01 +00:00
rustc_codegen_gcc Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
rustc_codegen_llvm Rollup merge of #98998 - workingjubilee:naked-means-no-clothes-enforcement-technology, r=Amanieu 2022-07-18 21:14:43 +05:30
rustc_codegen_ssa Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk 2022-07-17 19:28:01 +00:00
rustc_const_eval Rollup merge of #99378 - RalfJung:box-early-return, r=oli-obk 2022-07-18 21:14:48 +05:30
rustc_data_structures Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot 2022-07-14 21:50:14 +00:00
rustc_driver Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
rustc_error_codes fixes post rebase 2022-07-08 21:18:16 +00:00
rustc_error_messages Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_errors Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, r=compiler-errors 2022-07-16 22:30:56 +02:00
rustc_expand proc_macro: Move subspan to be a method on Span in the bridge 2022-07-18 13:06:51 -04:00
rustc_feature Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_fs_util
rustc_graphviz Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rustc_hir Rollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods, r=cjgillot 2022-07-15 15:53:38 +05:30
rustc_hir_pretty use rustc_hir_pretty::qpath_to_string to avoid span_to_snippet when rendering path 2022-07-17 04:58:38 +00:00
rustc_incremental Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
rustc_index Use a bitset instead of a hash map in HIR ID validator 2022-07-04 08:30:13 +02:00
rustc_infer Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_interface Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot 2022-07-14 21:50:14 +00:00
rustc_lexer fix typo in comment 2022-06-28 19:59:09 +05:30
rustc_lint Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_lint_defs Only suggest if span is not erroneous 2022-07-15 17:32:34 +00:00
rustc_llvm Rollup merge of #98998 - workingjubilee:naked-means-no-clothes-enforcement-technology, r=Amanieu 2022-07-18 21:14:43 +05:30
rustc_log clippy::complexity fixes 2022-05-26 13:14:24 +02:00
rustc_macros macros: support adding warnings to diags 2022-07-15 16:13:49 +01:00
rustc_metadata Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_middle Auto merge of #99232 - lcnr:no-bound-vars-check, r=jackh726 2022-07-18 13:59:05 +00:00
rustc_mir_build Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_mir_dataflow Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank 2022-07-16 22:30:47 +02:00
rustc_mir_transform Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_monomorphize Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
rustc_parse Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_parse_format Make rustc_parse_format compile on stable 2022-05-03 11:26:58 +02:00
rustc_passes Stabilize let_chains 2022-07-16 20:17:58 -03:00
rustc_plugin_impl remove currently unused deps 2022-06-13 22:20:51 +03:00
rustc_privacy errors: lint on LintDiagnosticBuilder::build 2022-07-15 16:13:47 +01:00
rustc_query_impl Use constant eval to do strict validity checks 2022-07-14 22:55:17 +01:00
rustc_query_system Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
rustc_resolve Auto merge of #98120 - TaKO8Ki:box-diagnostic-metadata-field, r=estebank 2022-07-19 03:02:30 +00:00
rustc_save_analysis Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillot 2022-07-14 14:14:21 +05:30
rustc_serialize use BufReader for counting zero bytes 2022-07-02 22:51:42 +09:00
rustc_session Rollup merge of #99360 - compiler-errors:issue-99331, r=fee1-dead 2022-07-18 08:40:00 +09:00
rustc_smir Rustfmt 2022-06-02 10:29:00 +00:00
rustc_span Rollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods, r=cjgillot 2022-07-15 15:53:38 +05:30
rustc_symbol_mangling Allow to create definitions inside the query system. 2022-07-06 22:50:55 +02:00
rustc_target Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk 2022-07-17 19:28:01 +00:00
rustc_trait_selection Auto merge of #99232 - lcnr:no-bound-vars-check, r=jackh726 2022-07-18 13:59:05 +00:00
rustc_traits Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
rustc_ty_utils Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr 2022-07-14 19:24:04 +05:30
rustc_type_ir Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiser 2022-07-08 17:55:26 +00:00
rustc_typeck Rollup merge of #99351 - compiler-errors:arg-mismatch-blame, r=davidtwco 2022-07-18 21:14:47 +05:30