pub struct Diagnostic {
pub inner: Box<DiagnosticsInner>,
}Expand description
The Diagnostics struct describes an issue encountered during compile time.
The issue is defined by an error_code and had a defined severity
Diagnostic severity can be overridden when being reported.
Fields§
§inner: Box<DiagnosticsInner>Implementations§
Source§impl Diagnostic
Builder for Diagnostics
impl Diagnostic
Builder for Diagnostics
pub fn new(message: impl Into<String>) -> Self
pub fn with_location<T>(self, location: T) -> Selfwhere
T: Into<SourceLocation>,
pub fn with_secondary_location<T>(self, location: T) -> Selfwhere
T: Into<SourceLocation>,
pub fn with_secondary_locations(self, locations: Vec<SourceLocation>) -> Self
pub fn with_error_code(self, code: &'static str) -> Self
pub fn with_sub_diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn with_sub_diagnostics(self, diagnostics: Vec<Diagnostic>) -> Self
pub fn with_internal_error(self, error: Error) -> Self
pub fn from_serde_error(error: Error, source: &SourceCode) -> Self
Source§impl Diagnostic
impl Diagnostic
pub fn get_message(&self) -> &str
pub fn get_location(&self) -> SourceLocation
pub fn get_secondary_locations(&self) -> Option<&[SourceLocation]>
pub fn get_error_code(&self) -> &'static str
pub fn get_sub_diagnostics(&self) -> Vec<&Diagnostic>
Source§impl Diagnostic
impl Diagnostic
pub fn unexpected_token_found<T>(
expected: &str,
found: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn missing_function<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn codegen_error<T, U>(message: T, location: U) -> Diagnostic
pub fn llvm_error(file: &str, llvm_error: &str) -> Diagnostic
pub fn missing_token<T>(expected_token: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_argument_count<T>(
expected: usize,
actual: usize,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unknown_type<T>(type_name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unresolved_reference<T>(reference: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_assignment<T>(
right_type: &str,
left_type: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_polymorphic_assignment<T>(
right_type: &str,
left_type: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_interface_pou_assignment<T>(
pou_name: &str,
interface_name: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_interface_assignment<T>(
source_iface: &str,
target_iface: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn invalid_direct_interface_call<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn cannot_generate_initializer<T>(
variable_name: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn cannot_generate_call_statement(operator: &AstNode) -> Diagnostic
pub fn cannot_generate_from_empty_literal<T>(
type_name: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn const_pragma_is_not_allowed<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
Source§impl Diagnostic
impl Diagnostic
pub fn unnamed_control<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unsupported_cfc_expression<T>(
expression: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unconnected_element<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn disconnected_return<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn duplicate_connector<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn dangling_continuation<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn open_connector<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn undefined_jump_target<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unused_label<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn duplicate_label<T>(label: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unknown_block_type<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn undeclared_block_output<T>(
output: &str,
name: &str,
location: T,
) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unconnected_en<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn eno_cycle<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn negated_reference_assignment<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn duplicate_return_pin<T>(name: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn disconnected_jump<T>(location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
pub fn unresolved_generic_output<T>(block: &str, location: T) -> Diagnosticwhere
T: Into<SourceLocation>,
Trait Implementations§
Source§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl Deref for Diagnostic
impl Deref for Diagnostic
Source§impl DerefMut for Diagnostic
impl DerefMut for Diagnostic
Source§impl Display for Diagnostic
impl Display for Diagnostic
Source§impl Error for Diagnostic
impl Error for Diagnostic
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for Diagnostic
impl From<Error> for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
impl Eq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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
Mutably borrows from an owned value. Read more