Trevor Gross
58e5c2629d
Rollup merge of #143742 - estebank:borrow-suggestion, r=compiler-errors
...
Rework borrowing suggestions to use `Expr` instead of just `Span`
In the suggestion machinery for borrowing expressions and types, always use the available obligation `Span` to find the appropriate `Expr` to perform appropriateness checks no the `ExprKind` instead of on the textual snippet corresponding to the `Span`. (We were already doing this, but only for a subset of cases.) This now better handles situations where parentheses and `<>` are needed for correct syntax (`&(foo + bar)`, `(&foo).bar()`, `<&Foo>::bar()`, etc.).
Unify the logic for the case where `&` *and* `&mut` are appropriate with the logic for only one of those cases. (Instead of having two branches for emitting the suggestion, we now have a single one, using `Diag::multipart_suggestions` always.)
Handle the case when `S::foo()` should have been `<&S>::foo()` (instead of suggesting the prior `&S::foo()`. Fix rust-lang/rust#143393 .
Make `Diag::multipart_suggestions` always verbose. CC rust-lang/rust#141973 .
2025-07-10 20:20:40 -04:00
..
2025-06-25 17:02:26 +00:00
2025-05-09 02:35:18 +00:00
2025-04-14 13:26:13 +02:00
2025-05-04 18:27:45 +03:00
2025-06-24 19:55:42 +06:00
2025-07-10 17:23:29 +00:00
2025-06-25 17:02:26 +00:00
2025-03-11 12:05:02 +00:00
2025-05-02 11:46:31 -07:00
2025-06-26 20:06:23 +00:00
2025-04-03 11:13:10 +02:00
2025-04-03 11:13:10 +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-06-09 17:02:09 +00:00
2025-07-07 16:47:15 +08:00
2025-06-09 17:02:09 +00:00
2025-07-07 16:47:15 +08:00
2025-06-30 11:50:19 +05:00
2024-10-16 13:44:56 -04:00
2025-03-11 12:05:02 +00:00
2025-04-08 23:06:31 +03:00
2025-04-08 23:06:31 +03:00
2025-04-08 23:06:31 +03:00
2025-01-01 19:32:51 +00:00
2025-01-01 19:32:51 +00:00
2024-10-30 16:19:53 +00: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-05-27 08:18:11 +00:00
2025-05-27 08:18:11 +00:00
2024-10-10 01:13:29 +02:00
2024-10-10 01:13:29 +02: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-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2024-12-27 19:58:16 +11:00
2024-11-21 15:49:55 -08: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
2024-09-25 13:26:48 +02:00
2025-03-11 12:05:02 +00:00
2025-01-11 19:22:06 +00:00
2025-01-11 19:22:06 +00: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-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-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-06-04 10:40:04 -04: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-02-10 20:21:39 +00: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
2025-04-08 23:06:31 +03: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
2024-10-15 20:42:17 -04:00
2025-04-08 23:06:31 +03:00
2025-01-11 19:22:06 +00: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
2024-11-02 03:08:04 +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
2024-11-02 03:08:04 +00:00
2025-04-30 10:44:24 +03:00
2025-05-24 23:31:07 +02:00
2025-06-26 13:46:45 +00:00
2025-07-08 14:36:43 +00:00
2024-11-02 03:08:04 +00:00
2025-03-03 05:57:55 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-03 19:00:22 +00:00
2025-02-10 20:21:39 +00:00
2024-11-02 03:08:04 +00:00
2025-06-03 14:23:56 +02:00
2025-06-03 14:23:56 +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-05-20 10:08:56 +00:00
2025-06-09 17:02:09 +00:00
2025-06-09 17:02:09 +00: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-03-11 12:05:02 +00:00
2025-06-04 10:40:04 -04:00
2025-06-04 10:40:04 -04:00
2025-01-24 01:19:50 +00:00
2025-01-24 01:19:50 +00:00
2025-06-25 15:42:11 +00:00
2025-02-10 20:21:39 +00:00
2025-04-03 11:13:10 +02:00
2025-06-09 17:02:09 +00:00
2025-06-09 17:02:09 +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-02-02 02:39:43 +00:00
2024-10-15 21:01:42 -04:00
2024-11-26 11:45:01 +01:00
2024-11-26 11:45:01 +01:00
2024-11-26 11:45:01 +01:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2024-11-26 11:45:01 +01:00
2024-11-26 11:45:01 +01:00
2025-02-09 19:09:45 +00:00
2025-02-09 19:09:45 +00:00
2025-04-08 23:06:31 +03:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00