diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-18 08:09:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-18 08:09:02 +0200 |
| commit | 77e5bbf3412a6e5d4defb3445c729dc457cd1fc0 (patch) | |
| tree | 29470eed894270e4f81716b839c190806fdf0099 /tests/ui | |
| parent | d78be31a2ae54027439dc638d7d781011ac6f0ab (diff) | |
| parent | f6c4679547b405c0634a0d1938149ba748876d27 (diff) | |
| download | rust-77e5bbf3412a6e5d4defb3445c729dc457cd1fc0.tar.gz rust-77e5bbf3412a6e5d4defb3445c729dc457cd1fc0.zip | |
Rollup merge of #127889 - estebank:anon-arg-sugg, r=compiler-errors
More accurate span for anonymous argument suggestion
Use smaller span for suggesting adding `_:` ahead of a type:
```
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:12:47
|
LL | fn foo_with_qualified_path(<Bar as T>::Baz);
| ^ expected one of 8 possible tokens
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path(_: <Bar as T>::Baz);
| ++
```
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/anon-params/anon-params-denied-2018.stderr | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/anon-params/anon-params-denied-2018.stderr b/tests/ui/anon-params/anon-params-denied-2018.stderr index bb60c898e81..2d6356ffcb1 100644 --- a/tests/ui/anon-params/anon-params-denied-2018.stderr +++ b/tests/ui/anon-params/anon-params-denied-2018.stderr @@ -48,7 +48,7 @@ LL | fn foo_with_qualified_path(<Bar as T>::Baz); help: explicitly ignore the parameter name | LL | fn foo_with_qualified_path(_: <Bar as T>::Baz); - | ~~~~~~~~~~~~~~~~~~ + | ++ error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` --> $DIR/anon-params-denied-2018.rs:15:56 @@ -60,7 +60,7 @@ LL | fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz); help: explicitly ignore the parameter name | LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz); - | ~~~~~~~~~~~~~~~~~~~ + | ++ error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,` --> $DIR/anon-params-denied-2018.rs:18:57 @@ -72,7 +72,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz); help: explicitly ignore the parameter name | LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz); - | ~~~~~~~~~~~~~~~~~~ + | ++ error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` --> $DIR/anon-params-denied-2018.rs:18:74 @@ -84,7 +84,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz); help: explicitly ignore the parameter name | LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz); - | ~~~~~~~~~~~~~~~~~~ + | ++ error: expected one of `:`, `@`, or `|`, found `,` --> $DIR/anon-params-denied-2018.rs:22:36 |
