Esteban Küber
781e86477c
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-13 19:13:56 +00:00
..
2023-09-29 22:27:52 +02:00
2023-10-05 01:04:41 +00:00
2023-08-30 15:09:40 -07:00
2023-10-04 02:04:14 +00:00
2023-10-06 11:02:11 +00:00
2023-10-05 19:24:35 +02:00
2023-10-08 10:06:17 +00:00
2023-10-05 19:24:35 +02:00
2023-10-09 11:47:02 +00:00
2023-10-08 10:06:17 +00:00
2023-09-01 06:36:02 +05:30
2023-10-03 19:12:00 +00:00
2023-09-19 12:48:40 +00:00
2023-10-04 21:09:54 +00:00
2023-10-05 01:04:41 +00:00
2023-10-08 10:06:17 +00:00
2023-09-14 23:21:39 +02:00
2023-09-22 18:57:27 +03:00
2023-10-05 01:04:41 +00:00
2023-09-21 17:31:25 +02:00
2023-09-21 22:20:58 +02:00
2023-10-04 21:09:54 +00:00
2023-10-04 08:01:11 +08:00
2023-10-04 21:09:54 +00:00
2023-10-08 10:06:17 +00:00
2023-10-09 11:47:02 +00:00
2023-10-04 21:09:54 +00:00
2023-10-05 01:04:41 +00:00
2023-09-21 22:20:58 +02:00
2023-09-19 05:42:23 +00:00
2023-10-11 12:49:57 +00:00
2023-10-11 12:49:57 +00:00
2023-10-05 01:04:41 +00:00
2023-09-10 21:20:36 +00:00
2023-10-04 08:01:11 +08:00
2023-10-04 18:12:20 +11:00
2023-10-05 01:04:41 +00:00
2023-09-08 12:46:06 +01:00
2023-10-11 22:01:59 +02:00
2023-10-04 21:36:04 +02:00
2023-09-19 12:48:40 +00:00
2023-09-06 12:09:29 +03:00
2023-09-10 21:20:36 +00:00
2023-10-05 01:04:41 +00:00
2023-09-10 21:20:36 +00:00
2023-09-19 18:15:23 +02:00
2023-10-11 10:07:19 +00:00
2023-09-15 14:24:58 +00:00
2023-09-13 15:00:31 +00:00
2023-09-25 22:33:15 +02:00
2023-09-20 18:50:40 +02:00
2023-10-08 20:17:53 -07:00
2023-09-06 18:55:45 +02:00
2023-10-08 10:06:17 +00:00
2023-10-04 02:04:14 +00:00
2023-09-27 18:05:14 +10:00
2023-09-21 22:20:58 +02:00
2023-09-23 13:47:30 +00:00
2023-10-08 10:06:17 +00:00
2023-10-04 02:04:14 +00:00
2023-09-22 22:41:01 -07:00
2023-10-05 01:04:41 +00:00
2023-10-11 20:08:20 +02:00
2023-09-05 11:15:05 +02:00
2023-10-05 01:04:41 +00:00
2023-10-02 23:14:29 +00:00
2023-10-06 15:51:04 +00:00
2023-09-21 09:00:22 +00:00
2023-09-25 22:33:15 +02:00
2023-10-09 11:47:02 +00:00
2023-10-04 02:04:14 +00:00
2023-09-21 22:20:58 +02:00
2023-10-04 21:09:54 +00:00
2023-09-11 21:16:22 +02:00
2023-10-08 10:06:17 +00:00
2023-10-05 01:04:41 +00:00
2023-10-08 21:57:39 +00:00
2023-10-11 10:07:19 +00:00
2023-10-04 21:09:54 +00:00
2023-10-05 01:04:41 +00:00
2023-10-10 09:08:11 +11:00
2023-10-08 10:06:17 +00:00
2023-10-11 04:55:55 +02:00
2023-10-04 02:04:14 +00:00
2023-09-13 15:00:31 +00:00
2023-10-04 21:09:54 +00:00
2023-09-10 21:20:36 +00:00
2023-10-05 01:04:41 +00:00
2023-10-09 11:47:02 +00:00
2023-10-08 10:06:17 +00:00
2023-10-08 09:59:51 +00:00
2023-10-04 21:09:54 +00:00
2023-10-02 23:14:29 +00:00
2023-10-02 19:12:42 +02:00
2023-09-22 19:47:41 +00:00
2023-09-29 14:24:40 +02:00
2023-10-09 22:48:10 +00:00
2023-10-11 12:49:57 +00:00
2023-09-28 16:13:38 +00:00
2023-09-21 22:20:58 +02:00
2023-10-09 11:47:02 +00:00
2023-10-12 08:46:15 +11:00
2023-09-06 09:05:07 +05:30
2023-10-11 04:55:55 +02:00
2023-09-21 22:20:58 +02:00
2023-10-05 01:04:41 +00:00
2023-10-08 10:06:17 +00:00
2023-10-05 01:04:41 +00:00
2023-10-13 19:13:56 +00:00
2023-10-04 21:09:54 +00:00
2023-10-11 12:49:57 +00:00
2023-08-30 20:43:31 +02:00
2023-10-05 01:04:41 +00:00
2023-10-05 01:04:41 +00:00
2023-10-03 16:24:15 +02:00
2023-09-18 15:10:28 +00:00
2023-10-02 19:12:42 +02:00
2023-10-09 11:47:02 +00:00
2023-08-30 15:09:40 -07:00
2023-09-22 23:12:38 +02:00
2023-10-02 23:14:29 +00:00
2023-09-25 22:33:15 +02:00
2023-10-11 18:26:44 +00:00
2023-09-23 13:47:30 +00:00
2023-09-01 12:40:01 +00:00
2023-09-18 17:29:13 +01:00
2023-10-05 01:04:41 +00:00
2023-10-09 11:47:02 +00:00
2023-10-11 20:08:21 +02:00
2023-09-06 06:48:34 +08:00
2023-09-10 21:20:36 +00:00
2023-10-02 23:14:29 +00:00
2023-10-02 23:14:29 +00:00
2023-10-05 01:04:41 +00:00
2023-10-06 18:44:32 +00:00
2023-10-05 01:04:41 +00:00
2023-10-13 19:13:56 +00:00
2023-10-04 02:04:14 +00:00
2023-10-09 16:26:03 +02:00
2023-09-28 22:04:15 +00:00
2023-09-10 21:20:36 +00:00
2023-10-05 01:04:41 +00:00
2023-09-14 11:52:08 +00:00
2023-09-13 23:07:39 +08:00
2023-10-05 01:04:41 +00:00
2023-10-08 10:06:17 +00:00
2023-09-10 21:20:36 +00:00
2023-10-05 01:04:41 +00:00
2023-09-04 14:21:38 +02:00
2023-09-18 14:03:57 +00:00
2023-09-10 23:06:14 +02:00
2023-09-10 23:06:14 +02:00
2023-10-02 23:14:29 +00:00
2023-10-09 11:47:02 +00:00
2023-09-04 14:21:38 +02:00
2023-09-19 18:15:23 +02:00
2023-09-10 23:06:14 +02:00
2023-09-10 23:06:14 +02:00
2023-09-21 22:20:58 +02:00
2023-09-21 22:20:58 +02:00
2023-08-30 15:09:40 -07:00
2023-10-05 01:04:41 +00:00
2023-10-05 01:04:41 +00:00
2023-09-19 12:48:40 +00:00