Closed Bug 1889260 Opened 6 months ago Closed 6 months ago

[rustc 1.78] error: the item `Iterator` is imported redundantly

Categories

(Testing :: geckodriver, defect)

defect

Tracking

(firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(5 files)

When building geckodriver with rustc 1.78 beta 4, the following errors are shown (when enabling warnings as errors, see bug 1889251):

error: the item `Iterator` is imported redundantly
   --> testing/mozbase/rust/mozprofile/src/prefreader.rs:11:5
    |
11  | use std::iter::Iterator;
    |     ^^^^^^^^^^^^^^^^^^^
    |
   ::: /builds/worker/fetches/rustc/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:148:13
    |
148 |     pub use core::prelude::rust_2021::*;
    |             ------------------------ the item `Iterator` is already defined here
    |
    = note: `-D unused-imports` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_imports)]`
error: could not compile `mozprofile` (lib) due to 1 previous error

Then

error: the item `TryFrom` is imported redundantly
   --> testing/mozbase/rust/mozdevice/src/lib.rs:15:5
    |
15  | use std::convert::TryFrom;
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /builds/worker/fetches/rustc/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:148:13
    |
148 |     pub use core::prelude::rust_2021::*;
    |             ------------------------ the item `TryFrom` is already defined here
    |
    = note: `-D unused-imports` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_imports)]`
error: the item `FromIterator` is imported redundantly
   --> testing/mozbase/rust/mozdevice/src/lib.rs:18:5
    |
18  | use std::iter::FromIterator;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /builds/worker/fetches/rustc/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:148:13
    |
148 |     pub use core::prelude::rust_2021::*;
    |             ------------------------ the item `FromIterator` is already defined here
error: could not compile `mozdevice` (lib) due to 2 previous errors

Then

error: the item `serde_json` is imported redundantly
  --> testing/webdriver/src/command.rs:17:18
   |
17 | use serde_json::{self, Value};
   |                  ^^^^
   |
  ::: testing/webdriver/src/lib.rs:16:1
   |
16 | extern crate serde_json;
   | ------------------------ the item `serde_json` is already imported here
   |
   = note: `-D unused-imports` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_imports)]`
error: the item `From` is imported redundantly
   --> testing/webdriver/src/error.rs:10:5
    |
10  | use std::convert::From;
    |     ^^^^^^^^^^^^^^^^^^
    |
   ::: /builds/worker/fetches/rustc/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:148:13
    |
148 |     pub use core::prelude::rust_2021::*;
    |             ------------------------ the item `From` is already defined here
error: the item `http` is imported redundantly
  --> testing/webdriver/src/server.rs:13:12
   |
13 | use http::{self, Method, StatusCode};
   |            ^^^^
   |
  ::: testing/webdriver/src/lib.rs:12:1
   |
12 | extern crate http;
   | ------------------ the item `http` is already imported here
error: the item `warp` is imported redundantly
  --> testing/webdriver/src/server.rs:22:12
   |
22 | use warp::{self, Buf, Filter, Rejection};
   |            ^^^^
   |
  ::: testing/webdriver/src/lib.rs:22:1
   |
22 | extern crate warp;
   | ------------------ the item `warp` is already imported here
error: could not compile `webdriver` (lib) due to 4 previous errors

And finally:

error: the item `mozversion` is imported redundantly
  --> testing/geckodriver/src/capabilities.rs:15:18
   |
15 | use mozversion::{self, firefox_binary_version, firefox_version, Version};
   |                  ^^^^
   |
  ::: testing/geckodriver/src/main.rs:13:1
   |
13 | extern crate mozversion;
   | ------------------------ the item `mozversion` is already imported here
   |
   = note: `-D unused-imports` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_imports)]`
error: the item `serde_json` is imported redundantly
  --> testing/geckodriver/src/command.rs:10:18
   |
10 | use serde_json::{self, Value};
   |                  ^^^^
   |
  ::: testing/geckodriver/src/main.rs:18:1
   |
18 | extern crate serde_json;
   | ------------------------ the item `serde_json` is already imported here
error: the item `serde_json` is imported redundantly
  --> testing/geckodriver/src/marionette.rs:34:18
   |
34 | use serde_json::{self, Map, Value};
   |                  ^^^^
   |
  ::: testing/geckodriver/src/main.rs:18:1
   |
18 | extern crate serde_json;
   | ------------------------ the item `serde_json` is already imported here
error: could not compile `geckodriver` (bin "geckodriver") due to 3 previous errors

And another one on mac only:

error: the item `dirs` is imported redundantly
   --> testing/mozbase/rust/mozrunner/src/runner.rs:384:9
    |
384 |     use dirs;
    |         ^^^^
    |
   ::: testing/mozbase/rust/mozrunner/src/lib.rs:9:1
    |
9   | extern crate dirs;
    | ------------------ the item `dirs` is already imported here
    |
    = note: `-D unused-imports` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unused_imports)]`
error: could not compile `mozrunner` (lib) due to 1 previous error
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/ebcebd090a77 Remove redundant import from mozprofile. r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/3677d60818e2 Remove redundant imports from mozdevice. r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/3aa7970b16dc Remove redundant imports from webdriver. r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/04489215a7b8 Remove redundant imports from geckodriver. r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/2869acb7d449 Remove redundant import from mozrunner. r=webdriver-reviewers,whimboo
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: