mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			285 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			285 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ known-bug: #105249
 | 
						|
//@ compile-flags: -Zpolymorphize=on
 | 
						|
 | 
						|
trait Foo<T> {
 | 
						|
    fn print<'a>(&'a self) where T: 'a { println!("foo"); }
 | 
						|
}
 | 
						|
 | 
						|
impl<'a> Foo<&'a ()> for () { }
 | 
						|
 | 
						|
trait Bar: for<'a> Foo<&'a ()> { }
 | 
						|
 | 
						|
impl Bar for () {}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    (&() as &dyn Bar).print(); // Segfault
 | 
						|
}
 |