#[non_exhaustive]pub enum EffectProblem {
ReturnOutsideFunction,
AwaitOutsideAsync,
YieldOutsideGenerator,
ThrowNotAllowed,
}Expand description
An effect form outside a frame that allows it; carried by
HirError::Effect.
§Examples
use hir_lang::EffectProblem;
assert_eq!(EffectProblem::AwaitOutsideAsync.to_string(), "`await` outside an async function");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.
ReturnOutsideFunction
return outside a function or closure body.
AwaitOutsideAsync
await in a frame without ASYNC.
YieldOutsideGenerator
yield in a frame without YIELD.
ThrowNotAllowed
throw in a frame without THROWS and outside a try body.
Trait Implementations§
Source§impl Clone for EffectProblem
impl Clone for EffectProblem
impl Copy for EffectProblem
Source§impl Debug for EffectProblem
impl Debug for EffectProblem
Source§impl Display for EffectProblem
impl Display for EffectProblem
impl Eq for EffectProblem
Source§impl Hash for EffectProblem
impl Hash for EffectProblem
Source§impl PartialEq for EffectProblem
impl PartialEq for EffectProblem
impl StructuralPartialEq for EffectProblem
Auto Trait Implementations§
impl Freeze for EffectProblem
impl RefUnwindSafe for EffectProblem
impl Send for EffectProblem
impl Sync for EffectProblem
impl Unpin for EffectProblem
impl UnsafeUnpin for EffectProblem
impl UnwindSafe for EffectProblem
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