mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			326 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			326 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
fn test() {
 | 
						|
    let v: isize;
 | 
						|
    //~^ HELP consider making this binding mutable
 | 
						|
    //~| SUGGESTION mut
 | 
						|
    v = 1; //~ NOTE first assignment
 | 
						|
    println!("v={}", v);
 | 
						|
    v = 2; //~ ERROR cannot assign twice to immutable variable
 | 
						|
           //~| NOTE cannot assign twice to immutable
 | 
						|
    println!("v={}", v);
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
}
 |