<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_pattern_analysis/src, branch 1.83.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.83.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.83.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-09-29T11:31:30+00:00</updated>
<entry>
<title>cleanup: don't clone types that are Copy</title>
<updated>2024-09-29T11:31:30+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-09-29T11:31:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=71cd918dc78c84d41bb89c2fc8effcfd000f4e3e'/>
<id>urn:sha1:71cd918dc78c84d41bb89c2fc8effcfd000f4e3e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove couple redundant clones</title>
<updated>2024-09-28T11:42:37+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-09-28T11:42:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e174b92cb45138dcea93727e64f2255ae39cd5bf'/>
<id>urn:sha1:e174b92cb45138dcea93727e64f2255ae39cd5bf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #130715 - compiler-errors:mir-build-const-eval, r=BoxyUwU</title>
<updated>2024-09-23T04:45:36+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-09-23T04:45:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0e08d7002b6eb44163efbab84cb39d3463c67699'/>
<id>urn:sha1:0e08d7002b6eb44163efbab84cb39d3463c67699</id>
<content type='text'>
Replace calls to `ty::Const::{try_}eval` in mir build/pattern analysis

We normalize consts in writeback: #130645. This means that consts are gonna be as normalized as they're ever gonna get in MIR building and pattern analysis. Therefore we can just use `try_to_target_usize` rather than calling `eval_target_usize`.

Regarding the `.expect` calls, I'm not totally certain whether they're correct given rigid unevaluated consts. But this PR shouldn't make *more* ICEs occur; we may have to squash these ICEs when mGCE comes around, tho 😺
</content>
</entry>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace calls to Const::eval in mir build</title>
<updated>2024-09-22T18:12:37+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T18:11:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2273aeed9decabdbbb0713a8b0749de0e9cd4ea7'/>
<id>urn:sha1:2273aeed9decabdbbb0713a8b0749de0e9cd4ea7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert warning empty patterns as unreachable</title>
<updated>2024-09-11T16:36:45+00:00</updated>
<author>
<name>Nadrieril</name>
<email>nadrieril+git@gmail.com</email>
</author>
<published>2024-08-28T18:10:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b7be148ea0128daad309cf5a123c868a65d7737'/>
<id>urn:sha1:5b7be148ea0128daad309cf5a123c868a65d7737</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #128934 - Nadrieril:fix-empty-non-exhaustive, r=compiler-errors</title>
<updated>2024-09-03T17:13:24+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-09-03T17:13:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e7504ac70407c116d35a4faa38f3b03bc62457a6'/>
<id>urn:sha1:e7504ac70407c116d35a4faa38f3b03bc62457a6</id>
<content type='text'>
Non-exhaustive structs may be empty

This is a follow-up to a discrepancy noticed in https://github.com/rust-lang/rust/pull/122792: today, the following struct is considered inhabited (non-empty) outside its defining crate:
```rust
#[non_exhaustive]
pub struct UninhabitedStruct {
    pub never: !,
    // other fields
}
```

`#[non_exhaustive]` on a struct should mean that adding fields to it isn't a breaking change. There is no way that adding fields to this struct could make it non-empty since the `never` field must stay and is inconstructible. I suspect this was implemented this way due to confusion with `#[non_exhaustive]` enums, which indeed should be considered non-empty outside their defining crate.

I propose that we consider such a struct uninhabited (empty), just like it would be without the `#[non_exhaustive]` annotation.

Code that doesn't pass today and will pass after this:
```rust
// In a different crate
fn empty_match_on_empty_struct&lt;T&gt;(x: UninhabitedStruct) -&gt; T {
    match x {}
}
```

This is not a breaking change.

r? ``@compiler-errors``
</content>
</entry>
<entry>
<title>Non-exhaustive structs may be empty</title>
<updated>2024-09-02T19:16:37+00:00</updated>
<author>
<name>Nadrieril</name>
<email>nadrieril+git@gmail.com</email>
</author>
<published>2024-08-10T17:06:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6f6a6bc710e538741aa06d40df6492471e4be8af'/>
<id>urn:sha1:6f6a6bc710e538741aa06d40df6492471e4be8af</id>
<content type='text'>
</content>
</entry>
<entry>
<title>chore: Fix typos in 'compiler' (batch 2)</title>
<updated>2024-09-02T05:50:22+00:00</updated>
<author>
<name>Alexander Cyon</name>
<email>alex.cyon@gmail.com</email>
</author>
<published>2024-09-02T05:50:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=00de006f22f2304bddabb2d00a13af242ea21c17'/>
<id>urn:sha1:00de006f22f2304bddabb2d00a13af242ea21c17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add `warn(unreachable_pub)` to `rustc_pattern_analysis`.</title>
<updated>2024-08-29T10:18:44+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-08-29T06:24:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=653ee7bc3aa0a28eabb796cbe14d185b49fe3e6d'/>
<id>urn:sha1:653ee7bc3aa0a28eabb796cbe14d185b49fe3e6d</id>
<content type='text'>
</content>
</entry>
</feed>
