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-10-17 17:33:55 +00:00
2023-10-30 22:19:17 +00:00
2023-02-22 08:40:47 -07:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-11-24 19:15:52 +01:00
2023-10-09 11:47:02 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-30 20:12:19 +00:00
2023-05-12 00:10:52 +00:00
2023-11-24 19:15:52 +01:00
2023-02-21 05:21:07 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-10 16:24:36 +03:00
2023-10-17 17:33:55 +00:00
2023-10-30 22:12:07 +00:00
2023-10-30 22:12:07 +00:00
2023-08-26 19:35:54 +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-24 19:15:52 +01:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-10-17 17:33:55 +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-12 17:40:53 +01:00
2023-11-24 19:15:52 +01:00
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-01-25 21:25:42 +01:00
2023-01-25 21:25:42 +01:00
2023-09-23 00:57:17 +00:00
2023-09-10 21:20:36 +00:00
2023-11-24 19:15:52 +01:00
2023-08-17 14:33:33 +02: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-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01: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-02-21 05:21:07 +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-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-10-30 22:19: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-11-24 19:15:52 +01:00
2023-04-20 15:06:17 -03:00
2023-08-28 17:47:37 -03: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-02-16 11:42:35 -03:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-30 20:12:21 +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-10 21:20:36 +00:00
2023-11-24 19:15:52 +01:00
2023-04-12 16:17:31 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-05-12 00:10:52 +00:00
2023-05-12 00:10:52 +00:00
2023-03-06 09:28:49 +00:00
2023-11-24 19:15:52 +01:00
2023-09-09 18:00:13 +02:00
2023-11-24 19:15:52 +01:00
2023-01-30 21:51:33 +00:00
2023-01-30 21:51:33 +00:00
2023-11-19 17:45:02 +01:00
2023-06-12 20:24:48 +08:00
2023-09-10 21:20:36 +00:00
2023-11-24 19:15:52 +01:00
2023-08-25 19:05:38 +00:00
2023-08-25 19:05:38 +00:00
2023-11-24 19:15:52 +01:00