<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/pattern, branch automation/bors/try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=automation/bors/try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=automation/bors/try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-25T15:15:04+00:00</updated>
<entry>
<title>usize/isize range matching error clarification</title>
<updated>2025-09-25T15:15:04+00:00</updated>
<author>
<name>helldawg</name>
<email>116204326+helldawg@users.noreply.github.com</email>
</author>
<published>2025-09-19T01:59:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7e58c9110521d960cb97e730dfe700b3ec64c9ab'/>
<id>urn:sha1:7e58c9110521d960cb97e730dfe700b3ec64c9ab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #146112 - scrabsha:push-utkysktvulto, r=WaffleLapkin</title>
<updated>2025-09-04T00:01:59+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-09-04T00:01:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6f490f7ae126dbbff8b41cb39fb340efcb2c922b'/>
<id>urn:sha1:6f490f7ae126dbbff8b41cb39fb340efcb2c922b</id>
<content type='text'>
don't uppercase error messages
</content>
</entry>
<entry>
<title>Rollup merge of #145827 - estebank:issue-51976, r=jackh726</title>
<updated>2025-09-04T00:01:54+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-09-04T00:01:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3a6ae1167f56516fc0de1d304fcb9163cea0cb40'/>
<id>urn:sha1:3a6ae1167f56516fc0de1d304fcb9163cea0cb40</id>
<content type='text'>
On unused binding or binding not present in all patterns, suggest potential typo of unit struct/variant or const

When encountering an or-pattern with a binding not available in all patterns, look for consts and unit struct/variants that have similar names as the binding to detect typos.

```
error[E0408]: variable `Ban` is not bound in all patterns
  --&gt; $DIR/binding-typo.rs:22:9
   |
LL |         (Foo, _) | (Ban, Foo) =&gt; {}
   |         ^^^^^^^^    --- variable not in all patterns
   |         |
   |         pattern doesn't bind `Ban`
   |
help: you might have meant to use the similarly named unit variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) =&gt; {}
LL +         (Foo, _) | (Bar, Foo) =&gt; {}
   |
```

For items that are not in the immedate scope, suggest the full path for them:

```
error[E0408]: variable `Non` is not bound in all patterns
  --&gt; $DIR/binding-typo-2.rs:51:16
   |
LL |         (Non | Some(_))=&gt; {}
   |          ---   ^^^^^^^ pattern doesn't bind `Non`
   |          |
   |          variable not in all patterns
   |
help: you might have meant to use the similarly named unit variant `None`
   |
LL -         (Non | Some(_))=&gt; {}
LL +         (core::option::Option::None | Some(_))=&gt; {}
   |
```

When encountering a typo in a pattern that gets interpreted as an unused binding, look for unit struct/variant of the same type as the binding:

```
error: unused variable: `Non`
  --&gt; $DIR/binding-typo-2.rs:36:9
   |
LL |         Non =&gt; {}
   |         ^^^
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Non =&gt; {}
   |         +
help: you might have meant to pattern match on the similarly named variant `None`
   |
LL -         Non =&gt; {}
LL +         std::prelude::v1::None =&gt; {}
   |
```

 Suggest constant on unused binding in a pattern

```
error: unused variable: `Batery`
  --&gt; $DIR/binding-typo-2.rs:110:9
   |
LL |         Batery =&gt; {}
   |         ^^^^^^
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Batery =&gt; {}
   |         +
help: you might have meant to pattern match on the similarly named constant `Battery`
   |
LL |         Battery =&gt; {}
   |            +
```

Fix rust-lang/rust#51976.
</content>
</entry>
<entry>
<title>don't uppercase error messages</title>
<updated>2025-09-03T13:24:49+00:00</updated>
<author>
<name>Sasha Pourcelot</name>
<email>sasha.pourcelot@protonmail.com</email>
</author>
<published>2025-09-01T14:47:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5c4b61b4b4b13e408b28ecc91f4f517e78e6b5e7'/>
<id>urn:sha1:5c4b61b4b4b13e408b28ecc91f4f517e78e6b5e7</id>
<content type='text'>
a more general version of https://github.com/rust-lang/rust/pull/146080.

after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase.

(i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_)

i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry.

in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
</content>
</entry>
<entry>
<title>Rollup merge of #145676 - Oneirical:uncountable-integer-9, r=jieyouxu</title>
<updated>2025-08-29T10:37:30+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-08-29T10:37:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=47f1df5ca35217ca5e21ffd1f1daa3cb623470e2'/>
<id>urn:sha1:47f1df5ca35217ca5e21ffd1f1daa3cb623470e2</id>
<content type='text'>
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
</content>
</entry>
<entry>
<title>Add test batch 2</title>
<updated>2025-08-27T19:06:05+00:00</updated>
<author>
<name>Oneirical</name>
<email>manchot@videotron.ca</email>
</author>
<published>2025-08-20T18:02:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2dc4638c4637bf8ddb83577535317dad21abdf6d'/>
<id>urn:sha1:2dc4638c4637bf8ddb83577535317dad21abdf6d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: Add col separator before secondary messages with no source</title>
<updated>2025-08-26T21:15:17+00:00</updated>
<author>
<name>Scott Schafer</name>
<email>schaferjscott@gmail.com</email>
</author>
<published>2025-07-03T21:47:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=93d16c510066db062700e783a53461d45e5dbe4b'/>
<id>urn:sha1:93d16c510066db062700e783a53461d45e5dbe4b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>On binding not present in all patterns, suggest potential typo</title>
<updated>2025-08-25T15:16:25+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-08-24T19:22:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8dbdb1760b23112f87aedad37e4dad97559bc750'/>
<id>urn:sha1:8dbdb1760b23112f87aedad37e4dad97559bc750</id>
<content type='text'>
```
error[E0408]: variable `Ban` is not bound in all patterns
 --&gt; f12.rs:9:9
  |
9 |         (Foo,Bar)|(Ban,Foo) =&gt; {}
  |         ^^^^^^^^^  --- variable not in all patterns
  |         |
  |         pattern doesn't bind `Ban`
  |
help: you might have meant to use the similarly named previously used binding `Bar`
  |
9 -         (Foo,Bar)|(Ban,Foo) =&gt; {}
9 +         (Foo,Bar)|(Bar,Foo) =&gt; {}
  |
```
</content>
</entry>
<entry>
<title>On E0277, point at type that doesn't implement bound</title>
<updated>2025-08-22T17:55:15+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-08-19T17:49:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=049c32797b5f797d5823cdc0e5aaeb0fd68175da'/>
<id>urn:sha1:049c32797b5f797d5823cdc0e5aaeb0fd68175da</id>
<content type='text'>
When encountering an unmet trait bound, point at local type that doesn't implement the trait:

```
error[E0277]: the trait bound `Bar&lt;T&gt;: Foo` is not satisfied
  --&gt; $DIR/issue-64855.rs:9:19
   |
LL | pub struct Bar&lt;T&gt;(&lt;Self as Foo&gt;::Type) where Self: ;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the trait `Foo` is not implemented for `Bar&lt;T&gt;`
  --&gt; $DIR/issue-64855.rs:9:1
   |
LL | pub struct Bar&lt;T&gt;(&lt;Self as Foo&gt;::Type) where Self: ;
   | ^^^^^^^^^^^^^^^^^
```
</content>
</entry>
<entry>
<title>bless tests with new lint messages</title>
<updated>2025-08-19T19:27:10+00:00</updated>
<author>
<name>Karol Zwolak</name>
<email>karolzwolak7@gmail.com</email>
</author>
<published>2025-04-28T11:47:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d14b83e378c421dd09320ace833a9d47848e3046'/>
<id>urn:sha1:d14b83e378c421dd09320ace833a9d47848e3046</id>
<content type='text'>
</content>
</entry>
</feed>
