summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs')
-rw-r--r--src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs b/src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs
new file mode 100644
index 000000000..60da408c8
--- /dev/null
+++ b/src/test/ui/parser/assoc-const-underscore-syntactic-pass.rs
@@ -0,0 +1,18 @@
+// All constant items (associated or otherwise) may syntactically use `_` as a name.
+
+// check-pass
+
+fn main() {}
+
+#[cfg(FALSE)]
+const _: () = {
+ pub trait A {
+ const _: () = ();
+ }
+ impl A for () {
+ const _: () = ();
+ }
+ impl dyn A {
+ const _: () = ();
+ }
+};