mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-29 20:15:27 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			431 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			431 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| trait Trait {
 | |
|     type Assoc;
 | |
| }
 | |
| 
 | |
| impl<X: 'static> Trait for (X,) {
 | |
|     type Assoc = ();
 | |
| }
 | |
| 
 | |
| struct Foo<T: Trait>(T)
 | |
| where
 | |
|     T::Assoc: Clone; // any predicate using `T::Assoc` works here
 | |
| 
 | |
| fn func1(foo: Foo<(&str,)>) {
 | |
|     //~^ ERROR `&str` does not fulfill the required lifetime
 | |
|     let _: &'static str = foo.0.0;
 | |
| }
 | |
| 
 | |
| trait TestTrait {}
 | |
| 
 | |
| impl<X> TestTrait for [Foo<(X,)>; 1] {}
 | |
| //~^ ERROR `X` may not live long enough
 | |
| 
 | |
| fn main() {}
 | 
