summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs b/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs
new file mode 100644
index 000000000..a85113600
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![feature(const_trait_impl, once_cell)]
+
+use std::sync::LazyLock;
+
+static EXTERN_FLAGS: LazyLock<String> = LazyLock::new(|| {
+ let x = || String::new();
+ x()
+});
+
+fn main() {}