rust/src
bors e71440575c Auto merge of #97575 - nnethercote:lazify-SourceFile-lines, r=Mark-Simulacrum
Lazify `SourceFile::lines`.

`SourceFile::lines` is a big part of metadata. It's stored in a compressed form
(a difference list) to save disk space. Decoding it is a big fraction of
compile time for very small crates/programs.

This commit introduces a new type `SourceFileLines` which has a `Lines`
form and a `Diffs` form. The latter is used when the metadata is first
read, and it is only decoded into the `Lines` form when line data is
actually needed. This avoids the decoding cost for many files,
especially in `std`. It's a performance win of up to 15% for tiny
crates/programs where metadata decoding is a high part of compilation
costs.

A `RefCell` is needed because the methods that access lines data (which can
trigger decoding) take `&self` rather than `&mut self`. To allow for this,
`SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather
than returning the lines slice.

r? `@Mark-Simulacrum`
2022-06-02 18:45:29 +00:00
..
bootstrap Auto merge of #97548 - Dylan-DPC:rollup-9x0va1d, r=Dylan-DPC 2022-05-30 14:59:12 +00:00
ci Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha 2022-05-26 00:32:09 +02:00
doc Rollup merge of #97028 - ridwanabdillahi:pretty-printer, r=michaelwoerister 2022-05-29 01:12:30 +02:00
etc Read the Ref/RefMut pointer in natvis 2022-05-16 17:39:34 -07:00
librustdoc Rollup merge of #97617 - GuillaumeGomez:rustdoc-anonymous-reexports, r=Nemo157 2022-06-02 15:27:00 +02:00
llvm-project@4784866596 Update LLVM submodule 2022-05-12 10:17:27 +02:00
rustdoc-json-types rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate 2022-05-04 21:03:01 +02:00
test Auto merge of #97654 - Dylan-DPC:rollup-w6zrzxf, r=Dylan-DPC 2022-06-02 16:04:42 +00:00
tools Auto merge of #97575 - nnethercote:lazify-SourceFile-lines, r=Mark-Simulacrum 2022-06-02 18:45:29 +00:00
README.md
stage0.json Finish bumping stage0 2022-05-27 07:36:17 -04:00
version Bump to 1.63 2022-05-13 10:08:03 -04:00

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

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

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