pub struct TranslateOptions {
pub mir_level: MirLevel,
pub translate_all_methods: bool,
pub no_code_duplication: bool,
pub hide_marker_traits: bool,
pub no_merge_goto_chains: bool,
pub print_built_llbc: 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: MirLevel
The level at which to extract the MIR
translate_all_methods: bool
Usually we skip the provided methods that aren’t used. When this flag is on, we translate them all.
no_code_duplication: bool
Error out if some code ends up being duplicated by the control-flow reconstruction (note that because several patterns in a match may lead to the same branch, it is node always possible not to duplicate code).
hide_marker_traits: bool
Whether to hide the Sized
, Sync
, Send
and Unpin
marker traits anywhere they show
up.
no_merge_goto_chains: bool
Do not merge the chains of gotos.
print_built_llbc: bool
Print the llbc just after control-flow reconstruction.
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