Jonathan Brouwer
5abe5ea630
Rollup merge of #155546 - Unique-Usman:ua/impl_traits, r=estebank
...
Improve E0308 error message for `impl Trait` return mismatches
When a function returns `impl Trait`, all branches must return the same concrete type. Previously, the compiler showed:
expected `First` because of return type
This was misleading, as it suggested the return type was `First`, rather than any single type implementing the trait.
Update the diagnostic to:
expected a single type implementing `Value` because of return type
Also highlight the first return expression to make it clearer why subsequent returns do not match.
2026-04-21 20:42:50 +02:00
..
2026-02-28 11:08:02 +01:00
2025-05-09 02:35:18 +00:00
2026-03-17 17:39:59 +08:00
2026-04-09 18:53:59 +02:00
2025-10-31 20:44:01 +00:00
2026-04-20 16:46:57 +06:00
2026-03-28 16:18:11 +09:00
2025-10-13 15:26:22 +01:00
2025-11-27 11:19:00 -05:00
2025-03-11 12:05:02 +00:00
2025-10-31 20:38:31 +00:00
2026-04-01 17:01:58 +02:00
2026-04-14 21:14:10 +10:00
2025-08-22 20:10:27 +00:00
2026-04-07 16:06:24 +08:00
2026-02-18 18:33:35 +00:00
2025-10-12 08:24:39 +09:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-08-25 14:20:18 +02:00
2025-07-07 16:47:15 +08:00
2025-08-25 14:20:18 +02:00
2025-07-07 16:47:15 +08:00
2025-06-30 11:50:19 +05:00
2025-03-11 12:05:02 +00:00
2025-09-26 16:33:15 +02:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-09-26 16:33:15 +02:00
2025-09-26 16:33:15 +02:00
2025-09-26 16:33:15 +02:00
2025-09-26 16:33:15 +02:00
2025-09-26 16:33:15 +02:00
2025-08-26 15:15:17 -06:00
2026-03-02 19:31:15 +01:00
2025-03-11 12:05:02 +00:00
2025-03-25 16:44:59 +00:00
2025-03-25 16:44:59 +00:00
2025-03-25 16:44:59 +00:00
2025-08-20 11:04:38 +02:00
2025-05-27 08:18:11 +00:00
2025-05-27 08:18:11 +00:00
2026-04-20 13:59:39 +05:30
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2026-03-21 20:10:07 +00:00
2026-03-21 20:10:07 +00:00
2026-03-21 20:10:07 +00:00
2026-03-21 20:10:07 +00:00
2026-04-20 13:59:39 +05:30
2026-04-10 12:14:07 +02:00
2026-03-04 08:06:45 +08:00
2025-08-19 21:27:10 +02:00
2025-06-14 13:44:43 +08:00
2025-06-14 13:44:43 +08:00
2025-06-14 13:44:43 +08:00
2026-04-20 16:46:57 +06:00
2025-08-19 21:27:10 +02:00
2025-03-11 12:05:02 +00:00
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
2026-02-28 11:08:02 +01:00
2026-02-28 11:08:02 +01:00
2026-02-28 11:08:02 +01:00
2025-10-07 09:51:16 +01:00
2025-10-07 09:51:16 +01:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-10-12 16:51:28 +09:00
2025-10-12 16:51:28 +09:00
2025-10-12 16:51:28 +09:00
2025-11-21 21:42:40 +09:00
2025-11-21 21:42:40 +09:00
2025-04-11 11:03:08 +10:00
2025-06-09 17:02:09 +00:00
2025-06-09 17:02:09 +00:00
2025-03-28 18:15:23 +01:00
2025-03-28 18:15:23 +01:00
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2025-06-04 10:40:04 -04:00
2025-10-12 16:51:28 +09:00
2025-10-12 16:51:28 +09:00
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2025-06-25 17:02:26 +00:00
2025-02-14 05:55:30 -07:00
2025-04-07 19:13:31 +03:00
2025-08-26 15:15:17 -06:00
2026-01-22 19:50:00 +01:00
2026-01-22 19:50:00 +01:00
2025-02-02 02:39:43 +00:00
2025-04-15 10:08:49 +02:00
2025-04-15 10:08:49 +02:00
2026-03-02 19:31:15 +01:00
2025-02-09 19:09:45 +00:00
2025-06-03 15:16:51 +00:00
2025-03-11 12:05:02 +00:00
2025-03-28 18:15:23 +01:00
2025-10-07 23:02:23 +01:00
2025-06-09 19:55:00 +00:00
2025-06-25 15:42:11 +00:00
2025-06-25 15:42:11 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-04-08 23:06:31 +03:00
2025-10-31 20:44:01 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-10-13 15:26:22 +01:00
2025-12-10 06:52:27 +00:00
2025-08-20 11:04:38 +02:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-06-26 13:46:45 +00:00
2025-07-08 14:36:43 +00:00
2026-03-16 17:58:49 +00:00
2025-12-02 18:25:13 +00:00
2025-07-18 12:13:30 +02:00
2025-07-18 12:13:30 +02:00
2025-02-03 19:00:22 +00:00
2026-04-20 13:59:39 +05:30
2025-09-26 16:33:15 +02:00
2025-09-26 16:33:15 +02:00
2025-02-05 18:36:17 +00:00
2025-02-05 18:36:17 +00:00
2025-02-05 18:36:17 +00:00
2025-04-03 11:13:10 +02:00
2025-05-20 10:08:56 +00:00
2025-08-25 14:20:18 +02:00
2025-09-08 14:17:56 +02:00
2025-08-25 14:20:18 +02:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-06-03 15:16:51 +00:00
2025-03-11 12:05:02 +00:00
2025-10-31 20:44:01 +00:00
2025-07-14 09:52:58 -04:00
2025-08-23 22:11:43 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2025-06-25 15:42:11 +00:00
2026-02-28 05:29:28 +00:00
2025-04-03 11:13:10 +02:00
2025-09-18 12:58:39 +02:00
2025-09-18 12:58:39 +02:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-08-19 21:27:10 +02:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-02-02 02:39:43 +00:00
2026-03-23 12:09:34 +01:00
2026-03-23 12:09:34 +01:00
2026-03-23 12:09:34 +01:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2026-03-23 12:09:34 +01:00
2026-03-23 12:09:34 +01:00
2025-02-09 19:09:45 +00:00
2025-02-09 19:09:45 +00:00
2026-03-02 19:31:15 +01:00
2025-08-20 11:10:38 +02:00
2025-11-27 14:13:58 -05:00
2026-03-16 17:58:49 +00:00
2025-11-27 14:13:58 -05:00
2026-04-06 18:10:08 -07:00