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 test for deriving Debug on uninhabited enum #55567

Merged
merged 1 commit into from
Nov 3, 2018

Conversation

durka
Copy link
Contributor

@durka durka commented Nov 1, 2018

Adds a test to close #38885.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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 Nov 1, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
travis_time:end:1cff5dee:start=1541042911170445266,finish=1541042966331713766,duration=55161268500
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:48:31] .................................................................................................... 500/4984
[00:48:34] ........................i........................................................................... 600/4984
[00:48:39] .................................................................................................... 700/4984
[00:48:45] ..................................................................i...........i..................... 800/4984
[00:48:48] ...F.................................................................................iiiii.......... 900/4984
[00:48:54] .................................................................................................... 1100/4984
[00:48:56] .................................................................................................... 1200/4984
[00:48:59] .................................................................................................... 1300/4984
[00:49:01] .................................................................................................... 1400/4984
---
[00:50:49] .......................................................i............................................ 4600/4984
[00:50:52] .................................................................................................... 4700/4984
00] +   --> $DIR/derive-uninhabited-enum-38885.rs:21:1
[00:51:00] 11    |
[00:51:00] 12 LL | enum Foo { //~ WARN never used
[00:51:00] 
[00:51:00] 
[00:51:00] The actual stderr differed from the expected stderr.
[00:51:00] The actual stderr differed from the expected stderr.
[00:51:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/derive-uninhabited-enum-38885/derive-uninhabited-enum-38885.stderr
[00:51:00] To update references, rerun the tests and pass the `--bless` flag
[00:51:00] To only update this specific test, also pass `--test-args derive-uninhabited-enum-38885.rs`
[00:51:00] error: 1 errors occurred comparing output.
[00:51:00] status: exit code: 0
[00:51:00] status: exit code: 0
[00:51:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/derive-uninhabited-enum-38885.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/derive-uninhabited-enum-38885/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Wunused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/derive-uninhabited-enum-38885/auxiliary" "-A" "unused"
[00:51:00] ------------------------------------------
[00:51:00] 
[00:51:00] ------------------------------------------
[00:51:00] stderr:
[00:51:00] stderr:
[00:51:00] ------------------------------------------
[00:51:00] {"message":"enum is never used: `Void`","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/derive-uninhabit4743480 .
2476256 ./obj/build
1847548 ./obj/build/x86_64-unknown-linux-gnu
1194432 ./.git
1072228 ./src

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)

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Nov 1, 2018

@durka looks like you need to run --bless

@durka
Copy link
Contributor Author

durka commented Nov 2, 2018

Should be fixed.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 2, 2018

📌 Commit 2279f62 has been approved by nikomatsakis

@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 Nov 2, 2018
// when deriving Debug on an empty enum

#[derive(Debug)]
enum Void {} //~ WARN never used
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually I just do #[allow(dead_code)], but it's fine this way too.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 3, 2018
…ikomatsakis

add test for deriving Debug on uninhabited enum

Adds a test to close rust-lang#38885.
bors added a commit that referenced this pull request Nov 3, 2018
Rollup of 5 pull requests

Successful merges:

 - #54162 (Hide default impls items)
 - #55555 (Make `-Z ls` list the actual filename of external dependencies)
 - #55567 (add test for deriving Debug on uninhabited enum)
 - #55568 (test that rustdoc doesn't overflow on a big enum)
 - #55598 (publish-toolstate: ping maintainers when a tool builds again)

Failed merges:

r? @ghost
@bors bors merged commit 2279f62 into rust-lang:master Nov 3, 2018
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.

Deriving Debug on an enum with uninhabited type triggers warning
4 participants