mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			253 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			253 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// Test bounds checking for DST raw slices
 | 
						|
 | 
						|
// run-fail
 | 
						|
// error-pattern:index out of bounds
 | 
						|
// ignore-emscripten no processes
 | 
						|
 | 
						|
#[allow(unconditional_panic)]
 | 
						|
fn main() {
 | 
						|
    let a: *const [_] = &[1, 2, 3];
 | 
						|
    unsafe {
 | 
						|
        let _b = (*a)[3];
 | 
						|
    }
 | 
						|
}
 |