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

Turn on unused-extern-crates warning. #10706

Merged
merged 3 commits into from
Apr 22, 2016
Merged

Turn on unused-extern-crates warning. #10706

merged 3 commits into from
Apr 22, 2016

Conversation

zbynekwinkler
Copy link
Contributor

As discussed in #9256. It should solve second half of the issue.


This change is Reviewable

@highfive
Copy link

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

@highfive
Copy link

Heads up! This PR modifies the following files:

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 19, 2016
@nox
Copy link
Contributor

nox commented Apr 19, 2016

We might want to wait?

rust-lang/rust#30849

@metajack
Copy link
Contributor

@bors-servo try

Code looks fine, but let's run it through CI to see how many false positives we get.


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

⌛ Trying commit 537bb36 with merge 8095290...

bors-servo pushed a commit that referenced this pull request Apr 19, 2016
Turn on unused-extern-crates warning.

As discussed in #9256. It should solve second half of the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10706)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 19, 2016
@jdm
Copy link
Member

jdm commented Apr 19, 2016

   Compiling util v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/util)
/home/servo/buildbot/slave/linux-rel/build/components/util/lib.rs:22:1: 22:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/util/lib.rs:22 extern crate bitflags;
                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/util/lib.rs:31:1: 31:26 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/util/lib.rs:31 extern crate lazy_static;
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
   Compiling style_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/style_traits)
   Compiling profile v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/profile)
/home/servo/buildbot/slave/linux-rel/build/components/profile/lib.rs:14:1: 14:29 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/profile/lib.rs:14 extern crate alloc_jemalloc;
                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Compiling webrender v0.1.0 (https://github.com/servo/webrender#46dd3f0f)
   Compiling msg v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/msg)
/home/servo/buildbot/slave/linux-rel/build/components/msg/lib.rs:11:1: 11:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/msg/lib.rs:11 extern crate bitflags;
                                                                    ^~~~~~~~~~~~~~~~~~~~~~
   Compiling gfx_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/gfx_traits)
   Compiling devtools_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/devtools_traits)
/home/servo/buildbot/slave/linux-rel/build/components/gfx_traits/lib.rs:19:1: 19:19 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/gfx_traits/lib.rs:19 extern crate util;
                                                                           ^~~~~~~~~~~~~~~~~~
   Compiling canvas_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/canvas_traits)
/home/servo/buildbot/slave/linux-rel/build/components/canvas_traits/lib.rs:20:1: 20:35 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/canvas_traits/lib.rs:20 extern crate offscreen_gl_context;
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/canvas_traits/lib.rs:22:1: 22:19 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/canvas_traits/lib.rs:22 extern crate util;
                                                                              ^~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/devtools_traits/lib.rs:19:1: 19:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/devtools_traits/lib.rs:19 extern crate bitflags;
                                                                                ^~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/devtools_traits/lib.rs:27:1: 27:19 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/devtools_traits/lib.rs:27 extern crate util;
                                                                                ^~~~~~~~~~~~~~~~~~
   Compiling devtools v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/devtools)
   Compiling canvas v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/canvas)
/home/servo/buildbot/slave/linux-rel/build/components/canvas/lib.rs:17:1: 17:21 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/canvas/lib.rs:17 extern crate layers;
                                                                       ^~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/devtools/lib.rs:27:1: 27:18 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/devtools/lib.rs:27 extern crate log;
                                                                         ^~~~~~~~~~~~~~~~~
   Compiling net_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/net_traits)
/home/servo/buildbot/slave/linux-rel/build/components/net_traits/lib.rs:21:1: 21:26 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/net_traits/lib.rs:21 extern crate lazy_static;
                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:23:1: 23:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:23 extern crate bitflags;
                                                                      ^~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:32:1: 32:26 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:32 extern crate lazy_static;
                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:36:1: 36:22 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/style/lib.rs:36 extern crate matches;
                                                                      ^~~~~~~~~~~~~~~~~~~~~
   Compiling net v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/net)
   Compiling script_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/script_traits)
   Compiling gfx v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/gfx)
/home/servo/buildbot/slave/linux-rel/build/components/gfx/lib.rs:27:1: 27:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/gfx/lib.rs:27 extern crate bitflags;
                                                                    ^~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/gfx/lib.rs:53:1: 53:26 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/gfx/lib.rs:53 extern crate lazy_static;
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
   Compiling layout_traits v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/layout_traits)
/home/servo/buildbot/slave/linux-rel/build/components/script/lib.rs:34:1: 34:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/script/lib.rs:34 extern crate bitflags;
                                                                       ^~~~~~~~~~~~~~~~~~~~~~
   Compiling compositing v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/compositing)
/home/servo/buildbot/slave/linux-rel/build/components/script/dom/htmliframeelement.rs:16:48: 16:56 warning: unused import, #[warn(unused_imports)] on by default
/home/servo/buildbot/slave/linux-rel/build/components/script/dom/htmliframeelement.rs:16 use dom::bindings::error::{Error, ErrorResult, Fallible};
                                                                                                                                        ^~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/script/dom/htmllinkelement.rs:11:5: 11:67 warning: unused import, #[warn(unused_imports)] on by default
/home/servo/buildbot/slave/linux-rel/build/components/script/dom/htmllinkelement.rs:11 use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Compiling webdriver_server v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/webdriver_server)
   Compiling glutin_app v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/ports/glutin)
/home/servo/buildbot/slave/linux-rel/build/components/webdriver_server/lib.rs:18:1: 18:18 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/webdriver_server/lib.rs:18 extern crate log;
                                                                                 ^~~~~~~~~~~~~~~~~
   Compiling layout v0.0.1 (file:///home/servo/buildbot/slave/linux-rel/build/components/layout)
/home/servo/buildbot/slave/linux-rel/build/components/layout/lib.rs:25:1: 25:23 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/layout/lib.rs:25 extern crate bitflags;
                                                                       ^~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-rel/build/components/layout/lib.rs:52:1: 52:20 warning: unused extern crate [-W unused-extern-crates]
/home/servo/buildbot/slave/linux-rel/build/components/layout/lib.rs:52 extern crate serde;
                                                                       ^~~~~~~~~~~~~~~~~~~
main.rs:24:1: 24:20 warning: unused extern crate [-W unused-extern-crates]
main.rs:24 extern crate gleam;
           ^~~~~~~~~~~~~~~~~~~
main.rs:30:1: 30:18 warning: unused extern crate [-W unused-extern-crates]
main.rs:30 extern crate log;
           ^~~~~~~~~~~~~~~~~
main.rs:31:1: 31:35 warning: unused extern crate [-W unused-extern-crates]
main.rs:31 extern crate offscreen_gl_context;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Apr 20, 2016
@zbynekwinkler
Copy link
Contributor Author

I have added guards to the false positives. What is left should be the actual thing.

@zbynekwinkler
Copy link
Contributor Author

The last commit takes care of the unused crates. I think am all done here (unless you have some suggestions).

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 20, 2016

alloc_jemalloc is a false positive too.

@zbynekwinkler
Copy link
Contributor Author

I'll fold it into the false positives commit then.

@zbynekwinkler
Copy link
Contributor Author

@Ms2ger Done.

@nox nox added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 21, 2016
@nox
Copy link
Contributor

nox commented Apr 21, 2016

Please squash the commits together, a bisection ending up in the middle of your PR would have failing tests.

-S-awaiting-review +S-needs-squash


Reviewed 1 of 1 files at r1, 5 of 8 files at r2, 1 of 1 files at r3, 18 of 19 files at r4, 1 of 1 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 21, 2016

Rather than squashing, I'd suggest reordering the commits so that the "Turn on unused-extern-crates warning." comes after the two other commits.

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 21, 2016
@zbynekwinkler
Copy link
Contributor Author

Reorder done.

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 21, 2016

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 99e6ada has been approved by Ms2ger

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Apr 21, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 99e6ada with merge 4d23c8e...

bors-servo pushed a commit that referenced this pull request Apr 22, 2016
Turn on unused-extern-crates warning.

As discussed in #9256. It should solve second half of the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10706)
<!-- Reviewable:end -->
@zbynekwinkler
Copy link
Contributor Author

I have folded the update of the lock files into the commit modifying the toml files (hope that is ok).

@nox
Copy link
Contributor

nox commented Apr 22, 2016

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 2207830 has been approved by nox

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 22, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 2207830 with merge 2bd38b5...

bors-servo pushed a commit that referenced this pull request Apr 22, 2016
Turn on unused-extern-crates warning.

As discussed in #9256. It should solve second half of the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10706)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - android

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 22, 2016
@zbynekwinkler
Copy link
Contributor Author

Can anyone help with the android stuff? I don't have the environment set up and I know close to nothing about android. I guess some of the extern crates should have been guarded by cfg(android).

@jdm
Copy link
Member

jdm commented Apr 22, 2016

Yes, that would be the correct way to sort it out. Specifically, the use of the log crate in main.rs with target_os = "android".

Added #[allow(unused_extern_crates)] to silence false positives

 * bitflags, lazy_static and matches because macro_use
 * alloc_jemalloc because builtin crate

See rust-lang/rust#30849
The cleanup is based on info from using "-W unused-extern-crates".
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 22, 2016
@zbynekwinkler
Copy link
Contributor Author

Reworked to consider also android build.

@jdm
Copy link
Member

jdm commented Apr 22, 2016

@bors-servo: r=nox

@bors-servo
Copy link
Contributor

📌 Commit 4bdc895 has been approved by nox

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 22, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 4bdc895 with merge 0a3a50a...

bors-servo pushed a commit that referenced this pull request Apr 22, 2016
Turn on unused-extern-crates warning.

As discussed in #9256. It should solve second half of the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10706)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo bors-servo merged commit 4bdc895 into servo:master Apr 22, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 22, 2016
@zbynekwinkler zbynekwinkler deleted the unused-extern-crates branch April 22, 2016 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants