pub struct TranslateOptions {Show 22 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 ops_to_function_calls: bool,
pub index_to_function_calls: bool,
pub print_built_llbc: bool,
pub treat_box_as_builtin: bool,
pub raw_consts: bool,
pub reconstruct_fallible_operations: bool,
pub reconstruct_asserts: bool,
pub unbind_item_vars: bool,
pub item_opacities: Vec<(NamePattern, ItemOpacity)>,
pub remove_associated_types: Vec<NamePattern>,
pub desugar_drops: bool,
pub add_destruct_bounds: bool,
pub translate_poly_drop_glue: bool,
pub erase_body_lifetimes: bool,
}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 various marker traits such as Sized, Sync, Send and Destruct
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.
ops_to_function_calls: boolTransform array-to-slice unsizing, repeat expressions, and raw pointer construction into builtin functions in ULLBC.
index_to_function_calls: boolTransform array/slice indexing into builtin functions in ULLBC.
print_built_llbc: boolPrint the llbc just after control-flow reconstruction.
treat_box_as_builtin: boolTreat Box<T> as if it was a built-in type.
raw_consts: boolDon’t inline or evaluate constants.
reconstruct_fallible_operations: boolReplace “bound checks followed by UB-on-overflow operation” with the corresponding panic-on-overflow operation. This loses unwinding information.
reconstruct_asserts: boolReplace “if x { panic() }” with “assert(x)”.
unbind_item_vars: bool§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.
desugar_drops: boolTransform Drop to Call drop_in_place
add_destruct_bounds: boolAdd Destruct bounds to all generic params.
translate_poly_drop_glue: boolTranslate drop glue for poly types, knowing that this may cause ICEs.
erase_body_lifetimes: boolWhether to erase all Body lifetimes at the end of translation.
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