<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_data_structures/src/svh.rs, branch 1.86.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.86.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.86.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-07-28T22:26:52+00:00</updated>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>Remove `extern crate rustc_macros` from numerous crates.</title>
<updated>2024-04-29T00:21:54+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-04-28T22:53:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4814fd0a4bcc2288ba15fb212610bdf3d1d5eb11'/>
<id>urn:sha1:4814fd0a4bcc2288ba15fb212610bdf3d1d5eb11</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Avoid specialization for the Span Encodable and Decodable impls</title>
<updated>2023-12-31T20:42:17+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2023-12-31T19:35:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6ed37bdc4260bdf64acf0cb2c728d6724c94ac3d'/>
<id>urn:sha1:6ed37bdc4260bdf64acf0cb2c728d6724c94ac3d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use the full Fingerprint when stringifying Svh</title>
<updated>2023-04-30T18:28:30+00:00</updated>
<author>
<name>Ben Kimock</name>
<email>kimockb@gmail.com</email>
</author>
<published>2023-04-30T18:28:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c6d9ec77d00eeb7e20d5f28dff684a0cabe21eb'/>
<id>urn:sha1:3c6d9ec77d00eeb7e20d5f28dff684a0cabe21eb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Store hashes in special types so they aren't accidentally encoded as numbers</title>
<updated>2023-04-18T14:52:47+00:00</updated>
<author>
<name>Ben Kimock</name>
<email>kimockb@gmail.com</email>
</author>
<published>2023-04-08T03:11:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0445fbdd835c92156e4d06e42ce99a39e9315343'/>
<id>urn:sha1:0445fbdd835c92156e4d06e42ce99a39e9315343</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove some unnecessary hash truncations</title>
<updated>2023-04-17T00:05:02+00:00</updated>
<author>
<name>Ben Kimock</name>
<email>kimockb@gmail.com</email>
</author>
<published>2023-04-15T17:53:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84facac97a3a13a1ea29b227d55513b58ffe7692'/>
<id>urn:sha1:84facac97a3a13a1ea29b227d55513b58ffe7692</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use delayed error handling for `Encodable` and `Encoder` infallible.</title>
<updated>2022-06-07T21:01:26+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-06-07T03:30:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1acbe7573dc32f917f51a784a36b7afc690900e3'/>
<id>urn:sha1:1acbe7573dc32f917f51a784a36b7afc690900e3</id>
<content type='text'>
There are two impls of the `Encoder` trait: `opaque::Encoder` and
`opaque::FileEncoder`. The former encodes into memory and is infallible, the
latter writes to file and is fallible.

Currently, standard `Result`/`?`/`unwrap` error handling is used, but this is a
bit verbose and has non-trivial cost, which is annoying given how rare failures
are (especially in the infallible `opaque::Encoder` case).

This commit changes how `Encoder` fallibility is handled. All the `emit_*`
methods are now infallible. `opaque::Encoder` requires no great changes for
this. `opaque::FileEncoder` now implements a delayed error handling strategy.
If a failure occurs, it records this via the `res` field, and all subsequent
encoding operations are skipped if `res` indicates an error has occurred. Once
encoding is complete, the new `finish` method is called, which returns a
`Result`. In other words, there is now a single `Result`-producing method
instead of many of them.

This has very little effect on how any file errors are reported if
`opaque::FileEncoder` has any failures.

Much of this commit is boring mechanical changes, removing `Result` return
values and `?` or `unwrap` from expressions. The more interesting parts are as
follows.
- serialize.rs: The `Encoder` trait gains an `Ok` associated type. The
  `into_inner` method is changed into `finish`, which returns
  `Result&lt;Vec&lt;u8&gt;, !&gt;`.
- opaque.rs: The `FileEncoder` adopts the delayed error handling
  strategy. Its `Ok` type is a `usize`, returning the number of bytes
  written, replacing previous uses of `FileEncoder::position`.
- Various methods that take an encoder now consume it, rather than being
  passed a mutable reference, e.g. `serialize_query_result_cache`.
</content>
</entry>
<entry>
<title>Make `Decodable` and `Decoder` infallible.</title>
<updated>2022-01-21T23:38:31+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-01-18T02:22:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=416399dc1028545ea0ac6d68fb0b5cc5fa97d393'/>
<id>urn:sha1:416399dc1028545ea0ac6d68fb0b5cc5fa97d393</id>
<content type='text'>
`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 commit 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&lt;T, E&gt;` 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.
</content>
</entry>
<entry>
<title>Fix outdated crate names in compiler docs</title>
<updated>2021-04-08T16:12:14+00:00</updated>
<author>
<name>pierwill</name>
<email>pierwill@users.noreply.github.com</email>
</author>
<published>2021-04-07T19:47:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0019ca9141d0e397534df87a6a7c4c7ece2646d7'/>
<id>urn:sha1:0019ca9141d0e397534df87a6a7c4c7ece2646d7</id>
<content type='text'>
Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

Also fix incorrect file paths.
</content>
</entry>
<entry>
<title>mv compiler to compiler/</title>
<updated>2020-08-30T15:45:07+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-08-28T03:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9e5f7d5631b8f4009ac1c693e585d4b7108d4275'/>
<id>urn:sha1:9e5f7d5631b8f4009ac1c693e585d4b7108d4275</id>
<content type='text'>
</content>
</entry>
</feed>
