Skip to content

Don't emit "unused extern crate" warnings for extern crate foo as _;#53479

Merged
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:underscore-means-unused
Aug 30, 2018
Merged

Don't emit "unused extern crate" warnings for extern crate foo as _;#53479
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:underscore-means-unused

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @varkor

(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 Aug 18, 2018
@joshtriplett

Copy link
Copy Markdown
Member Author

r? @eddyb

@eddyb

eddyb commented Aug 18, 2018

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 18, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit e2651be has been approved by eddyb

@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 Aug 18, 2018
use m::Tr1 as _; //~ WARN unused import
use S as _; //~ WARN unused import
extern crate core as _; //~ WARN unused extern crate
extern crate core as _; // OK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we add a test triggering the warning?

@bors

bors commented Aug 22, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e2651be with merge 274ef46...

bors added a commit that referenced this pull request Aug 22, 2018
Don't emit "unused extern crate" warnings for `extern crate foo as _;`

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).
@bors

bors commented Aug 22, 2018

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@rust-highfive

Copy link
Copy Markdown
Contributor

The job x86_64-gnu-aux 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.
[01:41:43] 
[01:41:43] testing https://github.com/BurntSushi/xsv
[01:41:43] Initialized empty Git repository in /checkout/obj/build/ct/xsv/.git/
[01:41:43] fatal: Could not parse object '66956b6bfd62d6ac767a6b6499c982eae20a2c9f'.
[01:42:03] fatal: unable to access 'https://github.com/BurntSushi/xsv/': Could not resolve host: github.com
[01:42:03] thread 'main' panicked at 'assertion failed: status.success()', tools/cargotest/main.rs:128:13
[01:42:03] 
[01:42:03] 
[01:42:03] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/cargotest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/ct"
[01:42:03] expected success, got: exit code: 101
[01:42:03] expected success, got: exit code: 101
[01:42:03] 
[01:42:03] 
[01:42:03] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/test/pretty src/test/run-pass/pretty src/test/run-fail/pretty src/test/run-pass-valgrind/pretty src/test/run-pass-fulldeps/pretty src/test/run-fail-fulldeps/pretty src/tools/cargo src/tools/cargotest
[01:42:03] Build completed unsuccessfully in 0:42:47
[01:42:03] make: *** [check-aux] Error 1
[01:42:03] Makefile:60: recipe for target 'check-aux' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:088e71e2
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0c85e520:start=1534920666242412003,finish=1534920666250721263,duration=8309260
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04adebda
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:078cca15
travis_time:start:078cca15
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:39f10cbe
$ dmesg | grep -i kill

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 bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2018
@estebank

Copy link
Copy Markdown
Contributor

@bors retry

timeout fetching from github

@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 Aug 22, 2018
@bors

bors commented Aug 22, 2018

Copy link
Copy Markdown
Collaborator

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2018
@TimNN

TimNN commented Aug 28, 2018

Copy link
Copy Markdown
Contributor

Ping from triage, @joshtriplett: This PR needs to be rebased.

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).
@joshtriplett joshtriplett force-pushed the underscore-means-unused branch from e2651be to 7cec516 Compare August 29, 2018 15:55
@joshtriplett

Copy link
Copy Markdown
Member Author

@bors retry

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 29, 2018
@estebank

Copy link
Copy Markdown
Contributor

@bors r+
I believe @joshtriplett after rebase the PR needs to be approved again as the commit hash changes.

@bors

This comment has been minimized.

@estebank

Copy link
Copy Markdown
Contributor

@bors r=eddyb

@bors

bors commented Aug 29, 2018

Copy link
Copy Markdown
Collaborator

💡 This pull request was already approved, no need to approve it again.

@bors

bors commented Aug 29, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 7cec516 has been approved by eddyb

@bors

bors commented Aug 29, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 7cec516 with merge 769769af3430b6d6947bcf09e92a3e00366c8eb1...

@bors

This comment has been minimized.

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 29, 2018
@rust-highfive

This comment has been minimized.

@joshtriplett

Copy link
Copy Markdown
Member Author

@bors retry

@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 Aug 29, 2018
@bors

bors commented Aug 30, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 7cec516 with merge 6244625...

bors added a commit that referenced this pull request Aug 30, 2018
Don't emit "unused extern crate" warnings for `extern crate foo as _;`

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).
@bors

bors commented Aug 30, 2018

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 6244625 to master...

@bors bors merged commit 7cec516 into rust-lang:master Aug 30, 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.

7 participants