about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorAravind Gollakota <aravindprasant@gmail.com>2016-07-05 21:35:12 -0700
committerAravind Gollakota <aravindprasant@gmail.com>2016-07-15 21:02:53 -0700
commitff95ba3a8c1cc2cf9b1901a18ba73434f3380c0d (patch)
tree35edd1373f7de95abf1cbd0e36990a79b66b3f04 /src/test/parse-fail
parent3dbbe2f716a09246939ad371125617c5526fd3fd (diff)
downloadrust-ff95ba3a8c1cc2cf9b1901a18ba73434f3380c0d.tar.gz
rust-ff95ba3a8c1cc2cf9b1901a18ba73434f3380c0d.zip
syntax: Better error message for inner attr following doc comment
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/inner-attr-after-doc-comment.rs20
-rw-r--r--src/test/parse-fail/inner-attr.rs16
2 files changed, 36 insertions, 0 deletions
diff --git a/src/test/parse-fail/inner-attr-after-doc-comment.rs b/src/test/parse-fail/inner-attr-after-doc-comment.rs
new file mode 100644
index 00000000000..ed8342d9f5a
--- /dev/null
+++ b/src/test/parse-fail/inner-attr-after-doc-comment.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 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.
+
+// compile-flags: -Z parse-only
+
+#![feature(lang_items)]
+/**
+ * My module
+ */
+
+#![recursion_limit="100"]
+//~^ ERROR an inner attribute is not permitted following an outer doc comment
+fn main() {}
diff --git a/src/test/parse-fail/inner-attr.rs b/src/test/parse-fail/inner-attr.rs
new file mode 100644
index 00000000000..8cebda66445
--- /dev/null
+++ b/src/test/parse-fail/inner-attr.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 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.
+
+// compile-flags: -Z parse-only
+
+#[feature(lang_items)]
+
+#![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute
+fn main() {}