mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			239 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			239 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// Check that we correctly prevent users from making trait objects
 | 
						|
// from traits where `Self : Sized`.
 | 
						|
 | 
						|
trait Bar: Sized {
 | 
						|
    fn bar<T>(&self, t: T);
 | 
						|
}
 | 
						|
 | 
						|
fn make_bar<T: Bar>(t: &T) -> &dyn Bar {
 | 
						|
    //~^ ERROR E0038
 | 
						|
    t
 | 
						|
}
 | 
						|
 | 
						|
fn main() {}
 |