#[non_exhaustive]pub enum BreakLevels {
Labels,
Numeric,
}Expand description
What the label of a break or continue is
(LangPolicy::break_levels; LSF2 break_levels).
§Examples
use lower_lang::BreakLevels;
assert_eq!(BreakLevels::default(), BreakLevels::Labels);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.
Labels
A name: break 'outer targets the loop or block labelled 'outer
(Rust, Kraken, JavaScript).
Numeric
A count: break 2 / continue 2 target the second enclosing loop of
the same function (PHP). The level is an integer literal from 1 up
to the number of loops around the jump; 0, anything that is not an
integer literal, or a level beyond the enclosing loops is a
BreakLevel problem. Lowered to a
labelled HIR break/continue: the targeted loop gets a hygienic
label (or keeps its own). An Arch::Loop and a
template node whose template has a label hole (while, do_while,
c_for, for_each) each count as one loop; closures and functions
start a new count.
Trait Implementations§
Source§impl Clone for BreakLevels
impl Clone for BreakLevels
impl Copy for BreakLevels
Source§impl Debug for BreakLevels
impl Debug for BreakLevels
Source§impl Default for BreakLevels
impl Default for BreakLevels
impl Eq for BreakLevels
Source§impl Hash for BreakLevels
impl Hash for BreakLevels
Source§impl PartialEq for BreakLevels
impl PartialEq for BreakLevels
impl StructuralPartialEq for BreakLevels
Auto Trait Implementations§
impl Freeze for BreakLevels
impl RefUnwindSafe for BreakLevels
impl Send for BreakLevels
impl Sync for BreakLevels
impl Unpin for BreakLevels
impl UnsafeUnpin for BreakLevels
impl UnwindSafe for BreakLevels
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