Skip to main content

Module translate_trait_objects

Module translate_trait_objects 

Source

Re-exportsΒ§

use itertools::Itertools; πŸ”’
use rustc_attr_ir::LangItem; πŸ”’
use rustc_span::kw; πŸ”’
use std::mem; πŸ”’
use super::translate_closures::recognize_fn_trait_impl_proof; πŸ”’
use super::translate_generics::BindingLevel; πŸ”’
use crate::frontend as front; πŸ”’
use charon_lib::formatter::IntoFormatter; πŸ”’
use charon_lib::pretty::FmtWithCtx; πŸ”’
use super::translate_ctx::*; πŸ”’
use charon_lib::ullbc_ast::*; πŸ”’

StructsΒ§

VTableData

EnumsΒ§

TrVTableField
Vtable field info used for translation (same deal as charon_lib::VTableField but with different data).
VtableMethodValue πŸ”’
A vtable method pointer.

FunctionsΒ§

dynify πŸ”’
Takes a T valid in the context of a trait ref and transforms it into a T valid in the context of its vtable definition, i.e. no longer mentions the Self type or Self clause. If new_self is Some, we replace any mention of the Self type with it; otherwise we panic if Self is mentioned. If for_method is true, we’re handling a value coming from a AssocFn, which takes the Self clause as its first clause parameter. Otherwise we’re in trait scope, where the Self clause is represented with TraitRefKind::SelfId.