pub struct RustcTargetData<'gctx> {
pub rustc: Rustc,
pub gctx: &'gctx GlobalContext,
requested_kinds: Vec<CompileKind>,
host_config: TargetConfig,
host_info: TargetInfo,
target_config: HashMap<CompileTarget, TargetConfig>,
target_info: HashMap<CompileTarget, TargetInfo>,
}
Expand description
Collection of information about rustc
and the host and target.
Fields§
§rustc: Rustc
Information about rustc
itself.
gctx: &'gctx GlobalContext
Config
requested_kinds: Vec<CompileKind>
§host_config: TargetConfig
Build information for the “host”, which is information about when
rustc
is invoked without a --target
flag. This is used for
selecting a linker, and applying link overrides.
The configuration read into this depends on whether or not
target-applies-to-host=true
.
host_info: TargetInfo
Information about the host platform.
target_config: HashMap<CompileTarget, TargetConfig>
Build information for targets that we’re building for.
target_info: HashMap<CompileTarget, TargetInfo>
Information about the target platform that we’re building for.
Implementations§
Source§impl<'gctx> RustcTargetData<'gctx>
impl<'gctx> RustcTargetData<'gctx>
pub fn new( ws: &Workspace<'gctx>, requested_kinds: &[CompileKind], ) -> CargoResult<RustcTargetData<'gctx>>
Sourcepub fn merge_compile_kind(&mut self, kind: CompileKind) -> CargoResult<()>
pub fn merge_compile_kind(&mut self, kind: CompileKind) -> CargoResult<()>
Insert kind
into our target_info
and target_config
members if it isn’t present yet.
Sourcepub fn short_name<'a>(&'a self, kind: &'a CompileKind) -> &'a str
pub fn short_name<'a>(&'a self, kind: &'a CompileKind) -> &'a str
Returns a “short” name for the given kind, suitable for keying off configuration in Cargo or presenting to users.
Sourcepub fn dep_platform_activated(
&self,
dep: &Dependency,
kind: CompileKind,
) -> bool
pub fn dep_platform_activated( &self, dep: &Dependency, kind: CompileKind, ) -> bool
Whether a dependency should be compiled for the host or target platform,
specified by CompileKind
.
Sourcepub fn cfg(&self, kind: CompileKind) -> &[Cfg]
pub fn cfg(&self, kind: CompileKind) -> &[Cfg]
Gets the list of cfg
s printed out from the compiler for the specified kind.
Sourcepub fn info(&self, kind: CompileKind) -> &TargetInfo
pub fn info(&self, kind: CompileKind) -> &TargetInfo
Sourcepub fn get_info(&self, kind: CompileKind) -> Option<&TargetInfo>
pub fn get_info(&self, kind: CompileKind) -> Option<&TargetInfo>
Information about the given target platform, learned by querying rustc.
Returns None
if the target platform described by kind
can’t be found.
Sourcepub fn target_config(&self, kind: CompileKind) -> &TargetConfig
pub fn target_config(&self, kind: CompileKind) -> &TargetConfig
Gets the target configuration for a particular host or target.
Auto Trait Implementations§
impl<'gctx> !Freeze for RustcTargetData<'gctx>
impl<'gctx> !RefUnwindSafe for RustcTargetData<'gctx>
impl<'gctx> !Send for RustcTargetData<'gctx>
impl<'gctx> !Sync for RustcTargetData<'gctx>
impl<'gctx> Unpin for RustcTargetData<'gctx>
impl<'gctx> !UnwindSafe for RustcTargetData<'gctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1112 bytes