<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/try-trait, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-04T20:43:53+00:00</updated>
<entry>
<title>Rehome tests/ui/issues/ tests [3/?]</title>
<updated>2025-08-04T20:43:53+00:00</updated>
<author>
<name>Oneirical</name>
<email>manchot@videotron.ca</email>
</author>
<published>2025-07-13T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7196d8cd661b875401126a81641d2effc40b3d85'/>
<id>urn:sha1:7196d8cd661b875401126a81641d2effc40b3d85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cleaned up some tests</title>
<updated>2025-07-10T13:47:20+00:00</updated>
<author>
<name>Kivooeo</name>
<email>Kivooeo123@gmail.com</email>
</author>
<published>2025-07-01T16:46:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ad95cccf9b3af7e527869a1eb130217971b7a57'/>
<id>urn:sha1:3ad95cccf9b3af7e527869a1eb130217971b7a57</id>
<content type='text'>
</content>
</entry>
<entry>
<title>moved tests</title>
<updated>2025-07-01T16:42:20+00:00</updated>
<author>
<name>Kivooeo</name>
<email>Kivooeo123@gmail.com</email>
</author>
<published>2025-07-01T16:42:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e9191ec57ee5bdd0961a22fd9852f361a5c97ea0'/>
<id>urn:sha1:e9191ec57ee5bdd0961a22fd9852f361a5c97ea0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Point at type that doesn't implement needed trait</title>
<updated>2025-02-21T18:30:07+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-02-20T19:47:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=31febc684ba8847494b1d1e223e8fc2cc87f3dcc'/>
<id>urn:sha1:31febc684ba8847494b1d1e223e8fc2cc87f3dcc</id>
<content type='text'>
```
error[E0277]: `?` couldn't convert the error: `E: std::error::Error` is not satisfied
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:7:13
   |
LL | fn foo() -&gt; Result&lt;(), Box&lt;dyn std::error::Error&gt;&gt; {
   |             -------------------------------------- required `E: std::error::Error` because of this
LL |     Ok(bar()?)
   |        -----^ the trait `std::error::Error` is not implemented for `E`
   |        |
   |        this has type `Result&lt;_, E&gt;`
   |
note: `E` needs to implement `std::error::Error`
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:1:1
   |
LL | struct E;
   | ^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = note: required for `Box&lt;dyn std::error::Error&gt;` to implement `From&lt;E&gt;`

error[E0277]: `?` couldn't convert the error to `X`
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:18:13
   |
LL | fn bat() -&gt; Result&lt;(), X&gt; {
   |             ------------- expected `X` because of this
LL |     Ok(bar()?)
   |        -----^ the trait `From&lt;E&gt;` is not implemented for `X`
   |        |
   |        this can't be annotated with `?` because it has type `Result&lt;_, E&gt;`
   |
note: `X` needs to implement `From&lt;E&gt;`
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:4:1
   |
LL | struct X;
   | ^^^^^^^^
note: alternatively, `E` needs to implement `Into&lt;X&gt;`
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:1:1
   |
LL | struct E;
   | ^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
```
</content>
</entry>
<entry>
<title>Point out the type of more expressions on bad `?`</title>
<updated>2025-02-20T19:11:07+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-02-20T19:07:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8ef535e03d8f34c7ad7aab14eea6a73bf4445b4c'/>
<id>urn:sha1:8ef535e03d8f34c7ad7aab14eea6a73bf4445b4c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Tweak E0277 when predicate comes indirectly from `?`</title>
<updated>2025-02-20T18:15:39+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-02-18T20:29:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e565eeed78d0e59e475dce34b0833bbf8f84871b'/>
<id>urn:sha1:e565eeed78d0e59e475dce34b0833bbf8f84871b</id>
<content type='text'>
When a `?` operation requires an `Into` conversion with additional bounds (like having a concrete error but wanting to convert to a trait object), we handle it speficically and provide the same kind of information we give other `?` related errors.

```
error[E0277]: `?` couldn't convert the error: `E: std::error::Error` is not satisfied
  --&gt; $DIR/bad-question-mark-on-trait-object.rs:5:13
   |
LL | fn foo() -&gt; Result&lt;(), Box&lt;dyn std::error::Error&gt;&gt; {
   |             -------------------------------------- required `E: std::error::Error` because of this
LL |     Ok(bar()?)
   |             ^ the trait `std::error::Error` is not implemented for `E`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = note: required for `Box&lt;dyn std::error::Error&gt;` to implement `From&lt;E&gt;`
```

Avoid talking about `FromResidual` when other more relevant information is being given, particularly from `rust_on_unimplemented`.
</content>
</entry>
<entry>
<title>Don't mention `FromResidual` on bad `?`</title>
<updated>2025-02-18T17:34:16+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-02-18T17:34:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6eb48824dac44b466ca03fe67760a63d8a45d1dc'/>
<id>urn:sha1:6eb48824dac44b466ca03fe67760a63d8a45d1dc</id>
<content type='text'>
Unless `try_trait_v2` is enabled, don't mention that `FromResidual` isn't implemented for a specific type when the implicit `From` conversion of a `?` fails. For the end user on stable, `?` might as well be a compiler intrinsic, so we remove that note to avoid further confusion and allowing other parts of the error to be more prominent.

```
error[E0277]: `?` couldn't convert the error to `u8`
  --&gt; $DIR/bad-interconversion.rs:4:20
   |
LL | fn result_to_result() -&gt; Result&lt;u64, u8&gt; {
   |                          --------------- expected `u8` because of this
LL |     Ok(Err(123_i32)?)
   |        ------------^ the trait `From&lt;i32&gt;` is not implemented for `u8`
   |        |
   |        this can't be annotated with `?` because it has type `Result&lt;_, i32&gt;`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From&lt;T&gt;`:
             `u8` implements `From&lt;Char&gt;`
             `u8` implements `From&lt;bool&gt;`
```
</content>
</entry>
<entry>
<title>Trim output of E0277 in some cases</title>
<updated>2024-11-02T03:08:04+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-10-24T22:38:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7b9105dd8865ef10ef8d5f2f7bc3da180aec9dd2'/>
<id>urn:sha1:7b9105dd8865ef10ef8d5f2f7bc3da180aec9dd2</id>
<content type='text'>
Remove default note for "trait is not implemented" in favor of the
more colorful diff output from the previous commit. Removes
duplicated output.
</content>
</entry>
<entry>
<title>Add trait diff highlighting logic and use it in E0277</title>
<updated>2024-11-02T03:08:04+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-10-24T22:16:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b7fc1a743122e3c45f105a5d1169a042a2c6e8bf'/>
<id>urn:sha1:b7fc1a743122e3c45f105a5d1169a042a2c6e8bf</id>
<content type='text'>
When a trait is not implemented for a type, but there *is* an `impl`
for another type or different trait params, we format the output to
use highlighting in the same way that E0308 does for types.

The logic accounts for 3 cases:
- When both the type and trait in the expected predicate and the candidate are different
- When only the types are different
- When only the trait generic params are different

For each case, we use slightly different formatting and wording.
</content>
</entry>
<entry>
<title>Remove detail from label/note that is already available in other note</title>
<updated>2024-10-29T16:26:57+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-10-24T21:14:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b542866400ad4a294f468cfa7e059d95c27a079'/>
<id>urn:sha1:5b542866400ad4a294f468cfa7e059d95c27a079</id>
<content type='text'>
Remove the "which is required by `{root_obligation}`" post-script in
"the trait `X` is not implemented for `Y`" explanation in E0277. This
information is already conveyed in the notes explaining requirements,
making it redundant while making the text (particularly in labels)
harder to read.

```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --&gt; $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy&lt;Option&lt;NotCopy&gt;&gt; = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
   |
   = note: required for `Option&lt;NotCopy&gt;` to implement `Copy`
note: required by a bound in `IsCopy`
  --&gt; $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy&lt;T:Copy&gt; { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
vs the prior

```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --&gt; $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy&lt;Option&lt;NotCopy&gt;&gt; = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option&lt;NotCopy&gt;: Copy`
   |
   = note: required for `Option&lt;NotCopy&gt;` to implement `Copy`
note: required by a bound in `IsCopy`
  --&gt; $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy&lt;T:Copy&gt; { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
</content>
</entry>
</feed>
