Struct charon_lib::errors::ErrorCtx  
source · pub struct ErrorCtx<'ctx> {
    pub continue_on_failure: bool,
    pub error_on_warnings: bool,
    pub dcx: DiagCtxtHandle<'ctx>,
    pub external_decls_with_errors: HashSet<AnyTransId>,
    pub ignored_failed_decls: HashSet<AnyTransId>,
    pub external_dep_sources: HashMap<AnyTransId, HashSet<DepSource>>,
    pub def_id: Option<AnyTransId>,
    pub def_id_is_local: bool,
    pub error_count: usize,
}Expand description
The context for tracking and reporting errors.
Fields§
§continue_on_failure: boolIf true, do not abort on the first error and attempt to extract as much as possible.
error_on_warnings: boolIf true, print the warnings as errors, and abort if any errors were raised.
dcx: DiagCtxtHandle<'ctx>The compiler session, used for displaying errors.
external_decls_with_errors: HashSet<AnyTransId>The ids of the external_declarations for which extraction we encountered errors.
ignored_failed_decls: HashSet<AnyTransId>The ids of the declarations we completely failed to extract and had to ignore.
external_dep_sources: HashMap<AnyTransId, HashSet<DepSource>>For each external item, a list of locations that point to it. See DepSource.
def_id: Option<AnyTransId>The id of the definition we are exploring, used to track the source of errors.
def_id_is_local: boolWhether the definition being explored is local to the crate or not.
error_count: usizeThe number of errors encountered so far.
Implementations§
source§impl ErrorCtx<'_>
 
impl ErrorCtx<'_>
pub fn continue_on_failure(&self) -> bool
pub(crate) fn has_errors(&self) -> bool
sourcepub(crate) fn span_err_no_register<S: Into<MultiSpan>>(
    &self,
    span: S,
    msg: &str,
)
 
pub(crate) fn span_err_no_register<S: Into<MultiSpan>>( &self, span: S, msg: &str, )
Report an error without registering anything.
pub fn ignore_failed_decl(&mut self, id: AnyTransId)
source§impl ErrorCtx<'_>
 
impl ErrorCtx<'_>
sourcepub fn report_external_deps_errors(&self, f: FmtCtx<'_>)
 
pub fn report_external_deps_errors(&self, f: FmtCtx<'_>)
In case errors happened when extracting the definitions coming from the external dependencies, print a detailed report to explain to the user which dependencies were problematic, and where they are used in the code.
Auto Trait Implementations§
impl<'ctx> Freeze for ErrorCtx<'ctx>
impl<'ctx> !RefUnwindSafe for ErrorCtx<'ctx>
impl<'ctx> !Send for ErrorCtx<'ctx>
impl<'ctx> !Sync for ErrorCtx<'ctx>
impl<'ctx> Unpin for ErrorCtx<'ctx>
impl<'ctx> !UnwindSafe for ErrorCtx<'ctx>
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