Skip to main content

Analysis

Struct Analysis 

Source
pub struct Analysis {
Show 13 fields pub source: Source, pub tokens: Vec<Token>, pub unit: TranslationUnit, pub diagnostics: Diagnostics, pub expansions: Expansions, pub user_headers: Vec<PathBuf>, pub embedded_files: Vec<PathBuf>, pub link_libraries: Vec<String>, pub safe_functions: Vec<SafeName>, pub export: bool, pub no_std: bool, pub crate_path: Option<String>, pub options: Options,
}
Expand description

The result of running the front end over one macro invocation.

Fields§

§source: Source

The captured C source and its map back to Rust spans, headers and all.

§tokens: Vec<Token>

The preprocessed C token list, ending with lex::TokenKind::Eof.

§unit: TranslationUnit

The parsed translation unit.

§diagnostics: Diagnostics

Everything that went wrong.

§expansions: Expansions

The macro invocations the preprocessor replaced, which later passes’ diagnostics are annotated from.

§user_headers: Vec<PathBuf>

The absolute paths of the user headers that were read, which the expansion mentions so that Cargo rebuilds when one changes.

§embedded_files: Vec<PathBuf>

The absolute paths of the resources #embed read, mentioned in the expansion for the same reason.

§link_libraries: Vec<String>

The libraries #pragma cinrs link asked the expansion to be linked against, each of which becomes an extern block of its own.

§safe_functions: Vec<SafeName>

The functions #pragma cinrs safe asked to be generated without unsafe; see sema::check_safe.

§export: bool

Whether #pragma cinrs export asked for real C symbols.

§no_std: bool

Whether #pragma cinrs no_std said the expansion goes into a #![no_std] crate, so that the storage a variable length array or alloca needs comes from alloc rather than from std.

§crate_path: Option<String>

The Rust path #pragma cinrs crate gave the cinrs facade crate, if any; see ir::DEFAULT_CRATE_PATH.

§options: Options

The options the rest of the pipeline is to run with.

These are the caller’s, with the target model resolved: whatever TARGET_ENV_VAR and the unit’s own #pragma cinrs target had to say is already in Options::target, so sema and code generation must use these rather than the ones they were handed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.