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 long error explanation for E0573 #65234

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

GuillaumeGomez
Copy link
Member

Part of #61137.

@rust-highfive
Copy link
Collaborator

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

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

The job x86_64-gnu-llvm-6.0 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.
2019-10-09T12:21:24.5631823Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-09T12:21:24.5822943Z ##[command]git config gc.auto 0
2019-10-09T12:21:24.5918570Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-09T12:21:24.5980801Z ##[command]git config --get-all http.proxy
2019-10-09T12:21:24.6142590Z ##[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/65234/merge:refs/remotes/pull/65234/merge
---
2019-10-09T13:26:34.4513905Z .................................................................................................... 1600/9142
2019-10-09T13:26:42.3767315Z .................................................................................................... 1700/9142
2019-10-09T13:26:54.5402319Z .................i...............i.................................................................. 1800/9142
2019-10-09T13:27:02.4777144Z .................................................................................................... 1900/9142
2019-10-09T13:27:19.6823318Z ........iiiii....................................................................................... 2000/9142
2019-10-09T13:27:29.7417994Z .................................................................................................... 2200/9142
2019-10-09T13:27:32.8859040Z .................................................................................................... 2300/9142
2019-10-09T13:27:38.8850995Z .................................................................................................... 2400/9142
2019-10-09T13:27:45.9383793Z .................................................................................................... 2500/9142
---
2019-10-09T13:30:52.1514336Z .................................................................................................... 4700/9142
2019-10-09T13:31:00.5187547Z .i...............i.................................................................................. 4800/9142
2019-10-09T13:31:12.8199690Z .................................................................................................... 4900/9142
2019-10-09T13:31:18.3929210Z .................................................................................................... 5000/9142
2019-10-09T13:31:29.5191463Z ...............................................................................................ii.ii 5100/9142
2019-10-09T13:31:40.1807775Z .................................................................................................... 5300/9142
2019-10-09T13:31:50.1468506Z .................................................................................................... 5400/9142
2019-10-09T13:31:57.4898914Z .............................................................i...................................... 5500/9142
2019-10-09T13:32:05.3531630Z .................................................................................................... 5600/9142
2019-10-09T13:32:05.3531630Z .................................................................................................... 5600/9142
2019-10-09T13:32:13.3714633Z .................................................................................................... 5700/9142
2019-10-09T13:32:25.5264722Z ..........................................................ii...i..ii...........i.................... 5800/9142
2019-10-09T13:32:53.6278569Z .................................................................................................... 6000/9142
2019-10-09T13:33:03.8416391Z .................................................................................................... 6100/9142
2019-10-09T13:33:03.8416391Z .................................................................................................... 6100/9142
2019-10-09T13:33:12.4038385Z ................................................................i..ii............................... 6200/9142
2019-10-09T13:33:44.7665243Z .................................................................................................... 6400/9142
2019-10-09T13:33:47.0321163Z ........................i........................................................................... 6500/9142
2019-10-09T13:33:49.3548113Z .................................................................................................i.. 6600/9142
2019-10-09T13:33:52.3256971Z .................................................................................................... 6700/9142
---
2019-10-09T13:38:55.7364164Z  finished in 5.825
2019-10-09T13:38:55.7575425Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:38:55.9197796Z 
2019-10-09T13:38:55.9198820Z running 150 tests
2019-10-09T13:38:59.7075361Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/150
2019-10-09T13:39:01.8282838Z ..iiii..............i.........iii.i.......ii......
2019-10-09T13:39:01.8283408Z 
2019-10-09T13:39:01.8287285Z  finished in 6.071
2019-10-09T13:39:01.8535856Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:39:02.0254037Z 
---
2019-10-09T13:39:04.4059826Z  finished in 2.554
2019-10-09T13:39:04.4267783Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:39:04.5913153Z 
2019-10-09T13:39:04.5913676Z running 9 tests
2019-10-09T13:39:04.5916660Z iiiiiiiii
2019-10-09T13:39:04.5917996Z 
2019-10-09T13:39:04.5918252Z  finished in 0.164
2019-10-09T13:39:04.6118753Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:39:04.7778733Z 
---
2019-10-09T13:39:24.1078411Z  finished in 19.496
2019-10-09T13:39:24.1384283Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:39:24.3427058Z 
2019-10-09T13:39:24.3428965Z running 123 tests
2019-10-09T13:39:50.1388703Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-10-09T13:39:55.2484892Z i.i.i......iii.i.....ii
2019-10-09T13:39:55.2485858Z 
2019-10-09T13:39:55.2485911Z  finished in 31.110
2019-10-09T13:39:55.2499419Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T13:39:55.2499814Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-10-09T13:53:45.4189710Z 
2019-10-09T13:53:45.4194932Z    Doc-tests core
2019-10-09T13:53:50.3256939Z 
2019-10-09T13:53:50.3264470Z running 2405 tests
2019-10-09T13:54:02.6510436Z ......iiiii......................................................................................... 100/2405
2019-10-09T13:54:14.5535184Z ...............................................................................ii................... 200/2405
2019-10-09T13:54:42.6291094Z .i.................................................................................................. 400/2405
2019-10-09T13:54:42.6291094Z .i.................................................................................................. 400/2405
2019-10-09T13:54:54.4031151Z ................................................i..i.................iiii........................... 500/2405
2019-10-09T13:55:16.2143695Z .................................................................................................... 700/2405
2019-10-09T13:55:28.1811145Z .................................................................................................... 800/2405
2019-10-09T13:55:38.0721266Z .................................................................................................... 900/2405
2019-10-09T13:55:49.4540407Z .................................................................................................... 1000/2405
---
2019-10-09T14:00:26.4802452Z 
2019-10-09T14:00:26.4803633Z running 994 tests
2019-10-09T14:00:50.0627035Z i................................................................................................... 100/994
2019-10-09T14:01:02.3641805Z .................................................................................................... 200/994
2019-10-09T14:01:11.5164235Z ...................iii......i......i...i......i..................................................... 300/994
2019-10-09T14:01:17.8789522Z .................................................................................................... 400/994
2019-10-09T14:01:26.5582237Z .....................................i..i.................................ii........................ 500/994
2019-10-09T14:01:43.6990202Z .................................................................................................... 700/994
2019-10-09T14:01:43.6990202Z .................................................................................................... 700/994
2019-10-09T14:01:52.5475318Z ....................iiii............................................................................ 800/994
2019-10-09T14:02:08.4538047Z .................................................................................................... 900/994
2019-10-09T14:02:17.0408785Z ..........................................iiii................................................
2019-10-09T14:02:17.0408975Z 
2019-10-09T14:02:17.0531708Z  finished in 212.758
2019-10-09T14:02:17.0549918Z Testing term stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-09T14:02:17.2907233Z    Compiling term v0.0.0 (/checkout/src/libterm)
---
2019-10-09T14:19:46.1758829Z 
2019-10-09T14:19:46.1758876Z failures:
2019-10-09T14:19:46.1758904Z 
2019-10-09T14:19:46.1759219Z ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0573 (line 10265) stdout ----
2019-10-09T14:19:46.1759279Z error[E0573]: expected type, found constant `HOBBIT`
2019-10-09T14:19:46.1759530Z  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:10269:6
2019-10-09T14:19:46.1759593Z   |
2019-10-09T14:19:46.1759645Z 6 | impl HOBBIT {} // ok!
2019-10-09T14:19:46.1759721Z 
2019-10-09T14:19:46.1759782Z error: aborting due to previous error
2019-10-09T14:19:46.1759820Z 
2019-10-09T14:19:46.1760061Z For more information about this error, try `rustc --explain E0573`.
---
2019-10-09T14:19:46.1761381Z == clock drift check ==
2019-10-09T14:19:46.1761427Z   local time: Wed Oct  9 14:19:46 UTC 2019
2019-10-09T14:19:46.1865098Z   network time: Wed, 09 Oct 2019 14:19:46 GMT
2019-10-09T14:19:46.1867042Z == end clock drift check ==
2019-10-09T14:19:47.2061383Z ##[error]Bash exited with code '1'.
2019-10-09T14:19:47.2104608Z ##[section]Starting: Checkout
2019-10-09T14:19:47.2106571Z ==============================================================================
2019-10-09T14:19:47.2106630Z Task         : Get sources
2019-10-09T14:19:47.2106696Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Oct 16, 2019

☔ The latest upstream changes (presumably #65454) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez
Copy link
Member Author

r? @kinnison

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

Mostly good, just a couple of language tweaks I think might be worth it.

@@ -1611,6 +1611,80 @@ fn print_on_failure(state: &State) {
```
"##,

E0573: r##"
Something else than a type has been used when one was expected.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest 'other' rather than 'else' here.

Something other than a type has been used when one was expected.

```

In all these errors, a type was expected. For example, in the first error,
if we want to return `Born` variant from the `Dragon` enum, we have set the
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest:

if we want to return the Born variant from the Dragon enum, we must make the
function return the Dragon enum and not its variant:

@GuillaumeGomez
Copy link
Member Author

Updated!

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

One more tweak

Comment on lines 1641 to 1643
In all these errors, a type was expected. For example, in the first error, if
we want to return the `Born` variant from the `Dragon` enum, we have set the
function returning the enum and not its variant:
Copy link
Contributor

Choose a reason for hiding this comment

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

This still doesn't quite read nicely.

If you replace 'we have set the function returning' with 'we must set the function to return' then it would read better.

@GuillaumeGomez
Copy link
Member Author

Updated.

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

👍

@GuillaumeGomez
Copy link
Member Author

@bors: r=kinnison

@bors
Copy link
Contributor

bors commented Oct 16, 2019

📌 Commit 7d357fb has been approved by kinnison

@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 Oct 16, 2019
@bors
Copy link
Contributor

bors commented Oct 17, 2019

⌛ Testing commit 7d357fb with merge 7e49800...

bors added a commit that referenced this pull request Oct 17, 2019
…innison

Add long error explanation for E0573

Part of #61137.
@bors
Copy link
Contributor

bors commented Oct 17, 2019

☀️ Test successful - checks-azure
Approved by: kinnison
Pushing 7e49800 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 17, 2019
@bors bors merged commit 7d357fb into rust-lang:master Oct 17, 2019
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #65234!

Tested on commit 7e49800.
Direct link to PR: #65234

💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Oct 17, 2019
Tested on commit rust-lang/rust@7e49800.
Direct link to PR: <rust-lang/rust#65234>

💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).
@GuillaumeGomez GuillaumeGomez deleted the long-err-explanation-E0573 branch October 17, 2019 08:38
}

trait Isengard {
fn wizard(w: Wizard) { // error!
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, just a random late comment from an outsider... Should the // error! commet be removed because this is a corrected example, shouldn't it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Excellent point! We completely missed it... Do you want to send a PR to fix it?

Copy link
Contributor

Choose a reason for hiding this comment

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

@GuillaumeGomez Hi, I just created one! #65620

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 21, 2019
…arkor

Correctly note code as Ok not error for E0573

Hi, this is my first pull request to the Rust project.

The fix is very small one just to fix an oversight in a comment.

Namely, [this documentation PR](rust-lang#65234) added a longer explanation for E0573. It illustrated the error using erroneous/corrected contrasting examples. But it accidentally forgot to remove `// error` from the corrected example.

Sadly, I found the error after the PR got merged. [As suggested by the original author](https://github.com/rust-lang/rust/pull/65234/files#r336518549) of the PR, I created an PR to fix this.

Part of rust-lang#61137.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

6 participants