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-02-22 00:01:48 +00:00
2025-02-28 17:17:45 +01:00
2025-02-22 00:01:48 +00:00
2025-02-28 21:32:39 +00:00
2025-02-22 00:01:48 +00:00
2025-03-01 16:03:18 +01:00
2025-02-25 16:56:03 +00:00
2025-02-27 09:53:17 +11:00
2025-02-26 22:21:36 +00:00
2025-02-28 08:42:14 +11:00
2025-02-22 00:01:48 +00:00
2025-02-28 01:27:08 +00:00
2025-02-27 19:32:30 +05:30
2025-02-28 17:17:45 +01:00
2025-03-01 16:03:10 +01:00
2025-03-01 16:03:10 +01:00
2025-03-01 16:03:10 +01:00
2025-03-01 16:03:10 +01:00
2025-02-27 08:56:36 +01:00
2025-02-22 00:01:48 +00:00
2025-02-22 00:01:48 +00:00
2025-02-27 08:33:44 -08:00
2025-02-22 00:01:48 +00:00
2025-02-25 17:27:22 +00:00
2025-02-28 08:42:14 +11:00
2025-02-28 20:43:15 +00:00
2025-02-22 00:01:48 +00:00
2025-02-22 00:01:48 +00:00
2025-02-22 00:01:48 +00:00
2025-02-22 00:01:48 +00:00
2025-03-01 05:49:52 +01:00
2025-03-01 11:33:58 +01:00
2025-03-01 05:49:52 +01:00
2025-03-01 11:34:00 +01:00
2025-02-24 14:22:31 +01:00
2025-02-24 02:11:32 -05:00
2025-02-22 00:01:48 +00:00
2025-02-26 17:32:26 +00:00
2025-02-22 13:32:44 +00:00
2025-02-22 22:24:52 +00:00
2025-02-28 21:41:58 +08:00
2025-02-24 14:31:17 +01:00
2025-03-01 08:22:18 +00:00
2025-02-22 00:01:48 +00:00
2025-02-24 14:31:19 +01:00
2025-02-26 19:03:55 +01:00
2025-03-01 11:34:02 +01:00
2025-03-01 05:49:52 +01:00
2025-02-22 22:24:52 +00:00
2025-02-28 17:17:45 +01:00
2025-02-28 17:17:45 +01:00
2025-03-01 11:34:01 +01:00
2025-03-01 16:03:18 +01:00
2025-02-22 00:01:48 +00:00
2025-02-27 04:56:27 +00:00
2025-02-22 22:24:52 +00:00
2025-02-24 14:31:17 +01:00
2025-02-24 14:26:06 +01:00
2025-02-24 14:26:06 +01:00
2025-03-01 11:33:58 +01:00
2025-02-24 14:31:17 +01:00
2025-02-23 23:11:00 +07:00
2025-03-01 08:22:18 +00:00
2025-02-28 17:17:45 +01:00
2025-02-28 20:43:15 +00:00
2025-02-24 14:31:17 +01:00
2025-02-28 17:17:45 +01:00
2025-03-01 16:03:17 +01:00
2025-02-22 11:36:43 +01:00
2025-02-28 17:31:31 +11:00
2025-03-01 16:03:10 +01:00
2025-03-01 05:49:53 +01:00
2025-02-22 00:01:48 +00:00
2025-02-24 14:31:19 +01:00