Skip to content
/ serde Public
forked from serde-rs/serde

Commit

Permalink
Resolve ambiguous core import on rustc 1.64 through 1.71
Browse files Browse the repository at this point in the history
In 1.72+, this is fixed by rust-lang/rust#112086.

    error[E0659]: `core` is ambiguous
       --> serde/src/lib.rs:227:13
        |
    227 |     pub use core::ffi::CStr;
        |             ^^^^ ambiguous name
        |
        = note: ambiguous because of multiple potential import sources
        = note: `core` could refer to a built-in crate
        = help: use `::core` to refer to this crate unambiguously
    note: `core` could also refer to the module defined here
       --> serde/src/lib.rs:166:5
        |
    166 | /     mod core {
    167 | |         #[cfg(not(feature = "std"))]
    168 | |         pub use core::*;
    169 | |         #[cfg(feature = "std")]
    170 | |         pub use std::*;
    171 | |     }
        | |_____^
        = help: use `self::core` to refer to this module unambiguously
  • Loading branch information
dtolnay committed Jul 31, 2023
1 parent 830528d commit 0d7349f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ mod lib {
pub use std::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque};

#[cfg(all(not(no_core_cstr), not(feature = "std")))]
pub use core::ffi::CStr;
pub use self::core::ffi::CStr;
#[cfg(feature = "std")]
pub use std::ffi::CStr;

Expand Down

0 comments on commit 0d7349f

Please sign in to comment.