mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			214 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			214 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
fn bar(x: &mut i32) {}
 | 
						|
fn foo(a: &mut i32) {
 | 
						|
    let ref y = a;
 | 
						|
    bar(a); //~ ERROR E0502
 | 
						|
    y.use_ref();
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
}
 | 
						|
 | 
						|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
 | 
						|
impl<T> Fake for T { }
 |