]> git.proxmox.com Git - rustc.git/blame - src/librustc_middle/middle/dependency_format.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_middle / middle / dependency_format.rs
CommitLineData
e74abb32
XL
1//! Type definitions for learning about the dependency formats of all upstream
2//! crates (rlibs/dylibs/oh my).
1a4d82fc 3//!
e74abb32
XL
4//! For all the gory details, see the provider of the `dependency_formats`
5//! query.
1a4d82fc 6
f9f354fc 7use rustc_session::config::CrateType;
1a4d82fc
JJ
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).
e9174d1e 15pub type DependencyList = Vec<Linkage>;
1a4d82fc
JJ
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.
f9f354fc 20pub type Dependencies = Vec<(CrateType, DependencyList)>;
1a4d82fc 21
3dfed10e 22#[derive(Copy, Clone, PartialEq, Debug, HashStable, Encodable, Decodable)]
e9174d1e
SL
23pub enum Linkage {
24 NotLinked,
25 IncludedFromDylib,
26 Static,
27 Dynamic,
28}