about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2012-10-09 11:59:03 +0200
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-17 15:34:55 -0700
commite7e1bab27fa8341467b5160506bbd580b5f6bbb7 (patch)
treee0196fb2e0cc360308cd39be558fce7c7112d4ba /src/test
parent7dde840dc6b077974d48ae7c966ea16a0e36f3f6 (diff)
libsyntax: refactor the parser to consider foreign items as items
parse_item_or_view_item() would drop visibility if none of the conditions
following it would hold. This was the case when parsing extern {} blocks,
where the function was only used to parse view items, but discarded the
visibility of the first not-view item.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/duplicate-visibility.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/compile-fail/duplicate-visibility.rs b/src/test/compile-fail/duplicate-visibility.rs
new file mode 100644
index 00000000000..32997fcce31
--- /dev/null
+++ b/src/test/compile-fail/duplicate-visibility.rs
@@ -0,0 +1,4 @@
+// error-pattern:unmatched visibility `pub`
+extern {
+    pub pub fn foo();
+}