Skip to content

Commit

Permalink
Work around prelude redundant import warnings
Browse files Browse the repository at this point in the history
rust-lang/rust#117772

    warning: the item `Box` is imported redundantly
       --> src/any.rs:1:5
        |
    1   | use alloc::boxed::Box;
        |     ^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Box` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default

    warning: the item `Box` is imported redundantly
       --> src/de.rs:5:5
        |
    5   | use alloc::boxed::Box;
        |     ^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Box` is already defined here

    warning: the item `String` is imported redundantly
       --> src/de.rs:7:5
        |
    7   | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/de.rs:9:5
        |
    9   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `ToOwned` is imported redundantly
       --> src/error.rs:1:5
        |
    1   | use alloc::borrow::ToOwned;
        |     ^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToOwned` is already defined here

    warning: the item `Box` is imported redundantly
       --> src/error.rs:2:5
        |
    2   | use alloc::boxed::Box;
        |     ^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Box` is already defined here

    warning: the item `String` is imported redundantly
       --> src/error.rs:3:21
        |
    3   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/error.rs:3:29
        |
    3   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/error.rs:4:5
        |
    4   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `Box` is imported redundantly
       --> src/ser.rs:4:5
        |
    4   | use alloc::boxed::Box;
        |     ^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Box` is already defined here

    warning: the item `String` is imported redundantly
       --> src/ser.rs:5:21
        |
    5   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/ser.rs:5:29
        |
    5   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here
  • Loading branch information
dtolnay committed Feb 19, 2024
1 parent f8078da commit 3a77db0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
//! ```

#![doc(html_root_url = "https://docs.rs/erased-serde/0.4.2")]
#![cfg_attr(not(feature = "std"), no_std)]
#![no_std]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(
clippy::box_collection,
Expand All @@ -117,6 +117,9 @@

extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

#[macro_use]
mod macros;

Expand Down

0 comments on commit 3a77db0

Please sign in to comment.