Matthias Krüger
504a78e2f2
Rollup merge of #123324 - Nadrieril:false-edges2, r=matthewjasper
...
match lowering: make false edges more precise
When lowering match expressions, we add false edges to hide details of the lowering from borrowck. Morally we pretend we're testing the patterns (and guards) one after the other in order. See the tests for examples. Problem is, the way we implement this today is too coarse for deref patterns.
In deref patterns, a pattern like `deref [1, x]` matches on a `Vec` by creating a temporary to store the output of the call to `deref()` and then uses that to continue matching. Here the pattern has a binding, which we set up after the pre-binding block. Problem is, currently the false edges tell borrowck that the pre-binding block can be reached from a previous arm as well, so the `deref()` temporary may not be initialized. This triggers an error when we try to use the binding `x`.
We could call `deref()` a second time, but this opens the door to soundness issues if the deref impl is weird. Instead in this PR I rework false edges a little bit.
What we need from false edges is a (fake) path from each candidate to the next, specifically from candidate C's pre-binding block to next candidate D's pre-binding block. Today, we link the pre-binding blocks directly. In this PR, I link them indirectly by choosing an earlier node on D's success path. Specifically, I choose the earliest block on D's success path that doesn't make a loop (if I chose e.g. the start block of the whole match (which is on the success path of all candidates), that would make a loop). This turns out to be rather straightforward to implement.
r? `@matthewjasper` if you have the bandwidth, otherwise let me know
2024-04-04 14:51:16 +02:00
..
2024-04-03 21:02:47 +02:00
2024-04-03 16:00:38 +02:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 16:00:38 +02:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-19 15:51:52 +00:00
2023-06-15 15:19:11 -04:00
2023-10-19 15:51:52 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-03-17 19:59:15 +01:00
2024-04-03 08:50:12 +00:00
2024-03-18 10:07:43 -04:00
2024-03-19 16:59:24 -04:00
2024-03-19 16:59:24 -04:00
2024-03-19 16:59:24 -04:00
2024-03-19 16:59:24 -04:00
2024-03-26 12:10:51 -04:00
2024-03-26 12:10:51 -04:00
2024-03-19 16:59:24 -04:00
2023-08-24 14:26:26 +02:00
2023-10-19 15:51:53 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-01-07 13:54:05 +00:00
2024-01-07 13:54:05 +00:00
2024-02-22 16:04:04 +00:00
2024-01-07 13:54:05 +00:00
2024-01-07 13:54:05 +00:00
2024-02-22 16:04:04 +00:00
2024-01-07 13:54:05 +00:00
2024-01-07 13:54:05 +00:00
2024-02-22 16:04:04 +00:00
2023-12-24 20:08:57 +00:00
2024-02-22 16:04:04 +00:00
2024-02-09 21:13:53 +00:00
2024-02-22 16:04:04 +00:00
2024-03-17 19:59:15 +01:00
2024-03-10 14:59:41 +01:00
2023-06-15 15:19:11 -04:00
2024-03-17 19:59:15 +01:00
2024-04-03 08:50:12 +00:00
2024-03-17 19:59:15 +01:00
2024-01-25 03:26:29 +00:00
2024-01-25 03:26:29 +00:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-12-11 23:11:20 +01:00
2024-02-22 16:04:04 +00:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2024-02-22 16:04:04 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-02-22 16:04:04 +00:00
2023-08-24 14:26:26 +02:00
2023-08-24 14:26:26 +02:00
2024-02-22 16:04:04 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2023-09-19 05:42:23 +00:00
2024-02-22 16:04:04 +00:00
2024-02-28 01:41:25 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-28 01:41:25 +01:00
2024-03-13 06:41:21 +01:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2024-02-28 01:41:25 +01:00
2024-03-13 06:41:21 +01:00
2024-02-28 01:41:25 +01:00
2024-02-22 16:04:04 +00:00
2023-10-16 16:29:35 +00:00
2023-10-16 16:29:35 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-10-16 16:29:35 +00:00
2023-10-16 16:29:35 +00:00
2023-06-28 00:41:37 +00:00
2024-02-22 16:04:04 +00:00
2024-03-07 22:58:51 +08:00
2024-03-07 22:58:51 +08:00
2024-03-22 20:14:39 -04:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2024-02-05 23:31:54 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-01-16 22:20:53 +00:00
2024-01-16 22:20:53 +00:00
2023-10-25 06:46:45 +00:00
2023-10-25 06:46:45 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2023-10-25 06:46:47 +00:00
2023-10-25 06:46:47 +00:00
2024-01-16 22:20:53 +00:00
2024-01-16 22:20:53 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-25 06:46:48 +00:00
2023-10-25 06:46:48 +00:00
2024-01-16 22:20:54 +00:00
2024-01-16 22:20:54 +00:00
2023-10-25 17:59:30 +00:00
2023-10-25 17:59:30 +00:00
2023-10-25 06:46:45 +00:00
2023-10-25 06:46:45 +00:00
2023-10-25 06:46:47 +00:00
2023-10-25 06:46:47 +00:00
2023-10-25 06:46:48 +00:00
2023-10-25 06:46:48 +00:00
2024-01-16 22:20:54 +00:00
2024-01-16 22:20:54 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-01-16 22:20:54 +00:00
2024-01-16 22:20:54 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2023-06-15 15:19:11 -04:00
2023-08-30 17:24:10 +08:00
2023-06-15 15:19:11 -04:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2024-02-22 16:04:04 +00:00
2024-03-22 17:17:03 -04:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-09-19 05:42:23 +00:00
2024-02-22 16:04:04 +00:00
2024-03-24 22:17:47 +11:00
2024-03-24 22:17:47 +11:00
2024-03-24 22:17:47 +11:00
2024-03-24 22:17:47 +11:00
2024-03-24 22:17:47 +11:00
2024-03-24 22:17:47 +11:00
2023-06-15 15:19:11 -04:00
2023-10-19 15:51:52 +00:00
2023-08-24 14:26:26 +02:00
2023-08-24 14:26:26 +02:00
2023-10-19 15:51:52 +00:00
2023-08-24 14:26:26 +02:00
2023-08-24 14:26:26 +02:00
2023-10-19 15:51:52 +00:00
2023-10-19 15:51:52 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-19 15:51:52 +00:00
2023-10-19 15:51:52 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-02-12 17:37:05 +01:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-02-17 20:21:57 +01:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2023-10-25 06:46:45 +00:00
2023-10-25 06:46:45 +00:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2024-02-17 20:21:57 +01:00
2023-08-24 14:26:26 +02:00
2023-06-15 15:19:11 -04:00
2024-02-17 20:21:57 +01:00
2024-02-22 16:04:04 +00:00
2024-03-18 16:44:12 +00:00
2024-03-18 16:44:12 +00:00
2023-10-19 15:51:52 +00:00
2024-01-16 22:20:53 +00:00
2024-01-16 22:20:53 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-19 15:51:52 +00:00
2024-02-13 17:21:53 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-01-23 00:00:22 +00:00
2024-01-23 00:00:22 +00:00
2023-10-21 06:58:38 +00:00
2023-10-21 06:58:38 +00:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2023-10-21 07:08:53 +00:00
2023-10-21 07:08:53 +00:00
2023-10-21 06:58:38 +00:00
2023-10-21 06:58:38 +00:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2023-10-21 06:58:38 +00:00
2023-10-21 06:58:38 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-21 06:58:38 +00:00
2023-10-21 06:58:38 +00:00
2023-10-21 07:01:24 +00:00
2023-10-21 07:01:24 +00:00
2024-02-22 16:04:04 +00:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2023-07-07 18:17:16 +02:00
2023-07-07 18:17:16 +02:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-07-07 18:17:16 +02:00
2023-07-07 18:17:16 +02:00
2023-07-07 18:17:16 +02:00
2023-07-07 18:17:16 +02:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-03-10 14:59:41 +01:00
2024-03-10 14:59:41 +01:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-02 21:23:53 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-03-23 23:23:41 -07:00
2024-03-23 23:23:41 -07:00
2024-03-23 23:23:41 -07:00
2024-03-23 23:23:41 -07:00
2024-03-23 23:23:41 -07:00
2024-03-23 23:23:41 -07:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2023-10-24 15:30:17 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-03-30 03:32:11 -07:00
2024-03-30 03:32:11 -07:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-08-30 17:24:10 +08:00
2023-08-30 17:24:10 +08:00
2024-02-22 16:04:04 +00:00
2024-04-03 21:02:47 +02:00
2024-04-03 21:02:47 +02:00
2023-10-19 15:51:52 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-08-30 17:24:10 +08:00
2024-02-22 16:04:04 +00:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2023-08-24 14:26:26 +02:00
2023-08-24 14:26:26 +02:00
2023-10-19 15:51:52 +00:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-23 18:36:25 +01:00
2024-02-22 16:04:04 +00:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2023-10-19 15:51:54 +00:00
2024-03-10 14:59:41 +01:00
2023-06-23 18:36:25 +01:00
2023-06-23 18:36:25 +01:00
2023-06-23 18:36:25 +01:00
2024-04-03 08:50:12 +00:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-08-17 17:02:04 +00:00
2023-08-17 17:02:04 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2023-11-08 22:55:29 +01:00
2023-11-08 22:55:29 +01:00
2023-10-19 15:51:52 +00:00
2023-06-15 15:19:11 -04:00
2024-01-06 14:17:33 -05:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-06-23 18:36:25 +01:00
2023-06-15 15:19:11 -04:00
2023-06-23 18:36:25 +01:00
2023-10-19 15:51:52 +00:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2023-10-19 15:51:52 +00:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-03-18 10:32:25 +01:00
2024-03-18 10:32:25 +01:00
2023-06-15 15:19:11 -04:00
2023-06-23 18:36:25 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-18 10:32:25 +01:00
2023-10-19 15:51:52 +00:00
2024-03-08 08:15:14 +08:00
2024-02-22 16:04:04 +00:00
2024-03-08 08:15:14 +08:00
2024-01-07 00:28:20 +00:00
2024-01-07 00:28:20 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2024-03-17 19:59:15 +01:00
2024-03-17 19:59:15 +01:00
2024-03-13 22:35:11 +08:00
2024-03-13 22:35:11 +08:00
2024-01-07 01:42:57 +00:00
2024-01-07 01:42:57 +00:00
2024-01-28 13:50:20 -06:00
2024-03-07 22:58:51 +08:00
2024-03-07 22:58:51 +08:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00
2023-06-23 18:36:25 +01:00
2024-02-22 16:04:04 +00:00
2024-02-12 17:37:05 +01:00
2024-02-22 16:04:04 +00:00
2023-07-07 18:17:16 +02:00
2023-06-15 15:19:11 -04:00
2023-06-15 15:19:11 -04:00
2024-04-03 16:00:38 +02:00
2023-06-15 15:19:11 -04:00
2024-04-03 16:00:38 +02:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2024-01-11 09:58:19 +00:00
2024-01-11 09:58:19 +00:00
2023-12-24 20:08:57 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-08-24 14:26:26 +02:00
2024-02-22 16:04:04 +00:00
2023-10-19 15:51:52 +00:00
2023-10-19 15:51:52 +00:00
2023-10-19 15:51:52 +00:00
2023-10-19 15:51:52 +00:00
2023-06-15 15:19:11 -04:00
2024-04-03 08:50:12 +00:00
2024-02-22 16:04:04 +00:00
2024-04-03 08:50:12 +00:00
2024-04-03 08:50:12 +00:00
2023-10-19 15:51:52 +00:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2023-10-31 11:44:23 +00:00
2023-10-31 11:44:23 +00:00
2024-02-22 16:04:04 +00:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-03-09 14:32:27 +08:00
2024-02-12 17:37:05 +01:00
2024-02-12 17:37:05 +01:00
2023-10-31 11:44:23 +00:00
2023-10-31 11:44:23 +00:00
2024-02-22 16:04:04 +00:00
2023-10-19 15:51:52 +00:00
2023-08-24 14:26:26 +02:00
2023-06-15 15:19:11 -04:00
2024-02-22 16:04:04 +00:00
2023-06-15 15:19:11 -04:00