about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-generics.js
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-03-01 16:03:18 +0100
committerGitHub <noreply@github.com>2025-03-01 16:03:18 +0100
commita500a43367b862e35942ed85f376656140faad06 (patch)
tree91f248a77b7bd4252f77e85a9790e508ddb8fb6a /tests/rustdoc-js-std/parser-generics.js
parent88e75470a3ccc8a64e188e60f369897e6e764e30 (diff)
parentadb5ecabdb09ff6f329bbf9b7721036db983f546 (diff)
downloadrust-a500a43367b862e35942ed85f376656140faad06.tar.gz
rust-a500a43367b862e35942ed85f376656140faad06.zip
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``
Diffstat (limited to 'tests/rustdoc-js-std/parser-generics.js')
0 files changed, 0 insertions, 0 deletions