#[non_exhaustive]pub enum CheckError {
NotImplemented {
discipline: Discipline,
},
InvalidProfile,
BudgetExceeded {
limit: Limit,
},
}Expand description
Why a check did not produce a Typed.
§Examples
use hir_lang::Builder;
use typeck_lang::{check, CheckError, Discipline, Profile};
let mut b = Builder::new();
let root = b.module(None, &[]);
let hir = b.finish(root)?;
let err = check(&hir, &Profile::hm()).unwrap_err();
assert_eq!(err, CheckError::NotImplemented { discipline: Discipline::Hm });Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotImplemented
The profile’s discipline is designed but not implemented in this
version (see Discipline::is_implemented). Use Dynamic,
StaticExplicit, or StaticInferred, or a later version of the
crate.
Fields
§
discipline: DisciplineThe requested discipline.
InvalidProfile
The profile is inconsistent: default_int is not an integer type or
default_float not a float type. Fix the profile.
BudgetExceeded
A budget ran out before the check finished. The input is pathological or hostile; raise the budget only if the program is trusted and genuinely that large.
Trait Implementations§
Source§impl Clone for CheckError
impl Clone for CheckError
impl Copy for CheckError
Source§impl Debug for CheckError
impl Debug for CheckError
Source§impl Display for CheckError
impl Display for CheckError
impl Eq for CheckError
Source§impl Error for CheckError
Available on crate feature std only.
impl Error for CheckError
Available on crate feature
std only.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()
Source§impl Hash for CheckError
impl Hash for CheckError
Source§impl PartialEq for CheckError
impl PartialEq for CheckError
impl StructuralPartialEq for CheckError
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