<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_errors/src, branch lcnr/rustc-dev-guide</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=lcnr/rustc-dev-guide</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=lcnr/rustc-dev-guide'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-11T02:21:08+00:00</updated>
<entry>
<title>Rollup merge of #144558 - estebank:issue-68119, r=lcnr</title>
<updated>2025-08-11T02:21:08+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-08-11T02:21:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=907076c3dd5dc983df954755ce953725eda159eb'/>
<id>urn:sha1:907076c3dd5dc983df954755ce953725eda159eb</id>
<content type='text'>
Point at the `Fn()` or `FnMut()` bound that coerced a closure, which caused a move error

When encountering a move error involving a closure because the captured value isn't `Copy`, and the obligation comes from a bound on a type parameter that requires `Fn` or `FnMut`, we point at it and explain that an `FnOnce` wouldn't cause the move error.

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --&gt; f111.rs:15:25
   |
14 | fn do_stuff(foo: Option&lt;Foo&gt;) {
   |             ---  ----------- move occurs because `foo` has type `Option&lt;Foo&gt;`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
15 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
16 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
  --&gt; f111.rs:12:53
   |
12 | fn require_fn_trait&lt;F: Future&lt;Output = ()&gt;&gt;(_: impl Fn() -&gt; F) {}
   |                                                     ^^^^^^^^^
help: consider cloning the value if the performance cost is acceptable
   |
16 |         if foo.clone().map_or(false, |f| f.foo()) {
   |               ++++++++
```

Fix rust-lang/rust#68119, by pointing at `Fn` and `FnMut` bounds involved in move errors.
</content>
</entry>
<entry>
<title>Rollup merge of #145152 - xizheyin:detect-confusion-type, r=lqd</title>
<updated>2025-08-10T19:43:55+00:00</updated>
<author>
<name>Jacob Pratt</name>
<email>jacob@jhpratt.dev</email>
</author>
<published>2025-08-10T19:43:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=733568ac7d66ff07bb7e6ada6a447e7f020fb3a2'/>
<id>urn:sha1:733568ac7d66ff07bb7e6ada6a447e7f020fb3a2</id>
<content type='text'>
Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`

A small optimization has been made, using `to_ascii_lowercase()` instead of `to_lowercase().to_string()`.

r? compiler
</content>
</entry>
<entry>
<title>Point at the `Fn()` or `FnMut()` bound that coerced a closure, which caused a move error</title>
<updated>2025-08-10T19:22:49+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-07-28T02:01:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1aa5668d20d53976860d141a66aa727e425e1079'/>
<id>urn:sha1:1aa5668d20d53976860d141a66aa727e425e1079</id>
<content type='text'>
When encountering a move error involving a closure because the captured value isn't `Copy`, and the obligation comes from a bound on a type parameter that requires `Fn` or `FnMut`, we point at it and explain that an `FnOnce` wouldn't cause the move error.

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --&gt; f111.rs:15:25
   |
14 | fn do_stuff(foo: Option&lt;Foo&gt;) {
   |             ---  ----------- move occurs because `foo` has type `Option&lt;Foo&gt;`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
15 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
16 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
  --&gt; f111.rs:12:53
   |
12 | fn require_fn_trait&lt;F: Future&lt;Output = ()&gt;&gt;(_: impl Fn() -&gt; F) {}
   |                                                     ^^^^^^^^^
help: consider cloning the value if the performance cost is acceptable
   |
16 |         if foo.clone().map_or(false, |f| f.foo()) {
   |               ++++++++
```
</content>
</entry>
<entry>
<title>Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`</title>
<updated>2025-08-10T04:35:12+00:00</updated>
<author>
<name>xizheyin</name>
<email>xizheyin@smail.nju.edu.cn</email>
</author>
<published>2025-08-09T07:47:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cf1a1b7b76a937afae997594d931b64956e74a4f'/>
<id>urn:sha1:cf1a1b7b76a937afae997594d931b64956e74a4f</id>
<content type='text'>
Signed-off-by: xizheyin &lt;xizheyin@smail.nju.edu.cn&gt;
</content>
</entry>
<entry>
<title>Rollup merge of #144579 - joshtriplett:mbe-attr, r=petrochenkov</title>
<updated>2025-08-08T19:22:45+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>t.gross35@gmail.com</email>
</author>
<published>2025-08-08T19:22:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=804d1a194e8aafc4fbf3fc24250d77f2025f075e'/>
<id>urn:sha1:804d1a194e8aafc4fbf3fc24250d77f2025f075e</id>
<content type='text'>
Implement declarative (`macro_rules!`) attribute macros (RFC 3697)

This implements [RFC 3697](https://github.com/rust-lang/rust/issues/143547), "Declarative (`macro_rules!`) attribute macros".

I would suggest reading this commit-by-commit. This first introduces the
feature gate, then adds parsing for attribute rules (doing nothing with them),
then adds the ability to look up and apply `macro_rules!` attributes by path,
then adds support for local attributes, then adds a test, and finally makes
various improvements to errors.
</content>
</entry>
<entry>
<title>mbe: In error messages, don't assume attributes are always proc macros</title>
<updated>2025-08-08T17:35:47+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-07-28T10:00:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2054a0c56b063c195d316e4ff44d0c9f8ad2c012'/>
<id>urn:sha1:2054a0c56b063c195d316e4ff44d0c9f8ad2c012</id>
<content type='text'>
Now that `macro_rules` macros can define attribute rules, make sure
error messages account for that.
</content>
</entry>
<entry>
<title>Use `tcx.short_string()` in more diagnostics</title>
<updated>2025-08-07T21:18:00+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-07-16T19:45:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=99196657fcb5c1e20c13e76166c7f52d35584e88'/>
<id>urn:sha1:99196657fcb5c1e20c13e76166c7f52d35584e88</id>
<content type='text'>
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`.

We add support for shortening the path of "trait path only".

Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem).

When we don't actually print out a shortened type we don't need the "use `--verbose`" note.

On E0599 show type identity to avoid expanding the receiver's generic parameters.

Unify wording on `long_ty_path` everywhere.
</content>
</entry>
<entry>
<title>Rollup merge of #144691 - xizheyin:suggest-confuse, r=estebank</title>
<updated>2025-08-01T04:38:20+00:00</updated>
<author>
<name>Jacob Pratt</name>
<email>jacob@jhpratt.dev</email>
</author>
<published>2025-08-01T04:38:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c7ec9bcc6e0adb9adea907db12174f22b0e83989'/>
<id>urn:sha1:c7ec9bcc6e0adb9adea907db12174f22b0e83989</id>
<content type='text'>
Extend `is_case_difference` to handle digit-letter confusables

This PR extends `is_case_difference` to handle digit-letter confusables

Add support for detecting 0/O, 1/l, 5/S, 8/B, 9/g confusables in error suggestions.

r? `@estebank`
</content>
</entry>
<entry>
<title>Rollup merge of #144733 - Muscraft:secondary-file-sigil, r=compiler-errors</title>
<updated>2025-07-31T15:19:41+00:00</updated>
<author>
<name>Jana Dönszelmann</name>
<email>jonathan@donsz.nl</email>
</author>
<published>2025-07-31T15:19:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e2ae91b74aa85e0076377908f41b050bec11cda4'/>
<id>urn:sha1:e2ae91b74aa85e0076377908f41b050bec11cda4</id>
<content type='text'>
fix: Match width of ascii and unicode secondary file start

The current [unicode secondary file start](https://github.com/rust-lang/rust/blob/64ca23b6235732fa61c0a2b957c5d7e591e7c972/compiler/rustc_errors/src/emitter.rs#L2991) is only three characters, whereas the ASCII variant and normal [file start](https://github.com/rust-lang/rust/blob/64ca23b6235732fa61c0a2b957c5d7e591e7c972/compiler/rustc_errors/src/emitter.rs#L2983-L2984) are four characters. This slight difference caused the paths following a Unicode secondary file start to not align with other structured elements.
</content>
</entry>
<entry>
<title>fix: Match width of ascii and unicode secondary file start</title>
<updated>2025-07-31T13:26:39+00:00</updated>
<author>
<name>Scott Schafer</name>
<email>schaferjscott@gmail.com</email>
</author>
<published>2025-07-29T09:41:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=935fdb6980f0f4133a26a91aefe81b4e2cea01c9'/>
<id>urn:sha1:935fdb6980f0f4133a26a91aefe81b4e2cea01c9</id>
<content type='text'>
</content>
</entry>
</feed>
