pub struct TranslateOptions {Show 14 fields
pub mir_level: MirLevel,
pub translate_all_methods: bool,
pub monomorphize_mut: Option<MonomorphizeMut>,
pub hide_marker_traits: bool,
pub remove_adt_clauses: bool,
pub hide_allocator: bool,
pub remove_unused_self_clauses: bool,
pub monomorphize_with_hax: bool,
pub no_ops_to_function_calls: bool,
pub no_merge_goto_chains: bool,
pub print_built_llbc: bool,
pub raw_boxes: bool,
pub item_opacities: Vec<(NamePattern, ItemOpacity)>,
pub remove_associated_types: Vec<NamePattern>,
}Expand description
The options that control translation and transformation.
Fields§
§mir_level: MirLevelThe level at which to extract the MIR
translate_all_methods: boolUsually we skip the provided methods that aren’t used. When this flag is on, we translate them all.
monomorphize_mut: Option<MonomorphizeMut>If Some(_), run the partial mutability monomorphization pass. The contained enum
indicates whether to partially monomorphize types.
hide_marker_traits: boolWhether to hide the Sized, Sync, Send and Unpin marker traits anywhere they show
up.
remove_adt_clauses: boolRemove trait clauses attached to type declarations.
hide_allocator: boolHide the A type parameter on standard library containers (Box, Vec, etc).
remove_unused_self_clauses: boolRemove unused Self: Trait clauses on method declarations.
monomorphize_with_hax: boolMonomorphize code using hax’s instantiation mechanism.
no_ops_to_function_calls: boolTransforms ArrayToSlice, Repeat, and RawPtr aggregates to builtin function calls.
no_merge_goto_chains: boolDo not merge the chains of gotos.
print_built_llbc: boolPrint the llbc just after control-flow reconstruction.
raw_boxes: boolDon’t special-case the translation of Box<T>
item_opacities: Vec<(NamePattern, ItemOpacity)>List of patterns to assign a given opacity to. Same as the corresponding TranslateOptions
field.
remove_associated_types: Vec<NamePattern>List of traits for which we transform associated types to type parameters.
Implementations§
Source§impl TranslateOptions
impl TranslateOptions
pub fn new(error_ctx: &mut ErrorCtx, options: &CliOpts) -> Self
Sourcepub fn opacity_for_name(
&self,
krate: &TranslatedCrate,
name: &Name,
) -> ItemOpacity
pub fn opacity_for_name( &self, krate: &TranslatedCrate, name: &Name, ) -> ItemOpacity
Find the opacity requested for the given name. This does not take into account
#[charon::opaque] annotations, only cli parameters.
Auto Trait Implementations§
impl Freeze for TranslateOptions
impl RefUnwindSafe for TranslateOptions
impl Send for TranslateOptions
impl Sync for TranslateOptions
impl Unpin for TranslateOptions
impl UnwindSafe for TranslateOptions
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<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more