Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add error message for c# style named arguments #118532

Closed
wants to merge 2 commits into from
Closed

add error message for c# style named arguments #118532

wants to merge 2 commits into from

Conversation

nouritsu
Copy link
Contributor

@nouritsu nouritsu commented Dec 2, 2023

Solves #116411
Result -

fn main() {
    let a = 50;

    foo(x: a);
}

fn foo(x: i32) {}

Output - image

fn main() {
    let a = 50;

    Foo::bar(x: a);
}

struct Foo {
    pub fn bar(x : i32){}
}

Output - image

@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 2, 2023
@rust-log-analyzer

This comment has been minimized.

@nouritsu
Copy link
Contributor Author

nouritsu commented Dec 3, 2023

Would I have to change the tests, since the error message is no longer the same? @estebank

@petrochenkov
Copy link
Contributor

r? compiler
I'm overloaded with reviews.

@rustbot rustbot assigned b-naber and unassigned petrochenkov Dec 4, 2023
@petrochenkov
Copy link
Contributor

r? compiler
b-naber doesn't do reviews.

@rustbot rustbot assigned davidtwco and unassigned b-naber Dec 4, 2023
@estebank
Copy link
Contributor

estebank commented Dec 4, 2023

r? @estebank

@nouritsu you need to run ./x.py test tests/ui --bless in order to update the relevant .stderr files.

@rustbot rustbot assigned estebank and unassigned davidtwco Dec 4, 2023
@nouritsu
Copy link
Contributor Author

nouritsu commented Dec 5, 2023

Running it does not seem to update any files. Am I missing something?
image
It hardly took any time and it did not change any files or output anything.

My bad, I am on nushell and not a bash terminal, forgot about the syntax.

@nouritsu
Copy link
Contributor Author

nouritsu commented Dec 5, 2023

This is the message from the command -
image

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 5, 2023

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=nouritsu
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_3b31cbaa-24f1-4a1d-bf58-e1f506584b40
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=ee8bda13d4a3bc060ec5e31ff005fff6f7d28750
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_3b31cbaa-24f1-4a1d-bf58-e1f506584b40
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_3b31cbaa-24f1-4a1d-bf58-e1f506584b40
GITHUB_TRIGGERING_ACTOR=nouritsu
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/118532/merge
GITHUB_WORKFLOW_SHA=ee8bda13d4a3bc060ec5e31ff005fff6f7d28750
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
........................................................................................ 10208/15901
...............................................................i........................ 10296/15901
......................i................................................................. 10384/15901
.............i.......................................................................... 10472/15901
......................................................................................F. 10560/15901
......................................................i.....F....F...................... 10648/15901
....F................................................................................... 10824/15901
.....i.................................................................................. 10912/15901
...........F............................................................................ 11000/15901
........................................................................................ 11088/15901
---

---- [ui] tests/ui/parser/issues/issue-111416.rs stdout ----
diff of stderr:

- error: invalid `struct` delimiters or `fn` call arguments
+ error: expected identifier, found `:`
+   --> $DIR/issue-111416.rs:2:30
3    |
3    |
4 LL |     let my = monad_bind(mx, T: Try);
+    |                              ^ expected identifier
6    |
6    |
- help: if `monad_bind` is a struct, use braces as delimiters
+ help: if this is a parameter, remove the name for the parameter
8    |
- LL |     let my = monad_bind { mx, T: Try };
-    |                         ~            ~
- help: if `monad_bind` is a function, use the arguments directly
-    |
13 LL -     let my = monad_bind(mx, T: Try);
14 LL +     let my = monad_bind(mx, Try);

16 
- error: aborting due to 1 previous error
- error: aborting due to 1 previous error
+ error: expected one of `)` or `,`, found `Try`
+    |
+    |
+ LL |     let my = monad_bind(mx, T: Try);
+    |                               -^^^ expected one of `)` or `,`
+    |                               help: missing `,`
18 
18 
+ error[E0425]: cannot find value `mx` in this scope
+    |
+    |
+ LL |     let my = monad_bind(mx, T: Try);
+ 
+ error[E0425]: cannot find value `Try` in this scope
+   --> $DIR/issue-111416.rs:2:32
+    |
+    |
+ LL |     let my = monad_bind(mx, T: Try);
+ 
+ 
+ error[E0425]: cannot find function `monad_bind` in this scope
+    |
+    |
+ LL |     let my = monad_bind(mx, T: Try);
+ 
+ error: aborting due to 5 previous errors
+ 
+ For more information about this error, try `rustc --explain E0425`.
---
To only update this specific test, also pass `--test-args parser/issues/issue-111416.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-111416.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-111416" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-111416/auxiliary"
--- stderr -------------------------------
error: expected identifier, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-111416.rs:2:30
   |
   |
LL |     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments
LL +     let my = monad_bind(mx, Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments


error: expected one of `)` or `,`, found `Try`
   |
   |
LL |     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments
   |                               -^^^ expected one of `)` or `,`
   |                               help: missing `,`


error[E0425]: cannot find value `mx` in this scope
   |
   |
LL |     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments

error[E0425]: cannot find value `Try` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-111416.rs:2:32
   |
   |
LL |     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments


error[E0425]: cannot find function `monad_bind` in this scope
   |
   |
LL |     let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0425`.
For more information about this error, try `rustc --explain E0425`.
------------------------------------------


---- [ui] tests/ui/parser/issues/issue-34255-1.rs stdout ----
diff of stderr:

- error: invalid `struct` delimiters or `fn` call arguments
+ error: expected expression, found `:`
+   --> $DIR/issue-34255-1.rs:8:22
3    |
3    |
4 LL |     Test::Drill(field: 42);
+    |                      ^ expected expression
6    |
6    |
- help: if `Test::Drill` is a struct, use braces as delimiters
+ help: if this is a parameter, remove the name for the parameter
8    |
- LL |     Test::Drill { field: 42 };
-    |                 ~           ~
- help: if `Test::Drill` is a function, use the arguments directly
-    |
13 LL -     Test::Drill(field: 42);
14 LL +     Test::Drill(42);

16 
- error: aborting due to 1 previous error
Build completed unsuccessfully in 0:12:52
Build completed unsuccessfully in 0:12:52
+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
+    |
+    |
+ LL |     Test::Drill(field: 42);
+    |                      |
+    |                      expected one of 8 possible tokens
+    |                      help: missing `,`
18 
18 
+ error: expected one of `)` or `,`, found `42`
+    |
+    |
+ LL |     Test::Drill(field: 42);
+    |                       -^^ expected one of `)` or `,`
+    |                       help: missing `,`
+ 
+ error[E0425]: cannot find value `field` in this scope
+   --> $DIR/issue-34255-1.rs:8:17
+   --> $DIR/issue-34255-1.rs:8:17
+    |
+ LL |     Test::Drill(field: 42);
+ 
+ 
+ error[E0533]: expected value, found struct variant `Test::Drill`
+    |
+    |
+ LL |     Test::Drill(field: 42);
+ 
+ error: aborting due to 5 previous errors
+ 
+ Some errors have detailed explanations: E0425, E0533.
---
To only update this specific test, also pass `--test-args parser/issues/issue-34255-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-34255-1.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-34255-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-34255-1/auxiliary"
--- stderr -------------------------------
error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-34255-1.rs:8:22
   |
   |
LL |     Test::Drill(field: 42);
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     Test::Drill(field: 42);
LL +     Test::Drill(42);


error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
   |
   |
LL |     Test::Drill(field: 42);
   |                      |
   |                      expected one of 8 possible tokens
   |                      help: missing `,`


error: expected one of `)` or `,`, found `42`
   |
   |
LL |     Test::Drill(field: 42);
   |                       -^^ expected one of `)` or `,`
   |                       help: missing `,`

error[E0425]: cannot find value `field` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-34255-1.rs:8:17
##[error]  --> /checkout/tests/ui/parser/issues/issue-34255-1.rs:8:17
   |
LL |     Test::Drill(field: 42);


error[E0533]: expected value, found struct variant `Test::Drill`
   |
   |
LL |     Test::Drill(field: 42);

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0425, E0533.
Some errors have detailed explanations: E0425, E0533.
For more information about an error, try `rustc --explain E0425`.
------------------------------------------


---- [ui] tests/ui/parser/issues/issue-44406.rs stdout ----
diff of stderr:

- error: invalid `struct` delimiters or `fn` call arguments
+ error: expected expression, found `:`
+   --> $DIR/issue-44406.rs:3:16
3    |
3    |
4 LL |         bar(baz: $rest)
+    |                ^ expected expression
6 ...
6 ...
7 LL |     foo!(true);

9    |
10    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
10    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
- help: if `bar` is a struct, use braces as delimiters
+ help: if this is a parameter, remove the name for the parameter
12    |
- LL |         bar { baz: $rest }
- help: if `bar` is a function, use the arguments directly
-    |
-    |
17 LL -         bar(baz: $rest)
18 LL +         bar(: $rest)

20 
- error: aborting due to 1 previous error
- error: aborting due to 1 previous error
+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
+    |
+    |
+ LL |         bar(baz: $rest)
+    |                |
+    |                expected one of 8 possible tokens
+    |                help: missing `,`
+ ...
+ ...
+ LL |     foo!(true);
+    |
+    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
22 
22 
+ error: expected one of `)` or `,`, found keyword `true`
+    |
+    |
+ LL |         bar(baz: $rest)
+    |                 - help: missing `,`
+ ...
+ LL |     foo!(true);
+    |          ^^^^ expected one of `)` or `,`
+ error[E0425]: cannot find value `baz` in this scope
+   --> $DIR/issue-44406.rs:3:13
+    |
+    |
+ LL |         bar(baz: $rest)
+ ...
+ ...
+ LL |     foo!(true);
+    |
+    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
+ error[E0425]: cannot find function `bar` in this scope
+ error[E0425]: cannot find function `bar` in this scope
+   --> $DIR/issue-44406.rs:3:9
+    |
+ LL |         bar(baz: $rest)
+ ...
+ ...
+ LL |     foo!(true);
+    |
+    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
+ error: aborting due to 5 previous errors
---
To only update this specific test, also pass `--test-args parser/issues/issue-44406.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-44406.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-44406" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-44406/auxiliary"
--- stderr -------------------------------
error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-44406.rs:3:16
   |
   |
LL |         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
...
...
LL |     foo!(true);
   |
   = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
LL +         bar(: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments


error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
   |
   |
LL |         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
   |                |
   |                expected one of 8 possible tokens
   |                help: missing `,`
...
...
LL |     foo!(true);
   |
   = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)


error: expected one of `)` or `,`, found keyword `true`
   |
   |
LL |         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
   |                 - help: missing `,`
...
LL |     foo!(true);
   |          ^^^^ expected one of `)` or `,`
error[E0425]: cannot find value `baz` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-44406.rs:3:13
   |
   |
LL |         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
...
...
LL |     foo!(true);
   |
   = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function `bar` in this scope
error[E0425]: cannot find function `bar` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-44406.rs:3:9
   |
LL |         bar(baz: $rest) //~ ERROR invalid `struct` delimiters or `fn` call arguments
...
...
LL |     foo!(true);
   |
   = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 5 previous errors
---
-   --> $DIR/issue-91461.rs:2:7
+ error: expected expression, found `:`
+   --> $DIR/issue-91461.rs:2:8
3    |
4 LL |     a(_:b:,)
+    |        ^ expected expression
+    |
+ help: if this is a parameter, remove the name for the parameter
+    |
+    |
+ LL -     a(_:b:,)
+ LL +     a(b:,)
6 
6 
7 error: expected one of `)`, `,`, `.`, `?`, or an operator, found `:`

9    |
9    |
10 LL |     a(_:b:,)
-    |        ^ expected one of `)`, `,`, `.`, `?`, or an operator
+    |        |
+    |        |
+    |        expected one of `)`, `,`, `.`, `?`, or an operator
+    |        help: missing `,`
- error: aborting due to 2 previous errors
- error: aborting due to 2 previous errors
+ error: expected one of `)` or `,`, found `b`
+    |
+    |
+ LL |     a(_:b:,)
+    |         |
+    |         |
+    |         expected one of `)` or `,`
+    |         help: missing `,`
+ error: expected expression, found `:`
+   --> $DIR/issue-91461.rs:2:10
+    |
+    |
+ LL |     a(_:b:,)
+    |
+ help: if this is a parameter, remove the name for the parameter
+    |
+    |
+ LL -     a(_:b:,)
+ LL +     a(_:,)
+ 
+ 
+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
+    |
+    |
+ LL |     a(_:b:,)
+    |          |
+    |          expected one of 8 possible tokens
+    |          help: missing `,`
+ 
+ 
+ error[E0425]: cannot find value `b` in this scope
+   --> $DIR/issue-91461.rs:2:9
+    |
+ LL |     a(_:b:,)
+ 
+ 
+ error: in expressions, `_` can only be used on the left-hand side of an assignment
+    |
+    |
+ LL |     a(_:b:,)
+    |       ^ `_` not allowed here
+ error[E0425]: cannot find function `a` in this scope
+   --> $DIR/issue-91461.rs:2:5
+    |
+    |
+ LL |     a(_:b:,)
+ 
+ error: aborting due to 8 previous errors
+ 
+ For more information about this error, try `rustc --explain E0425`.
---
To only update this specific test, also pass `--test-args parser/issues/issue-91461.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-91461.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-91461" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issues/issue-91461/auxiliary"
--- stderr -------------------------------
error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-91461.rs:2:8
   |
   |
LL |     a(_:b:,)
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     a(_:b:,)
LL +     a(b:,)


error: expected one of `)`, `,`, `.`, `?`, or an operator, found `:`
   |
   |
LL |     a(_:b:,)
   |        |
   |        |
   |        expected one of `)`, `,`, `.`, `?`, or an operator
   |        help: missing `,`

error: expected one of `)` or `,`, found `b`
   |
   |
LL |     a(_:b:,)
   |         |
   |         |
   |         expected one of `)` or `,`
   |         help: missing `,`
error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-91461.rs:2:10
   |
   |
LL |     a(_:b:,)
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     a(_:b:,)
LL +     a(_:,)


error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
   |
   |
LL |     a(_:b:,)
   |          |
   |          expected one of 8 possible tokens
   |          help: missing `,`


error[E0425]: cannot find value `b` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-91461.rs:2:9
   |
LL |     a(_:b:,)


error: in expressions, `_` can only be used on the left-hand side of an assignment
   |
   |
LL |     a(_:b:,)
   |       ^ `_` not allowed here
error[E0425]: cannot find function `a` in this scope
##[error]  --> /checkout/tests/ui/parser/issues/issue-91461.rs:2:5
   |
   |
LL |     a(_:b:,)

error: aborting due to 8 previous errors

For more information about this error, try `rustc --explain E0425`.
For more information about this error, try `rustc --explain E0425`.
------------------------------------------


---- [ui] tests/ui/parser/recover/recover-from-bad-variant.rs stdout ----
diff of stderr:

- error: invalid `struct` delimiters or `fn` call arguments
+ error: expected expression, found `:`
+   --> $DIR/recover-from-bad-variant.rs:7:24
3    |
3    |
4 LL |     let x = Enum::Foo(a: 3, b: 4);
+    |                        ^ expected expression
6    |
- help: if `Enum::Foo` is a struct, use braces as delimiters
+ help: if this is a parameter, remove the name for the parameter
+ help: if this is a parameter, remove the name for the parameter
8    |
- LL |     let x = Enum::Foo { a: 3, b: 4 };
- help: if `Enum::Foo` is a function, use the arguments directly
- help: if `Enum::Foo` is a function, use the arguments directly
+ LL -     let x = Enum::Foo(a: 3, b: 4);
+ LL +     let x = Enum::Foo(3, b: 4);
+ 
+ 
+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+    |                        |
+    |                        expected one of 8 possible tokens
+    |                        help: missing `,`
+ 
+ 
+ error: expected one of `)` or `,`, found `3`
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+    |                         -^ expected one of `)` or `,`
+    |                         help: missing `,`
+ 
+ error: expected expression, found `:`
+   --> $DIR/recover-from-bad-variant.rs:7:30
+   --> $DIR/recover-from-bad-variant.rs:7:30
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+    |
+ help: if this is a parameter, remove the name for the parameter
+    |
+    |
13 LL -     let x = Enum::Foo(a: 3, b: 4);
- LL +     let x = Enum::Foo(3, 4);
+ LL +     let x = Enum::Foo(a: 3, 4);
16 
16 
+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+    |                              |
+    |                              expected one of 8 possible tokens
+    |                              help: missing `,`
+ 
+ 
+ error: expected one of `)` or `,`, found `4`
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+    |                               -^ expected one of `)` or `,`
+    |                               help: missing `,`
+ 
+ error[E0425]: cannot find value `a` in this scope
+   --> $DIR/recover-from-bad-variant.rs:7:23
+   --> $DIR/recover-from-bad-variant.rs:7:23
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+ 
+ error[E0425]: cannot find value `b` in this scope
+   --> $DIR/recover-from-bad-variant.rs:7:29
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+ 
+ error[E0533]: expected value, found struct variant `Enum::Foo`
+   --> $DIR/recover-from-bad-variant.rs:7:13
+    |
+    |
+ LL |     let x = Enum::Foo(a: 3, b: 4);
+ 
17 error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
18   --> $DIR/recover-from-bad-variant.rs:10:9
19    |
19    |

31 LL |         Enum::Bar(a, b) => {}
33 
- error: aborting due to 3 previous errors
+ error: aborting due to 11 previous errors
35 
---
--- stderr -------------------------------
error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:24
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     let x = Enum::Foo(a: 3, b: 4);
LL +     let x = Enum::Foo(3, b: 4);


error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |                        |
   |                        expected one of 8 possible tokens
   |                        help: missing `,`


error: expected one of `)` or `,`, found `3`
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |                         -^ expected one of `)` or `,`
   |                         help: missing `,`

error: expected expression, found `:`
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:30
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:30
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     let x = Enum::Foo(a: 3, b: 4);
LL +     let x = Enum::Foo(a: 3, 4);


error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |                              |
   |                              expected one of 8 possible tokens
   |                              help: missing `,`


error: expected one of `)` or `,`, found `4`
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);
   |                               -^ expected one of `)` or `,`
   |                               help: missing `,`

error[E0425]: cannot find value `a` in this scope
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:23
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:23
   |
LL |     let x = Enum::Foo(a: 3, b: 4);

error[E0425]: cannot find value `b` in this scope
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:29
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);

error[E0533]: expected value, found struct variant `Enum::Foo`
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:7:13
   |
   |
LL |     let x = Enum::Foo(a: 3, b: 4);

error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
##[error]  --> /checkout/tests/ui/parser/recover/recover-from-bad-variant.rs:10:9
   |
   |
LL |         Enum::Foo(a, b) => {}
   |         ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant

error[E0769]: tuple variant `Enum::Bar` written as struct variant
   |
   |
LL |         Enum::Bar { a, b } => {}
   |
help: use the tuple variant pattern syntax instead
   |
   |
LL |         Enum::Bar(a, b) => {}

error: aborting due to 11 previous errors

Some errors have detailed explanations: E0164, E0425, E0533, E0769.
---
---- [ui] tests/ui/type/type-ascription-precedence.rs stdout ----
diff of stderr:

9    |
10 LL |     *(S: Z);
+    |
+ help: if this is a parameter, remove the name for the parameter
+    |
+    |
+ LL -     *(S: Z);
+ LL +     *(Z);
12 
12 
+ error: expected one of `)` or `,`, found `Z`
+    |
+    |
+ LL |     *(S: Z);
+    |         -^ expected one of `)` or `,`
+    |         help: missing `,`
+ 
13 error: expected identifier, found `:`
14   --> $DIR/type-ascription-precedence.rs:37:8
14   --> $DIR/type-ascription-precedence.rs:37:8
15    |

16 LL |     -(S: Z);
+    |
+ help: if this is a parameter, remove the name for the parameter
+    |
+    |
+ LL -     -(S: Z);
+ LL +     -(Z);
18 
18 
+ error: expected one of `)` or `,`, found `Z`
+    |
+    |
+ LL |     -(S: Z);
+    |         -^ expected one of `)` or `,`
+    |         help: missing `,`
+ 
19 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
20   --> $DIR/type-ascription-precedence.rs:41:12
20   --> $DIR/type-ascription-precedence.rs:41:12
21    |

42 LL |     (S .. S): S;
43    |             ^ expected one of `.`, `;`, `?`, `}`, or an operator
- error: aborting due to 7 previous errors
+ error: aborting due to 9 previous errors
46 
47 
---
--- stderr -------------------------------
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:27:7
   |
LL |     &S: &S; //~ ERROR expected one of

error: expected identifier, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:33:8
   |
   |
LL |     *(S: Z); //~ ERROR expected identifier
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     *(S: Z); //~ ERROR expected identifier
LL +     *(Z); //~ ERROR expected identifier


error: expected one of `)` or `,`, found `Z`
   |
   |
LL |     *(S: Z); //~ ERROR expected identifier
   |         -^ expected one of `)` or `,`
   |         help: missing `,`

error: expected identifier, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:37:8
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:37:8
   |
LL |     -(S: Z); //~ ERROR expected identifier
   |
help: if this is a parameter, remove the name for the parameter
   |
   |
LL -     -(S: Z); //~ ERROR expected identifier
LL +     -(Z); //~ ERROR expected identifier


error: expected one of `)` or `,`, found `Z`
   |
   |
LL |     -(S: Z); //~ ERROR expected identifier
   |         -^ expected one of `)` or `,`
   |         help: missing `,`

error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:41:12
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:41:12
   |
LL |     (S + Z): Z; //~ ERROR expected one of
   |            ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:45:12
   |
   |
LL |     (S * Z): Z; //~ ERROR expected one of
   |            ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: expected identifier, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:49:11
   |
   |
LL |     S .. S: S; //~ ERROR expected identifier, found `:`
   |
   = note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>

error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
##[error]  --> /checkout/tests/ui/type/type-ascription-precedence.rs:53:13
   |
LL |     (S .. S): S; //~ ERROR expected one of
   |             ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: aborting due to 9 previous errors
------------------------------------------


@estebank
Copy link
Contributor

estebank commented Dec 6, 2023

@nouritsu That output seems odd. Can you try to follow the instructions at https://rustc-dev-guide.rust-lang.org/tests/running.html? I wonder if there's some uncommon set-up in your environment for that error to happen. (raises fist at OSError not printing the path that caused the problem)

Also, we don't include merge commits in PRs, we always rebase on top of a newer master.

@nouritsu
Copy link
Contributor Author

nouritsu commented Dec 8, 2023

I'm not familiar with git, I will be opening a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants