mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			269 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			269 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ check-pass
 | 
						|
// issue: 116794
 | 
						|
 | 
						|
// Uncaptured lifetimes should not be required to be live.
 | 
						|
 | 
						|
struct Invariant<T>(*mut T);
 | 
						|
 | 
						|
fn opaque<'a: 'a>(_: &'a str) -> Invariant<impl Sized> {
 | 
						|
    Invariant(&mut ())
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    let x = opaque(&String::new());
 | 
						|
    drop(x);
 | 
						|
}
 |