1 //! Type definitions for learning about the dependency formats of all upstream 2 //! crates (rlibs/dylibs/oh my). 3 //! 4 //! For all the gory details, see the provider of the `dependency_formats` 5 //! query. 6 7 use rustc_session::config::CrateType; 8 9 /// A list of dependencies for a certain crate type. 10 /// 11 /// The length of this vector is the same as the number of external crates used. 12 /// The value is None if the crate does not need to be linked (it was found 13 /// statically in another dylib), or Some(kind) if it needs to be linked as 14 /// `kind` (either static or dynamic). 15 pub type DependencyList = Vec<Linkage>; 16 17 /// A mapping of all required dependencies for a particular flavor of output. 18 /// 19 /// This is local to the tcx, and is generally relevant to one session. 20 pub type Dependencies = Vec<(CrateType, DependencyList)>; 21 22 #[derive(Copy, Clone, PartialEq, Debug, HashStable, Encodable, Decodable)] 23 pub enum Linkage { 24 NotLinked, 25 IncludedFromDylib, 26 Static, 27 Dynamic, 28 } 29