mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			320 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			320 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// Test that a covariant struct permits the lifetime of a reference to
 | 
						|
// be shortened.
 | 
						|
 | 
						|
#![allow(dead_code)]
 | 
						|
// build-pass (FIXME(62277): could be check-pass?)
 | 
						|
 | 
						|
struct SomeStruct<T>(T);
 | 
						|
 | 
						|
fn foo<'min,'max>(v: SomeStruct<&'max ()>)
 | 
						|
                  -> SomeStruct<&'min ()>
 | 
						|
    where 'max : 'min
 | 
						|
{
 | 
						|
    v
 | 
						|
}
 | 
						|
 | 
						|
fn main() { }
 |