Matthias Krüger
a500a43367
Rollup merge of #137824 - estebank:rtn-sugg, r=compiler-errors
...
Tweak invalid RTN errors
Make suggestions verbose.
When encountering `method(type)` bound, suggest `method(..)` instead of `method()`.
```
error: argument types not allowed with return type notation
--> $DIR/bad-inputs-and-output.rs:9:23
|
LL | fn foo<T: Trait<method(i32): Send>>() {}
| ^^^^^
|
help: remove the input types
|
LL - fn foo<T: Trait<method(i32): Send>>() {}
LL + fn foo<T: Trait<method(..): Send>>() {}
|
```
When encountering both return type and arg list that isn't `..`, suggest replacing both.
```
error: return type not allowed with return type notation
--> $DIR/bad-inputs-and-output.rs:12:25
|
LL | fn bar<T: Trait<method() -> (): Send>>() {}
| ^^^^^^
|
help: use the right argument notation and remove the return type
|
LL - fn bar<T: Trait<method() -> (): Send>>() {}
LL + fn bar<T: Trait<method(..): Send>>() {}
|
```
When encountering a return type, suggest removing it including the leading whitespace.
```
error: return type not allowed with return type notation
--> $DIR/bad-inputs-and-output.rs:24:45
|
LL | fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
| ^^^^^
|
help: remove the return type
|
LL - fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
LL + fn bay_path<T: Trait>() where T::method(..): Send {}
|
```
r? ``@compiler-errors``
2025-03-01 16:03:18 +01:00
..
2025-03-01 05:49:56 +01:00
2025-02-21 00:41:17 +00:00
2025-02-26 19:27:19 +00:00
2025-02-22 06:09:14 +00:00
2025-02-21 00:41:17 +00:00
2025-02-26 19:03:56 +01:00
2025-02-28 21:18:53 +00:00
2025-02-28 22:29:52 +08:00
2025-02-25 20:02:01 +00:00
2025-02-28 08:42:06 +11:00
2025-02-21 00:41:17 +00:00
2025-03-01 11:33:57 +01:00
2025-02-24 09:26:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-14 00:44:10 -08:00
2025-02-24 19:21:47 -05:00
2025-02-21 19:32:45 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 19:34:54 +00:00
2025-02-28 16:28:41 +00:00
2025-02-15 03:41:07 +01:00
2025-02-14 00:44:10 -08:00
2025-02-28 08:42:06 +11:00
2025-03-01 11:33:58 +01:00
2025-02-28 16:28:41 +00:00
2025-03-01 11:33:57 +01:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:54:01 +00:00
2025-02-24 14:31:19 +01:00
2025-02-24 19:34:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:41:17 +00:00
2025-02-25 16:56:04 +00:00
2025-02-25 08:06:30 +00:00
2025-02-26 19:03:29 +00:00
2025-02-24 16:41:18 +00:00
2025-02-14 00:44:10 -08:00
2025-02-24 18:48:40 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-03-01 11:33:58 +01:00
2025-02-21 00:54:01 +00:00
2025-02-28 16:28:41 +00:00
2025-02-23 14:12:38 +00:00
2025-02-21 17:37:03 +00:00
2025-03-01 11:33:58 +01:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:54:01 +00:00
2025-02-28 22:29:52 +08:00
2025-02-17 17:21:24 +00:00
2025-03-01 11:33:58 +01:00
2025-02-28 16:28:41 +00:00
2025-02-21 00:41:17 +00:00
2025-02-27 08:56:38 +01:00
2025-02-20 00:55:13 +01:00
2025-02-28 08:42:14 +11:00
2025-02-21 00:41:17 +00:00
2025-02-28 16:28:41 +00:00
2025-03-01 11:33:57 +01:00
2025-02-24 14:31:19 +01:00
2025-02-27 12:22:59 +01:00
2025-02-25 08:06:30 +00:00
2025-02-15 16:47:30 +01:00
2025-02-28 16:28:41 +00:00
2025-02-24 18:48:40 +00:00
2025-03-01 11:33:57 +01:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-28 20:43:15 +00:00
2025-02-28 16:28:41 +00:00
2025-02-28 07:25:52 +05:30
2025-02-28 08:42:14 +11:00
2025-02-21 00:41:17 +00:00
2025-02-14 00:44:10 -08:00
2025-02-21 00:41:17 +00:00
2025-02-24 09:26:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-28 01:29:58 +08:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:54:01 +00:00
2025-02-21 00:54:01 +00:00
2025-02-28 08:42:06 +11:00
2025-02-25 16:56:04 +00:00
2025-02-21 17:37:03 +00:00
2025-02-24 17:49:20 +03:00
2025-02-26 13:56:47 +00:00
2025-02-14 00:44:10 -08:00
2025-02-25 16:56:04 +00:00
2025-02-21 00:41:17 +00:00
2025-02-27 20:02:25 +00:00
2025-02-25 02:24:40 +00:00
2025-02-21 00:54:01 +00:00
2025-02-20 18:15:39 +00:00
2025-02-24 18:48:40 +00:00
2025-02-14 00:44:10 -08:00
2025-02-24 18:48:40 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 19:21:45 -05:00
2025-03-01 11:33:57 +01:00
2025-02-28 12:16:47 +01:00
2025-02-21 00:41:17 +00:00
2025-02-24 14:31:19 +01:00
2025-02-24 09:26:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-28 16:28:41 +00:00
2025-02-14 16:23:27 +01:00
2025-03-01 16:03:18 +01:00
2025-02-24 09:26:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-28 12:16:48 +01:00
2025-02-28 16:28:41 +00:00
2025-02-18 17:34:16 +00:00
2025-02-21 18:30:07 +00:00
2025-02-25 16:56:04 +00:00
2025-02-21 00:41:17 +00:00
2025-02-21 00:54:01 +00:00
2025-02-23 14:44:27 +08:00
2025-02-23 04:46:51 +00:00
2025-02-20 13:41:11 -06:00
2025-02-23 02:44:19 -05:00
2025-02-14 00:44:10 -08:00
2025-02-28 03:17:36 +00:00
2025-02-28 20:43:15 +00:00
2025-02-25 16:56:04 +00:00
2025-02-24 19:34:54 +00:00
2025-02-24 19:34:54 +00:00
2025-02-21 00:41:17 +00:00
2025-02-14 00:44:10 -08:00
2025-02-27 12:57:26 +08:00