about summary refs log tree commit diff
path: root/src/test/ui/underscore-ident-matcher.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-03-17 22:08:18 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-03-17 22:08:18 +0300
commited5ea5c705ccea7d2eef1558530e87d2dbb88be7 (patch)
tree6355c3fb56ca99996d6ea171c41d4a8c12b66a98 /src/test/ui/underscore-ident-matcher.rs
parent5d06c890fececc6f6779cd65ca83cef4647b8fdd (diff)
downloadrust-ed5ea5c705ccea7d2eef1558530e87d2dbb88be7.tar.gz
rust-ed5ea5c705ccea7d2eef1558530e87d2dbb88be7.zip
Reject `_` in `ident` matcher
Diffstat (limited to 'src/test/ui/underscore-ident-matcher.rs')
-rw-r--r--src/test/ui/underscore-ident-matcher.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/underscore-ident-matcher.rs b/src/test/ui/underscore-ident-matcher.rs
new file mode 100644
index 00000000000..eee99296c79
--- /dev/null
+++ b/src/test/ui/underscore-ident-matcher.rs
@@ -0,0 +1,19 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+macro_rules! identity {
+    ($i: ident) => (
+        $i
+    )
+}
+
+fn main() {
+    let identity!(_) = 10; //~ ERROR no rules expected the token `_`
+}