summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs')
-rw-r--r--src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs
deleted file mode 100644
index 90696d4b1..000000000
--- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Test that we still check constants are well-formed, even when we there's no
-// type annotation to check.
-
-const FUN: fn(&'static ()) = |_| {};
-struct A;
-impl A {
- const ASSOCIATED_FUN: fn(&'static ()) = |_| {};
-}
-
-struct B<'a>(&'a ());
-impl B<'static> {
- const ALSO_ASSOCIATED_FUN: fn(&'static ()) = |_| {};
-}
-
-trait Z: 'static {
- const TRAIT_ASSOCIATED_FUN: fn(&'static Self) = |_| ();
-}
-
-impl Z for () {}
-
-fn main() {
- let x = ();
- FUN(&x); //~ ERROR `x` does not live long enough
- A::ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough
- B::ALSO_ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough
- <_>::TRAIT_ASSOCIATED_FUN(&x); //~ ERROR `x` does not live long enough
-}