Matthias Krüger
14663e09b7
Rollup merge of #116257 - estebank:issue-101351, r=b-naber
...
Suggest trait bounds for used associated type on type param
Fix #101351 .
When an associated type on a type parameter is used, and the type parameter isn't constrained by the correct trait, suggest the appropriate trait bound:
```
error[E0220]: associated type `Associated` not found for `T`
--> file.rs:6:15
|
6 | field: T::Associated,
| ^^^^^^^^^^ there is a similarly named associated type `Associated` in the trait `Foo`
|
help: consider restricting type parameter `T`
|
5 | struct Generic<T: Foo> {
| +++++
```
When an associated type on a type parameter has a typo, suggest fixing
it:
```
error[E0220]: associated type `Baa` not found for `T`
--> $DIR/issue-55673.rs:9:8
|
LL | T::Baa: std::fmt::Debug,
| ^^^ there is a similarly named associated type `Bar` in the trait `Foo`
|
help: change the associated type name to use `Bar` from `Foo`
|
LL | T::Bar: std::fmt::Debug,
| ~~~
```
2023-10-16 19:10:49 +02:00
..
2023-04-29 11:36:19 -05:00
2023-10-12 18:39:35 +02:00
2023-03-30 22:56:52 +02:00
2023-10-12 18:39:35 +02:00
2023-04-18 14:13:44 +02:00
2023-04-29 11:36:19 -05:00
2023-10-05 01:04:41 +00:00
2023-10-13 19:18:46 +00:00
2023-10-05 01:04:41 +00:00
2023-04-29 11:36:19 -05:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-20 15:28:59 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-03-10 17:49:13 +01:00
2023-03-10 17:49:13 +01:00
2023-09-15 21:32:28 +02:00
2023-10-05 01:04:41 +00:00
2023-09-19 17:29:39 +02:00
2023-09-19 17:29:39 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-09-19 17:29:39 +02:00
2023-09-19 17:29:39 +02:00
2023-01-11 09:32:08 +00:00
2023-02-20 15:28:59 +00:00
2023-07-29 11:42:53 +02:00
2023-07-29 11:42:53 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-20 15:28:59 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-12 00:15:32 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-09-24 14:09:38 +02:00
2023-09-24 14:09:38 +02:00
2023-04-29 16:53:02 -07:00
2023-07-19 10:02:15 -04:00
2023-04-29 16:53:02 -07:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-23 09:00:33 +00:00
2023-02-23 09:00:33 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-30 20:12:19 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-23 11:59:26 -07:00
2023-08-18 15:19:17 +08:00
2023-10-05 01:04:41 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00