Matthias Krüger
da43826398
Rollup merge of #139774 - compiler-errors:supertrait-alias, r=lcnr
...
Fix replacing supertrait aliases in `ReplaceProjectionWith`
The new solver has a procedure called `predicates_for_object_candidate`, which elaborates the super-bounds and item-bounds that are required to hold for a dyn trait to implement something via a built-in object impl.
In that procedure, there is a folder called `ReplaceProjectionWith` which is responsible for replacing projections that reference `Self`, so that we don't encounter cycles when we then go on to normalize those projections in the process of proving these super-bounds.
That folder had a few problems: Firstly, it wasn't actually checking that this was a super bound originating from `Self`. Secondly, it only accounted for a *single* projection type def id, but trait objects can have multiple (i.e. `trait Foo<A, B>: Bar<A, Assoc = A> + Bar<B, Assoc = B>`).
To fix the first, it's simple enough to just add an equality check for the self ty. To fix the second, I implemented a matching step that's very similar to the `projection_may_match` check we have for upcasting, since on top of having multiple choices, we need to deal with both non-structural matches and ambiguity.
This probably lacks a bit of documentation, but I think it works pretty well.
Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/171
r? lcnr
2025-04-17 17:40:27 +02:00
..
2025-04-08 23:06:31 +03:00
2025-04-14 17:16:23 +09:00
2025-02-10 20:21:39 +00:00
2025-04-10 18:58:04 +00:00
2025-04-08 23:06:31 +03:00
2025-04-08 23:06:31 +03:00
2024-10-24 01:48:44 +00:00
2025-01-09 17:32:29 +00:00
2025-03-09 02:00:01 +00:00
2024-12-07 21:37:13 +00:00
2025-02-03 19:00:22 +00:00
2025-03-04 18:04:07 +00:00
2025-04-17 17:40:27 +02:00
2025-04-08 23:06:31 +03:00
2025-04-10 09:56:37 +02:00
2025-04-03 11:08:55 +03:00
2024-11-21 03:27:05 -08:00
2025-03-12 10:19:31 -07:00
2025-01-30 15:30:04 +00:00
2024-10-10 01:13:29 +02:00
2025-04-15 15:47:30 +10:00
2024-10-07 16:30:48 +00:00
2024-11-26 02:50:48 +08:00
2024-03-10 23:30:53 +08:00
2024-12-07 21:37:13 +00:00
2024-11-23 18:54:08 +00:00
2025-01-15 01:26:24 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-02 03:08:04 +00:00
2025-01-06 16:08:29 -08:00
2024-11-26 02:50:48 +08:00
2024-04-10 00:41:27 +00:00
2024-04-10 00:41:27 +00:00
2024-12-07 21:26:20 +00:00
2024-12-07 21:37:15 +00:00
2025-04-08 23:06:31 +03:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2025-02-10 20:21:39 +00:00
2024-10-29 16:26:57 +00:00
2024-11-21 01:35:34 +00:00
2024-11-21 01:35:34 +00:00
2025-04-09 08:56:04 +02:00
2025-04-09 08:56:04 +02:00
2024-05-01 14:19:34 -04:00
2025-04-05 19:34:04 +00:00
2024-10-18 00:33:50 +02:00
2024-10-17 20:43:31 +02:00
2024-10-18 00:33:50 +02:00
2024-10-18 00:33:50 +02:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-10-21 11:45:19 +03:00
2024-10-21 11:45:19 +03:00
2024-06-03 13:21:17 +00:00
2024-06-03 13:21:17 +00:00
2024-10-07 16:30:48 +00:00
2024-11-02 22:17:46 +09:00
2024-11-02 22:17:46 +09:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2025-01-31 20:39:01 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-07-06 23:29:58 +08:00
2025-02-15 12:18:30 +08:00
2024-09-13 14:10:56 +03:00
2024-09-13 14:10:56 +03:00
2024-09-24 10:12:05 -04:00
2024-09-24 10:12:05 -04:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2024-04-07 17:38:07 -03:00
2024-03-03 16:30:48 -03:00
2024-10-29 16:26:57 +00:00
2024-03-03 16:30:48 -03:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2024-03-03 16:30:48 -03:00
2024-12-07 21:26:20 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-03-10 21:18:41 -04:00
2025-01-22 09:20:57 -08:00
2025-02-10 20:21:39 +00:00
2024-11-23 18:54:08 +00:00
2024-11-23 18:54:08 +00:00
2025-02-20 13:39:39 +00:00
2025-02-20 13:39:39 +00:00
2024-03-10 23:30:53 +08:00
2025-02-10 20:21:39 +00:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2024-12-07 21:29:58 +00:00
2025-03-14 19:50:03 +00:00
2025-02-03 12:54:53 -05:00
2024-10-29 16:26:57 +00:00
2025-03-14 19:50:03 +00:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2025-02-03 10:39:32 -05:00
2025-02-10 20:21:39 +00:00
2024-11-21 01:35:34 +00:00
2025-02-24 19:34:54 +00:00
2025-03-14 19:50:03 +00:00
2025-04-10 09:56:37 +02:00
2024-05-30 22:52:33 +02:00
2024-06-03 08:14:03 +00:00
2024-10-29 16:26:57 +00:00
2024-07-12 21:16:09 -04:00
2024-07-12 21:16:09 -04:00
2024-10-29 16:26:57 +00:00
2024-10-15 13:11:00 +02:00
2024-10-15 13:11:00 +02:00
2025-04-08 23:06:31 +03:00
2025-03-14 19:50:03 +00:00
2025-02-14 00:37:23 +01:00
2025-02-14 00:37:23 +01:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2024-04-04 16:01:13 -04:00
2024-03-21 16:36:17 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-10 20:21:39 +00:00
2024-05-20 19:21:30 -04:00
2025-01-26 21:20:31 +01:00
2025-01-11 19:22:06 +00:00
2025-01-22 09:20:57 -08:00
2024-11-26 02:50:48 +08:00
2025-02-10 20:21:39 +00:00
2024-04-25 10:03:17 -04:00
2025-03-31 23:58:17 +02:00
2024-03-10 21:18:41 -04:00
2024-03-10 21:18:41 -04:00
2024-03-10 21:18:41 -04:00
2024-05-06 10:48:39 -04:00
2025-02-10 20:21:39 +00:00
2025-03-04 00:21:02 +08:00
2025-03-04 00:21:02 +08:00
2024-04-07 23:21:45 -04:00
2024-04-07 23:21:45 -04:00
2024-11-26 02:50:48 +08: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
2024-04-06 23:25:58 +00:00
2025-02-18 17:34:16 +00:00
2025-02-18 17:34:16 +00:00
2024-11-23 05:27:45 +00:00
2024-11-23 05:27:45 +00:00
2024-11-21 01:35:34 +00:00
2024-11-21 01:35:34 +00:00
2024-03-31 21:03:59 -04:00
2024-03-31 21:03:59 -04:00
2024-03-21 00:07:44 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2024-11-26 02:50:48 +08:00
2025-01-26 21:20:31 +01:00
2024-04-21 20:10:12 -04:00
2025-01-06 16:12:04 -08:00
2025-01-06 16:12:04 -08:00
2024-06-21 21:13:10 +00:00
2024-03-25 20:20:01 +01:00
2024-03-25 20:20:01 +01:00
2025-02-25 08:06:30 +00:00
2025-02-25 08:06:30 +00:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:31:58 +00:00
2025-04-09 20:31:58 +00:00
2025-04-09 20:26:57 +00:00
2025-04-09 20:26:57 +00:00
2025-04-09 20:26:57 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2024-10-29 16:26:57 +00:00
2025-02-10 21:53:05 +00:00
2025-02-10 21:53:05 +00:00
2025-01-24 04:07:10 +00:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2025-02-10 20:21:39 +00:00