<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_pattern_analysis/src, branch beta</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=beta</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=beta'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-23T20:22:15+00:00</updated>
<entry>
<title>Rollup merge of #145234 - dianne:1-tuple-witnesses, r=jackh726</title>
<updated>2025-08-23T20:22:15+00:00</updated>
<author>
<name>Samuel Tardieu</name>
<email>sam@rfc1149.net</email>
</author>
<published>2025-08-23T20:22:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5a14685a63b8306367c3fdd49717113e9ba0ba59'/>
<id>urn:sha1:5a14685a63b8306367c3fdd49717113e9ba0ba59</id>
<content type='text'>
match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little)

Constructor patterns of type `(T,)` are written `(pat,)`, not `(pat)`. However, exhaustiveness/usefulness diagnostics would print them as `(pat)` when e.g. providing a witness of non-exhaustiveness and suggesting adding arms to make matches exhaustive; this would result in an error when applied.
rust-analyzer already prints the trailing comma, so it doesn't need changing.

This also includes some cleanup in the second commit, with justification in the commit message.
</content>
</entry>
<entry>
<title>avoid unnecessary type sanity checks</title>
<updated>2025-08-14T07:44:22+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-29T15:22:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e2cc7757e1bdbe8c9dc0dcffc1017ceff4799899'/>
<id>urn:sha1:e2cc7757e1bdbe8c9dc0dcffc1017ceff4799899</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shrink TestBranch::Constant and PatRangeBoundary::Finite</title>
<updated>2025-08-14T07:44:22+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-29T11:28:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dbc030e0346f0958bea91601de7d115554bbf74e'/>
<id>urn:sha1:dbc030e0346f0958bea91601de7d115554bbf74e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>change StrLit type to ty::Value as well</title>
<updated>2025-08-14T07:44:22+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-29T07:01:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a1acbfb050675f197fd525c830203f07412148bd'/>
<id>urn:sha1:a1acbfb050675f197fd525c830203f07412148bd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use ty::Value instead of manual pairs of types and valtrees</title>
<updated>2025-08-14T07:44:22+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-29T06:54:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a171eaab4249f70d24904da7ed392476b516a0e6'/>
<id>urn:sha1:a171eaab4249f70d24904da7ed392476b516a0e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pattern testing: store constants as valtrees</title>
<updated>2025-08-14T07:44:19+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-28T16:16:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d61fdbf266cf25ddf8c4798fd86e21577c8664e8'/>
<id>urn:sha1:d61fdbf266cf25ddf8c4798fd86e21577c8664e8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>PatKind: store constants as valtrees</title>
<updated>2025-08-14T07:39:39+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-07-28T14:59:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3f1e99dca47b2cfc33906f1f1334fbed3a9fc4ce'/>
<id>urn:sha1:3f1e99dca47b2cfc33906f1f1334fbed3a9fc4ce</id>
<content type='text'>
</content>
</entry>
<entry>
<title>clean up witness printing for tuple-like constructors</title>
<updated>2025-08-10T23:34:11+00:00</updated>
<author>
<name>dianne</name>
<email>diannes.gm@gmail.com</email>
</author>
<published>2025-08-10T22:52:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8f649a7e585f03e69c61a5b8286a61b38307afe8'/>
<id>urn:sha1:8f649a7e585f03e69c61a5b8286a61b38307afe8</id>
<content type='text'>
By construction, `subpatterns` contains all fields in order. Witness
patterns are constructed with all fields in order by
`WitnessPat::wild_from_ctor` and `WitnessStack::apply_constructor`, and
the order is preserved at `write_struct_like`'s call-site in
`print_witness_pat`. It's thus no longer necessary to go looking for
fields or handle missing fields.
</content>
</entry>
<entry>
<title>show a trailing comma on singleton tuple constructors in witness pats</title>
<updated>2025-08-10T22:32:14+00:00</updated>
<author>
<name>dianne</name>
<email>diannes.gm@gmail.com</email>
</author>
<published>2025-08-10T22:32:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9449b786218d5c5b66222a774f445e1ccf3e3666'/>
<id>urn:sha1:9449b786218d5c5b66222a774f445e1ccf3e3666</id>
<content type='text'>
</content>
</entry>
<entry>
<title>In rustc_pattern_analysis, put `true` witnesses before `false` witnesses</title>
<updated>2025-07-27T23:01:39+00:00</updated>
<author>
<name>Chayim Refael Friedman</name>
<email>chayimfr@gmail.com</email>
</author>
<published>2025-07-27T21:01:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6bf3cbe39e09f4d9187a0b1f6a7bd45101f7aad8'/>
<id>urn:sha1:6bf3cbe39e09f4d9187a0b1f6a7bd45101f7aad8</id>
<content type='text'>
In rustc it doesn't really matter what the order of the witnesses is, but I'm planning to use the witnesses for implementing the "add missing match arms" assist in rust-analyzer, and there `true` before `false` is the natural order (like `Some` before `None`), and also what the current assist does.

The current order doesn't seem to be intentional; the code was created when bool ctors became their own thing, not just int ctors, but for integer, 0 before 1 is indeed the natural order.
</content>
</entry>
</feed>
