1 // Test that we still check constants are well-formed, even when we there's no
2 // type annotation to check.
4 const FUN: fn(&'static ()) = |_| {};
7 const ASSOCIATED_FUN: fn(&'static ()) = |_| {};
12 const ALSO_ASSOCIATED_FUN: fn(&'static ()) = |_| {};
16 const TRAIT_ASSOCIATED_FUN: fn(&'static Self) = |_| ();
23 FUN(&x); //~ ERROR `x` does not live long enough
24 A::ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough
25 B::ALSO_ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough
26 <_>::TRAIT_ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough