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

Fix confusing error message for comma typo in multiline statement #72348

Merged
merged 1 commit into from
May 27, 2020

Conversation

chrissimpkins
Copy link
Member

@chrissimpkins chrissimpkins commented May 19, 2020

Fixes #72253. Expands on the issue with a colon typo check.

r? @estebank

cc @ehuss

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 18'
Agent machine name: 'fv-az578'
Current agent version: '2.168.2'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200512.2
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200512.2/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.2)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/33f2ce97-719d-48b6-b07b-cd23c6fa0c43.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72348/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72348/merge:refs/remotes/pull/72348/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
..................................................................i................................. 1800/10187
.................................................................................................... 1900/10187
.....................................................................................i..i........... 2000/10187
.................................................................................................... 2100/10187
...........................................................................iiiii.................... 2200/10187
.................................................................................................... 2400/10187
.................................................................................................... 2500/10187
.................................................................................................... 2600/10187
.................................................................................................... 2700/10187
---
.......i............................................................................................ 5200/10187
.................................................................................................... 5300/10187
......................................i............................................................. 5400/10187
...............................i.................F.................................................. 5500/10187
........................................ii.ii........i...i.......................................... 5600/10187
..........................................................................................i......... 5800/10187
.................................................................................................... 5900/10187
.....................................ii.....................................i....................... 6000/10187
.................................................................................................... 6100/10187
.................................................................................................... 6100/10187
.................................................................................................... 6200/10187
..................................................................................................ii 6300/10187
...i..ii...........i................................................................................ 6400/10187
.................................................................................................... 6600/10187
.................................................................................................... 6700/10187
.................................................................................................... 6700/10187
...............................i..ii................................................................ 6800/10187
.................................................................................................... 7000/10187
.....................................................................................i.............. 7100/10187
.................................................................................................... 7200/10187
.................................................................................................... 7300/10187
---
.................................................................................................... 8100/10187
.................................................................................................... 8200/10187
.................................................................................................... 8300/10187
.........i.......................................................................................... 8400/10187
..............................................................iiiiii.iiiiii.i....................... 8500/10187
................i................................................................................... 8700/10187
.................................................................................................... 8800/10187
.................................................................................................... 8900/10187
.................................................................................................... 9000/10187
---
failures:

---- [ui] ui/issues/issue-72253.rs stdout ----

error: /checkout/src/test/ui/issues/issue-72253.rs:4: unexpected error: '4:9: 4:10: expected `;`, found `,`'
error: /checkout/src/test/ui/issues/issue-72253.rs:4: unexpected error: '4:9: 4:10: expected expression, found `,`'

error: 2 unexpected errors found, 0 expected errors not found
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-72253.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-72253" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-72253/auxiliary"
    Error {
        line_num: 4,
        kind: Some(
            Error,
            Error,
        ),
        msg: "4:9: 4:10: expected `;`, found `,`",
    Error {
        line_num: 4,
        kind: Some(
            Error,
---

thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 0:54:33
Build completed unsuccessfully in 0:54:33
== clock drift check ==
  local time: Tue May 19 13:05:00 UTC 2020
  network time: Tue, 19 May 2020 13:05:00 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72348/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72348/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3544) (python)
##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for taking the time to look into this!

I have a couple of comments I would like you to address before this is merged.

src/librustc_parse/parser/diagnostics.rs Show resolved Hide resolved
src/librustc_parse/parser/diagnostics.rs Outdated Show resolved Hide resolved
src/librustc_parse/parser/diagnostics.rs Outdated Show resolved Hide resolved
src/librustc_parse/parser/diagnostics.rs Outdated Show resolved Hide resolved
src/librustc_parse/parser/diagnostics.rs Outdated Show resolved Hide resolved
src/librustc_parse/parser/diagnostics.rs Show resolved Hide resolved
@chrissimpkins
Copy link
Member Author

Thank you very much for your review Esteban. I'll have a look at these issues.

Do you happen to know what is going on with the new UI test fail? I ran it locally with --bless and confirmed that the formatting issues with paths and line numbers are resolved for the string comparisons. I don't understand the error that is being raised, nor how to address it. I think that the current compiler stderr stream string and stderr file string match at this stage. I'd like to understand how to appropriately add a new UI test irrespective of whether we end up using the one that is proposed at the moment. Do I need to add a stdout file too? It looks like the fail may be on the stdout?

@estebank
Copy link
Contributor

You did the right thing. By running --bless you update the .stderr files, but the .rs test file also has comments that start with //~ ERROR followed by the error message that check the current line for an error being emitted on it (or //~^ ERROR to point at the line above). You just need to change the comment from // error: to //~ ERROR . Sorry I didn't catch that before :)

We care about both because the comments highlight intent, while we look at the stderr files as a sanity check that we don't regress the way humans actually see the error.

@chrissimpkins
Copy link
Member Author

You just need to change the comment from // error: to //~ ERROR .

I can confirm that this fixes the test. Ty!

@chrissimpkins chrissimpkins requested a review from estebank May 20, 2020 13:12
@chrissimpkins
Copy link
Member Author

CI is failing but it looks like this is an issue with tidy checks on source unrelated to this PR

https://github.com/rust-lang/rust/pull/72348/checks?check_run_id=700945715#step:24:1208

@chrissimpkins
Copy link
Member Author

chrissimpkins commented May 25, 2020

@estebank I think that we are gtg here. I pushed a new commit and CI is passing.

@estebank
Copy link
Contributor

LGTM. Can we squash all commits into a single commit for log cleanliness sake? Other than that, r=me

confusing diagnostics, issue rust-lang#72253

add test for confusing error message, issue-72253


remove is_multiline check, refactor to self.expect(&token:Semi)


update issue-72253 tests


return Ok
@chrissimpkins
Copy link
Member Author

Squashed to f384cdc

@chrissimpkins
Copy link
Member Author

@bors r=estebank

@bors
Copy link
Contributor

bors commented May 26, 2020

@chrissimpkins: 🔑 Insufficient privileges: Not in reviewers

@chrissimpkins
Copy link
Member Author

@chrissimpkins: 🔑 Insufficient privileges: Not in reviewers

@estebank ^^

@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 27, 2020

📌 Commit f384cdc has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 27, 2020
Fix confusing error message for comma typo in multiline statement

Fixes rust-lang#72253.  Expands on the issue with a colon typo check.

r? @estebank

cc @ehuss
bors added a commit to rust-lang-ci/rust that referenced this pull request May 27, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#72348 (Fix confusing error message for comma typo in multiline statement)
 - rust-lang#72533 (Resolve UB in Arc/Weak interaction (2))
 - rust-lang#72548 (Add test for old compiler ICE when using `Borrow`)
 - rust-lang#72606 (Small cell example update)
 - rust-lang#72610 (Remove font-display settings)
 - rust-lang#72626 (Add remark regarding DoubleEndedIterator)

Failed merges:

r? @ghost
@bors bors merged commit cbe7b90 into rust-lang:master May 27, 2020
@chrissimpkins chrissimpkins deleted the fix-72253 branch May 27, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odd suggestion for comma typo
4 participants