Matthias Krüger
ffdb471872
Rollup merge of #117914 - estebank:issue-85843, r=wesleywiser
...
On borrow return type, suggest borrowing from arg or owned return type
When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type.
```
error[E0106]: missing lifetime specifier
--> $DIR/variadic-ffi-6.rs:7:6
|
LL | ) -> &usize {
| ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
|
LL | ) -> &'static usize {
| +++++++
help: instead, you are more likely to want to change one of the arguments to be borrowed...
|
LL | x: &usize,
| +
help: ...or alternatively, to want to return an owned value
|
LL - ) -> &usize {
LL + ) -> usize {
|
```
Fix #85843 .
2023-12-12 17:40:53 +01:00
..
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-07 23:00:46 -05:00
2023-11-24 19:15:52 +01:00
2023-11-24 21:04:51 +01:00
2023-08-14 15:25:20 +02:00
2023-11-24 19:15:52 +01:00
2023-10-16 15:50:31 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-13 09:42:51 +00:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-10-26 17:58:02 +00:00
2023-11-24 19:15:52 +01:00
2023-10-17 01:26:46 +00:00
2023-09-08 03:45:36 +00:00
2023-09-08 03:45:36 +00:00
2023-10-20 21:14:01 +00:00
2023-09-08 03:45:36 +00:00
2023-09-08 03:45:36 +00:00
2023-11-24 21:04:51 +01:00
2023-09-21 08:17:58 +02:00
2023-11-24 19:15:52 +01:00
2023-10-04 02:04:14 +00:00
2023-10-04 02:04:14 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-02 09:01:19 +11:00
2023-10-18 06:19:04 +00:00
2023-11-14 13:13:27 +00:00
2023-11-14 13:13:27 +00:00
2023-10-23 16:18:35 -04:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-09-08 03:45:36 +00:00
2023-09-08 03:45:36 +00:00
2023-08-11 03:15:41 +00:00
2023-10-05 01:04:41 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-07-30 17:15:55 +02:00
2023-07-30 17:15:55 +02:00
2023-11-24 19:15:52 +01:00
2023-11-20 23:44:36 +00:00
2023-11-24 19:15:52 +01:00
2023-10-05 18:56:30 +03:00
2023-10-05 18:56:30 +03:00
2023-11-24 19:15:52 +01:00
2023-12-05 19:53:59 +00:00
2023-12-05 19:53:59 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-09-23 13:47:30 +00:00
2023-10-05 01:04:41 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-08-30 11:06:46 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-08-14 15:25:20 +02:00
2023-08-14 15:25:20 +02:00
2023-08-14 15:25:20 +02:00
2023-09-21 22:20:58 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-08-27 22:03:16 +00:00
2023-11-24 19:15:52 +01:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-09-14 15:16:48 +00:00
2023-10-20 21:14:01 +00:00
2023-08-08 09:39:59 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-08 10:06:17 +00:00
2023-11-24 19:15:52 +01:00
2023-10-04 19:51:43 +00:00
2023-10-04 19:51:43 +00:00
2023-10-16 15:50:31 +00:00
2023-10-16 15:50:31 +00:00
2023-10-16 15:50:31 +00:00
2023-10-16 15:50:31 +00:00
2023-11-24 19:15:52 +01:00
2023-08-04 15:11:09 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-29 23:55:46 +00:00
2023-09-25 17:41:08 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-09 11:32:51 +01:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-12-07 23:00:46 -05:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-13 21:01:36 +00:00
2023-09-21 22:20:58 +02:00
2023-11-24 19:15:52 +01:00
2023-11-09 11:32:51 +01:00
2023-11-24 19:15:52 +01:00
2023-11-09 11:32:51 +01:00
2023-11-24 19:15:52 +01:00
2023-11-09 11:32:51 +01:00
2023-11-24 19:15:52 +01:00
2023-11-09 11:32:51 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-08 10:06:17 +00:00
2023-10-08 10:06:17 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-12-05 19:53:59 +00:00
2023-12-05 19:53:59 +00:00
2023-12-05 19:53:59 +00:00
2023-12-05 19:53:59 +00:00
2023-11-24 19:15:52 +01:00
2023-10-13 21:01:36 +00:00
2023-10-13 21:01:36 +00:00