pub struct CheckError {
pub kind: CheckErrorKind,
pub span: Span,
pub expr_id: i64,
}Expand description
A type checking error.
Fields§
§kind: CheckErrorKindThe kind of error.
span: SpanThe source span where the error occurred.
expr_id: i64The expression ID where the error occurred.
Implementations§
Source§impl CheckError
impl CheckError
Sourcepub fn new(kind: CheckErrorKind, span: Span, expr_id: i64) -> Self
pub fn new(kind: CheckErrorKind, span: Span, expr_id: i64) -> Self
Create a new check error.
Sourcepub fn undeclared_reference(name: &str, span: Span, expr_id: i64) -> Self
pub fn undeclared_reference(name: &str, span: Span, expr_id: i64) -> Self
Create an undeclared reference error.
Sourcepub fn undeclared_reference_in(
container: &str,
name: &str,
span: Span,
expr_id: i64,
) -> Self
pub fn undeclared_reference_in( container: &str, name: &str, span: Span, expr_id: i64, ) -> Self
Create an undeclared reference error with container.
Sourcepub fn no_matching_overload(
function: &str,
arg_types: Vec<CelType>,
span: Span,
expr_id: i64,
) -> Self
pub fn no_matching_overload( function: &str, arg_types: Vec<CelType>, span: Span, expr_id: i64, ) -> Self
Create a no matching overload error.
Sourcepub fn type_mismatch(
expected: CelType,
actual: CelType,
span: Span,
expr_id: i64,
) -> Self
pub fn type_mismatch( expected: CelType, actual: CelType, span: Span, expr_id: i64, ) -> Self
Create a type mismatch error.
Sourcepub fn undefined_field(
type_name: &str,
field: &str,
span: Span,
expr_id: i64,
) -> Self
pub fn undefined_field( type_name: &str, field: &str, span: Span, expr_id: i64, ) -> Self
Create an undefined field error.
Trait Implementations§
Source§impl Clone for CheckError
impl Clone for CheckError
Source§fn clone(&self) -> CheckError
fn clone(&self) -> CheckError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CheckError
impl Debug for CheckError
Source§impl Display for CheckError
impl Display for CheckError
Source§impl Error for CheckError
impl Error for CheckError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for CheckError
impl RefUnwindSafe for CheckError
impl Send for CheckError
impl Sync for CheckError
impl Unpin for CheckError
impl UnsafeUnpin for CheckError
impl UnwindSafe for CheckError
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