rust/src
bors 84322efad5 Auto merge of #93066 - nnethercote:infallible-decoder, r=bjorn3
Make `Decodable` and `Decoder` infallible.

`Decoder` has two impls:
- opaque: this impl is already partly infallible, i.e. in some places it
  currently panics on failure (e.g. if the input is too short, or on a
  bad `Result` discriminant), and in some places it returns an error
  (e.g. on a bad `Option` discriminant). The number of places where
  either happens is surprisingly small, just because the binary
  representation has very little redundancy and a lot of input reading
  can occur even on malformed data.
- json: this impl is fully fallible, but it's only used (a) for the
  `.rlink` file production, and there's a `FIXME` comment suggesting it
  should change to a binary format, and (b) in a few tests in
  non-fundamental ways. Indeed #85993 is open to remove it entirely.

And the top-level places in the compiler that call into decoding just
abort on error anyway. So the fallibility is providing little value, and
getting rid of it leads to some non-trivial performance improvements.

Much of this PR is pretty boring and mechanical. Some notes about
a few interesting parts:
- The commit removes `Decoder::{Error,error}`.
- `InternIteratorElement::intern_with`: the impl for `T` now has the same
  optimization for small counts that the impl for `Result<T, E>` has,
  because it's now much hotter.
- Decodable impls for SmallVec, LinkedList, VecDeque now all use
  `collect`, which is nice; the one for `Vec` uses unsafe code, because
  that gave better perf on some benchmarks.

r? `@bjorn3`
2022-01-23 15:37:43 +00:00
..
bootstrap Auto merge of #93047 - matthiaskrgr:defer__dist_PlainSourceTarball, r=Mark-Simulacrum 2022-01-23 12:29:08 +00:00
build_helper Remove dead code from build_helper 2022-01-22 12:06:44 +01:00
ci Auto merge of #92983 - pietroalbini:pa-bump-runner-images, r=Mark-Simulacrum 2022-01-21 17:43:39 +00:00
doc update uclibc instructions for new toolchain, add link from platforms doc 2022-01-22 14:16:52 -05:00
etc Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obk 2022-01-18 09:58:39 +00:00
librustdoc Auto merge of #93066 - nnethercote:infallible-decoder, r=bjorn3 2022-01-23 15:37:43 +00:00
llvm-project@6b3dbcc81a Use Term in ProjectionPredicate 2022-01-17 17:44:56 +00:00
rustdoc-json-types Increase the format version of rustdoc-json-types 2022-01-20 22:14:02 +01:00
test Auto merge of #93066 - nnethercote:infallible-decoder, r=bjorn3 2022-01-23 15:37:43 +00:00
tools Auto merge of #92363 - the8472:less-compiletest-normalization, r=Mark-Simulacrum 2022-01-21 20:47:48 +00:00
README.md
stage0.json Bump bootstrap compiler 2021-11-30 10:44:21 -05:00
version bump version to 1.60.0 2022-01-07 10:04:15 +01: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.