rustc-ap-rustc_session 634.0.0

Automatically published version of the package `rustc_session` in the rust-lang/rust repository from commit 625375400cdd172877e81c3ce44ce68f2011af2d The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish
Documentation
// Hack up our own formatting for the duration to make it easier for scripts
// to parse (always use the same number of decimal places and the same unit).
pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
    const NANOS_PER_SEC: f64 = 1_000_000_000.0;
    let secs = dur.as_secs() as f64 + dur.subsec_nanos() as f64 / NANOS_PER_SEC;

    format!("{:.3}", secs)
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
pub enum NativeLibraryKind {
    /// native static library (.a archive)
    NativeStatic,
    /// native static library, which doesn't get bundled into .rlibs
    NativeStaticNobundle,
    /// macOS-specific
    NativeFramework,
    /// Windows dynamic library without import library.
    NativeRawDylib,
    /// default way to specify a dynamic library
    NativeUnknown,
}

rustc_data_structures::impl_stable_hash_via_hash!(NativeLibraryKind);