#[non_exhaustive]pub enum JumpProblem {
BreakOutsideLoop,
ContinueOutsideLoop,
LabelNotInScope,
ContinueToBlock,
OutOfDefer,
ContinueInStep,
}Expand description
A jump that has no valid target; carried by HirError::Jump.
§Examples
use hir_lang::JumpProblem;
assert_eq!(JumpProblem::ContinueToBlock.to_string(), "`continue` targets a block, not a loop");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.
BreakOutsideLoop
break without a label outside any loop of the current function.
ContinueOutsideLoop
continue without a label outside any loop of the current function.
LabelNotInScope
The label is not an enclosing loop or block of the current function.
ContinueToBlock
continue names a labeled block.
OutOfDefer
A jump would leave a defer body (jumps may leave finally).
ContinueInStep
continue targets the loop whose step it is in.
Trait Implementations§
Source§impl Clone for JumpProblem
impl Clone for JumpProblem
impl Copy for JumpProblem
Source§impl Debug for JumpProblem
impl Debug for JumpProblem
Source§impl Display for JumpProblem
impl Display for JumpProblem
impl Eq for JumpProblem
Source§impl Hash for JumpProblem
impl Hash for JumpProblem
Source§impl PartialEq for JumpProblem
impl PartialEq for JumpProblem
impl StructuralPartialEq for JumpProblem
Auto Trait Implementations§
impl Freeze for JumpProblem
impl RefUnwindSafe for JumpProblem
impl Send for JumpProblem
impl Sync for JumpProblem
impl Unpin for JumpProblem
impl UnsafeUnpin for JumpProblem
impl UnwindSafe for JumpProblem
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