<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_ast_lowering/src/pat.rs, branch try-perf</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try-perf</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try-perf'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-25T07:55:50+00:00</updated>
<entry>
<title>add span to struct pattern rest (..)</title>
<updated>2025-08-25T07:55:50+00:00</updated>
<author>
<name>Valdemar Erk</name>
<email>valdemar@erk.dev</email>
</author>
<published>2025-08-23T09:37:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=75d8687f2b6ac1e73071450cb57c4157fcba53b4'/>
<id>urn:sha1:75d8687f2b6ac1e73071450cb57c4157fcba53b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Pass the target type down to `parse_attribute_list`</title>
<updated>2025-08-14T16:11:56+00:00</updated>
<author>
<name>Jonathan Brouwer</name>
<email>jonathantbrouwer@gmail.com</email>
</author>
<published>2025-08-09T18:33:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e7ef23e90e5b63e86bd77061ab92b86190a4eb3c'/>
<id>urn:sha1:e7ef23e90e5b63e86bd77061ab92b86190a4eb3c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove `P`</title>
<updated>2025-08-09T07:47:01+00:00</updated>
<author>
<name>Deadbeef</name>
<email>ent3rm4n@gmail.com</email>
</author>
<published>2025-08-09T05:24:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ad1113f87ef828b300ebb8fca397efd358580da3'/>
<id>urn:sha1:ad1113f87ef828b300ebb8fca397efd358580da3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Introduce `ByteSymbol`.</title>
<updated>2025-06-30T10:42:27+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-06-01T22:59:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=478f8287c0e2c35cda511fd3ac01b7ac78ee7cfe'/>
<id>urn:sha1:478f8287c0e2c35cda511fd3ac01b7ac78ee7cfe</id>
<content type='text'>
It's like `Symbol` but for byte strings. The interner is now used for
both `Symbol` and `ByteSymbol`. E.g. if you intern `"dog"` and `b"dog"`
you'll get a `Symbol` and a `ByteSymbol` with the same index and the
characters will only be stored once.

The motivation for this is to eliminate the `Arc`s in `ast::LitKind`, to
make `ast::LitKind` impl `Copy`, and to avoid the need to arena-allocate
`ast::LitKind` in HIR. The latter change reduces peak memory by a
non-trivial amount on literal-heavy benchmarks such as `deep-vector` and
`tuple-stress`.

`Encoder`, `Decoder`, `SpanEncoder`, and `SpanDecoder` all get some
changes so that they can handle normal strings and byte strings.

This change does slow down compilation of programs that use
`include_bytes!` on large files, because the contents of those files are
now interned (hashed). This makes `include_bytes!` more similar to
`include_str!`, though `include_bytes!` contents still aren't escaped,
and hashing is still much cheaper than escaping.
</content>
</entry>
<entry>
<title>Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk</title>
<updated>2025-05-05T11:50:43+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-05-05T11:50:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=243c5a35e18b2634892fe7091d5ee888a18f77f5'/>
<id>urn:sha1:243c5a35e18b2634892fe7091d5ee888a18f77f5</id>
<content type='text'>
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type

This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct  `DisambiguatorState` instances must ensure that that the def paths are unique without its help.

Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer.

`DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those.

cc `@oli-obk`
</content>
</entry>
<entry>
<title>We always use the current item as parent, so no need to pass it</title>
<updated>2025-04-28T16:11:15+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-04-26T08:18:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2ac60bc0896b4edd09e192204e768ddbe715a573'/>
<id>urn:sha1:2ac60bc0896b4edd09e192204e768ddbe715a573</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add or-patterns to pattern types</title>
<updated>2025-04-28T07:50:18+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-02-27T09:46:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b023856f29743a288727d13d0d1044b8e0d3f9f3'/>
<id>urn:sha1:b023856f29743a288727d13d0d1044b8e0d3f9f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add `{ast,hir,thir}::PatKind::Missing` variants.</title>
<updated>2025-03-27T22:18:57+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-03-26T22:33:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f089e080c47bc282aa98f1e8c72ff44076afbb9'/>
<id>urn:sha1:9f089e080c47bc282aa98f1e8c72ff44076afbb9</id>
<content type='text'>
"Missing" patterns are possible in bare fn types (`fn f(u32)`) and
similar places. Currently these are represented in the AST with
`ast::PatKind::Ident` with no `by_ref`, no `mut`, an empty ident, and no
sub-pattern. This flows through to `{hir,thir}::PatKind::Binding` for
HIR and THIR.

This is a bit nasty. It's very non-obvious, and easy to forget to check
for the exceptional empty identifier case.

This commit adds a new variant, `PatKind::Missing`, to do it properly.

The process I followed:
- Add a `Missing` variant to `{ast,hir,thir}::PatKind`.
- Chang `parse_param_general` to produce `ast::PatKind::Missing`
  instead of `ast::PatKind::Missing`.
- Look through `kw::Empty` occurrences to find functions where an
  existing empty ident check needs replacing with a `PatKind::Missing`
  check: `print_param`, `check_trait_item`, `is_named_param`.
- Add a `PatKind::Missing =&gt; unreachable!(),` arm to every exhaustive
  match identified by the compiler.
- Find which arms are actually reachable by running the test suite,
  changing them to something appropriate, usually by looking at what
  would happen to a `PatKind::Ident`/`PatKind::Binding` with no ref, no
  `mut`, an empty ident, and no subpattern.

Quite a few of the `unreachable!()` arms were never reached. This makes
sense because `PatKind::Missing` can't happen in every pattern, only
in places like bare fn tys and trait fn decls.

I also tried an alternative approach: modifying `ast::Param::pat` to
hold an `Option&lt;P&lt;Pat&gt;&gt;` instead of a `P&lt;Pat&gt;`, but that quickly turned
into a very large and painful change. Adding `PatKind::Missing` is much
easier.
</content>
</entry>
<entry>
<title>Pass `Option&lt;Symbol&gt;` to `def_path_data`/`create_def` methods.</title>
<updated>2025-03-07T09:53:00+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-03-04T02:54:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=79439323843d4131a3685e704d14086d17ce79a1'/>
<id>urn:sha1:79439323843d4131a3685e704d14086d17ce79a1</id>
<content type='text'>
It's clearer than using `kw::Empty` to mean `None`.
</content>
</entry>
<entry>
<title>Remove the `Option` part of range ends in the HIR</title>
<updated>2025-03-06T10:47:40+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-02-05T15:22:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e8f7a382be12a812b7d73f58967f740a0cf9d9af'/>
<id>urn:sha1:e8f7a382be12a812b7d73f58967f740a0cf9d9af</id>
<content type='text'>
</content>
</entry>
</feed>
