]> git.lizzy.rs Git - rust.git/blob - src/librustc_session/utils.rs
Rollup merge of #67233 - Luro02:cursor_traits, r=sfackler
[rust.git] / src / librustc_session / utils.rs
1 // Hack up our own formatting for the duration to make it easier for scripts
2 // to parse (always use the same number of decimal places and the same unit).
3 pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
4     const NANOS_PER_SEC: f64 = 1_000_000_000.0;
5     let secs = dur.as_secs() as f64 + dur.subsec_nanos() as f64 / NANOS_PER_SEC;
6
7     format!("{:.3}", secs)
8 }
9
10 #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
11 pub enum NativeLibraryKind {
12     /// native static library (.a archive)
13     NativeStatic,
14     /// native static library, which doesn't get bundled into .rlibs
15     NativeStaticNobundle,
16     /// macOS-specific
17     NativeFramework,
18     /// Windows dynamic library without import library.
19     NativeRawDylib,
20     /// default way to specify a dynamic library
21     NativeUnknown,
22 }
23
24 rustc_data_structures::impl_stable_hash_via_hash!(NativeLibraryKind);