2023-12-01 14:13:01 -06:00
|
|
|
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,)>) {
|
2023-12-10 19:13:21 -06:00
|
|
|
//~^ ERROR `&str` does not fulfill the required lifetime
|
2023-12-01 14:13:01 -06:00
|
|
|
let _: &'static str = foo.0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
trait TestTrait {}
|
|
|
|
|
|
|
|
impl<X> TestTrait for [Foo<(X,)>; 1] {}
|
2023-12-10 19:13:21 -06:00
|
|
|
//~^ ERROR `X` may not live long enough
|
2023-12-01 14:13:01 -06:00
|
|
|
|
|
|
|
fn main() {}
|