about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-08-12 20:15:59 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-08-15 00:05:55 +0300
commit097c40cf6e1defc2fc49d521374254ee27f5f1fb (patch)
tree9be9e40c39ef3c39f8e0bec5f7de31d69543b75a /src/test/parse-fail
parenta5733050de780ae4d11e3a7af615df792fdf908e (diff)
downloadrust-097c40cf6e1defc2fc49d521374254ee27f5f1fb.tar.gz
rust-097c40cf6e1defc2fc49d521374254ee27f5f1fb.zip
syntax: Enforce attribute grammar in the parser
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/attr-bad-meta-2.rs12
-rw-r--r--src/test/parse-fail/attr-bad-meta-3.rs12
-rw-r--r--src/test/parse-fail/attr-bad-meta.rs5
3 files changed, 27 insertions, 2 deletions
diff --git a/src/test/parse-fail/attr-bad-meta-2.rs b/src/test/parse-fail/attr-bad-meta-2.rs
new file mode 100644
index 00000000000..ce640a3f67c
--- /dev/null
+++ b/src/test/parse-fail/attr-bad-meta-2.rs
@@ -0,0 +1,12 @@
+// 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.
+
+#[path =] //~ ERROR unexpected token: `]`
+mod m {}
diff --git a/src/test/parse-fail/attr-bad-meta-3.rs b/src/test/parse-fail/attr-bad-meta-3.rs
new file mode 100644
index 00000000000..92e2a59d25d
--- /dev/null
+++ b/src/test/parse-fail/attr-bad-meta-3.rs
@@ -0,0 +1,12 @@
+// 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.
+
+#[path() token] //~ ERROR expected `]`, found `token`
+mod m {}
diff --git a/src/test/parse-fail/attr-bad-meta.rs b/src/test/parse-fail/attr-bad-meta.rs
index 41db88121cb..6f9d794dc2d 100644
--- a/src/test/parse-fail/attr-bad-meta.rs
+++ b/src/test/parse-fail/attr-bad-meta.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// asterisk is bogus
-#[path*] //~ ERROR arbitrary tokens in non-macro attributes are unstable
+#![feature(unrestricted_attribute_tokens)]
+
+#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
 mod m {}