mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			423 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			423 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// Test that a `break` without `#[const_continue]` still works as expected.
 | 
						|
 | 
						|
//@ run-pass
 | 
						|
 | 
						|
#![allow(incomplete_features)]
 | 
						|
#![feature(loop_match)]
 | 
						|
 | 
						|
fn main() {
 | 
						|
    assert_eq!(helper(), 1);
 | 
						|
}
 | 
						|
 | 
						|
fn helper() -> u8 {
 | 
						|
    let mut state = 0u8;
 | 
						|
    #[loop_match]
 | 
						|
    'a: loop {
 | 
						|
        state = 'blk: {
 | 
						|
            match state {
 | 
						|
                0 => break 'blk 1,
 | 
						|
                _ => break 'a state,
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |