<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_pattern_analysis/src/rustc.rs, branch 1.85.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-12-22T21:57:57+00:00</updated>
<entry>
<title>Begin to implement type system layer of unsafe binders</title>
<updated>2024-12-22T21:57:57+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-12-21T17:05:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9a1c5eb5b385adb3cd04af0049cbf5c225cefdc3'/>
<id>urn:sha1:9a1c5eb5b385adb3cd04af0049cbf5c225cefdc3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>no more Reveal :(</title>
<updated>2024-11-23T12:52:54+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-11-20T10:31:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=319843d8cd84ee1ec753f836ce3773d44fe0764b'/>
<id>urn:sha1:319843d8cd84ee1ec753f836ce3773d44fe0764b</id>
<content type='text'>
</content>
</entry>
<entry>
<title> thir building: use typing_env directly</title>
<updated>2024-11-23T12:51:57+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-11-22T11:17:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f4b516b10c95c7b33d148d1c284d02a331acce2d'/>
<id>urn:sha1:f4b516b10c95c7b33d148d1c284d02a331acce2d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #132708 - estebank:const-as-binding, r=Nadrieril</title>
<updated>2024-11-20T19:10:12+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-11-20T19:10:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7fc2b337229dfb4bc2e410317af271c1b8dbfe6b'/>
<id>urn:sha1:7fc2b337229dfb4bc2e410317af271c1b8dbfe6b</id>
<content type='text'>
Point at `const` definition when used instead of a binding in a `let` statement

Modify `PatKind::InlineConstant` to be `ExpandedConstant` standing in not only for inline `const` blocks but also for `const` items. This allows us to track named `const`s used in patterns when the pattern is a single binding. When we detect that there is a refutable pattern involving a `const` that could have been a binding instead, we point at the `const` item, and suggest renaming. We do this for both `let` bindings and `match` expressions missing a catch-all arm if there's at least one single binding pattern referenced.

After:

```
error[E0005]: refutable pattern in local binding
  --&gt; $DIR/bad-pattern.rs:19:13
   |
LL |     const PAT: u32 = 0;
   |     -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
...
LL |         let PAT = v1;
   |             ^^^ pattern `1_u32..=u32::MAX` not covered
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `u32`
help: introduce a variable instead
   |
LL |         let PAT_var = v1;
   |             ~~~~~~~
```

Before:

```
error[E0005]: refutable pattern in local binding
  --&gt; $DIR/bad-pattern.rs:19:13
   |
LL |         let PAT = v1;
   |             ^^^
   |             |
   |             pattern `1_u32..=u32::MAX` not covered
   |             missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
   |             help: introduce a variable instead: `PAT_var`
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `u32`
```

CC #132582.
</content>
</entry>
<entry>
<title>use `TypingEnv` when no `infcx` is available</title>
<updated>2024-11-18T09:38:56+00:00</updated>
<author>
<name>lcnr</name>
<email>rust@lcnr.de</email>
</author>
<published>2024-11-15T12:53:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9cba14b95bb07a5b31ed1aac2bf4eadd248232da'/>
<id>urn:sha1:9cba14b95bb07a5b31ed1aac2bf4eadd248232da</id>
<content type='text'>
the behavior of the type system not only depends on the current
assumptions, but also the currentnphase of the compiler. This is
mostly necessary as we need to decide whether and how to reveal
opaque types. We track this via the `TypingMode`.
</content>
</entry>
<entry>
<title>Unify expanded constants and named constants in `PatKind`</title>
<updated>2024-11-17T23:40:00+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-11-07T19:34:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f563efec156319d726095a82ea3d0f167c7edac7'/>
<id>urn:sha1:f563efec156319d726095a82ea3d0f167c7edac7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fold `PatKind::NamedConstant` into `PatKind::Constant`</title>
<updated>2024-11-17T23:39:59+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-11-06T21:10:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c25b44bee96e4489dab8f44409ba347bfeb328b9'/>
<id>urn:sha1:c25b44bee96e4489dab8f44409ba347bfeb328b9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Point at `const` definition when used instead of a binding in a `let` statement</title>
<updated>2024-11-17T23:39:59+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-11-06T19:46:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ff2f7a7a834843ea74b1e7d6511eb4ad06f43981'/>
<id>urn:sha1:ff2f7a7a834843ea74b1e7d6511eb4ad06f43981</id>
<content type='text'>
After:

```
error[E0005]: refutable pattern in local binding
  --&gt; $DIR/bad-pattern.rs:19:13
   |
LL |     const PAT: u32 = 0;
   |     -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
...
LL |         let PAT = v1;
   |             ^^^
   |             |
   |             pattern `1_u32..=u32::MAX` not covered
   |             help: introduce a variable instead: `PAT_var`
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `u32`
```

Before:

```
error[E0005]: refutable pattern in local binding
  --&gt; $DIR/bad-pattern.rs:19:13
   |
LL |         let PAT = v1;
   |             ^^^
   |             |
   |             pattern `1_u32..=u32::MAX` not covered
   |             missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
   |             help: introduce a variable instead: `PAT_var`
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `u32`
```
</content>
</entry>
<entry>
<title>compiler: Add rustc_abi dependence to the compiler</title>
<updated>2024-10-28T04:10:58+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2024-10-28T03:38:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4839d6e6e51f29c6bd9b581df520a8f1a6d278b9'/>
<id>urn:sha1:4839d6e6e51f29c6bd9b581df520a8f1a6d278b9</id>
<content type='text'>
Depend on rustc_abi in compiler crates that use it indirectly but have
not yet taken on that dependency, and are not entangled in my other PRs.
This leaves an "excise rustc_target" step after the dust settles.
</content>
</entry>
<entry>
<title>nightly feature tracking: get rid of the per-feature bool fields</title>
<updated>2024-10-23T08:14:41+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-10-09T07:01:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ad3991d30382676f987a38243b3097d880b9033a'/>
<id>urn:sha1:ad3991d30382676f987a38243b3097d880b9033a</id>
<content type='text'>
</content>
</entry>
</feed>
