rust/src
kennytm 445718084f
Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister
syntax: Optimize some literal parsing

Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).
2018-08-21 17:51:52 +08:00
..
bootstrap Use the new Entry::or_default method where possible. 2018-08-18 20:19:45 +03:00
build_helper
ci Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
dlmalloc@c99638dc2e
doc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
etc pretty printing for btreemap 2018-08-15 13:48:10 +09:00
grammar
jemalloc@1f5a28755e
liballoc Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
liballoc_jemalloc liballoc_jemalloc: enable feature(nll) for bootstrap 2018-08-09 01:50:37 -04:00
liballoc_system liballoc_system: enable feature(nll) for bootstrap 2018-08-09 01:50:22 -04:00
libarena [nll] libarena: enable feature(nll) for bootstrap 2018-08-09 04:07:59 -04:00
libbacktrace@f4d02bbdbf
libcompiler_builtins@d549d85b17 Update LLVM submodule to 7.0 2018-08-04 17:30:14 -07:00
libcore Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libfmt_macros Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
libgraphviz A few cleanups for fmt_macros, graphviz, apfloat, target, serialize and term 2018-08-11 20:56:29 +02:00
liblibc@6bdbf5dc93 Update libc and activate align feature 2018-08-08 10:52:10 +02:00
libpanic_abort [nll] libpanic_abort: enable feature(nll) for bootstrap 2018-08-09 06:48:53 -04:00
libpanic_unwind Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
libproc_macro Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libprofiler_builtins [nll] libprofiler_builtins: enable feature(nll) for bootstrap 2018-08-09 09:20:20 -04:00
librustc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_allocator mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
librustc_apfloat Two small improvements 2018-08-15 13:54:47 +02:00
librustc_asan [nll] librustc_asan: enable feature(nll) for bootstrap 2018-08-09 04:08:17 -04:00
librustc_borrowck mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_codegen_llvm Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_codegen_utils Remove LinkMeta struct 2018-08-18 12:08:06 +02:00
librustc_cratesio_shim [nll] librustc_cratesio_shim: enable feature(nll) for bootstrap 2018-08-09 06:50:25 -04:00
librustc_data_structures Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_driver mv codemap source_map 2018-08-19 23:01:01 +02:00
librustc_errors fix tidy errors 2018-08-19 23:01:01 +02:00
librustc_fs_util Move path2cstr to rustc_fs_util 2018-08-09 10:00:25 -06:00
librustc_incremental mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_lint Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_llvm [nll] librustc_llvm: enable feature(nll) for bootstrap 2018-08-09 15:33:24 -04:00
librustc_lsan [nll] librustc_lsan: enable feature(nll) for bootstrap 2018-08-09 15:33:50 -04:00
librustc_metadata Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_metadata_utils
librustc_mir Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_msan [nll] librustc_msan: enable feature(nll) for bootstrap 2018-08-09 15:34:05 -04:00
librustc_passes mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
librustc_platform_intrinsics [nll] librustc_platform_intrinsics: enable feature(nll) for bootstrap 2018-08-09 15:34:31 -04:00
librustc_plugin [nll] librustc_plugin: enable feature(nll) for bootstrap 2018-08-09 04:09:29 -04:00
librustc_privacy [nll] librustc_privacy: enable feature(nll) for bootstrap 2018-08-09 04:09:50 -04:00
librustc_resolve Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_save_analysis mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_target Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton 2018-08-20 01:12:58 +00:00
librustc_traits Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_tsan [nll] librustc_tsan: enable feature(nll) for bootstrap 2018-08-09 04:11:06 -04:00
librustc_typeck Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustdoc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libserialize Rollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichton 2018-08-21 17:51:40 +08:00
libstd Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libsyntax Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister 2018-08-21 17:51:52 +08:00
libsyntax_ext Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libsyntax_pos Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libterm A few cleanups for fmt_macros, graphviz, apfloat, target, serialize and term 2018-08-11 20:56:29 +02:00
libtest Rollup merge of #52453 - srijs:fix-52436, r=TimNN 2018-08-15 19:20:19 +02:00
libunwind [nll] libunwind: enable feature(nll) for bootstrap 2018-08-09 06:52:12 -04:00
llvm@e19f07f5a6 Update LLVM submodule to 7.0 2018-08-04 17:30:14 -07:00
llvm-emscripten@2717444753
rtstartup
rustc Update libc and activate align feature 2018-08-08 10:52:10 +02:00
rustllvm Make LLVM emit assembly comments with -Z asm-comments. 2018-08-12 17:59:33 +00:00
stdsimd@05c2f61c38
test Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
tools Rollup merge of #53492 - danc86:lld-riscv, r=alexcrichton 2018-08-21 17:51:48 +08:00
Cargo.lock rustc_resolve: don't allow paths starting with ::crate. 2018-08-17 12:59:56 +03:00
Cargo.toml
README.md
stage0.txt

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

Their is also useful content in the following READMEs, which are gradually being moved over to the guide: