about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-03-10 12:28:44 +0200
committerEduard Burtescu <edy.burt@gmail.com>2015-03-11 23:39:16 +0200
commitf98b1763140e4c9b0f122bde2f5cbd24227554a2 (patch)
tree70e9da4c25e7f110b2ac58f3c6500dbb309bf772 /src/test/parse-fail
parent98491827b920884e4ea1182dcacce2a650dde861 (diff)
downloadrust-f98b1763140e4c9b0f122bde2f5cbd24227554a2.tar.gz
rust-f98b1763140e4c9b0f122bde2f5cbd24227554a2.zip
syntax: gather common fields of impl & trait items into their respective types.
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/issue-21153.rs2
-rw-r--r--src/test/parse-fail/trait-pub-assoc-ty.rs15
-rw-r--r--src/test/parse-fail/trait-pub-method.rs15
3 files changed, 31 insertions, 1 deletions
diff --git a/src/test/parse-fail/issue-21153.rs b/src/test/parse-fail/issue-21153.rs
index e2b6deb0ad9..6496ffebbc8 100644
--- a/src/test/parse-fail/issue-21153.rs
+++ b/src/test/parse-fail/issue-21153.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 trait MyTrait<T>: Iterator {
-    Item = T; //~ ERROR expected one of `extern`, `fn`, `pub`, `type`, or `unsafe`, found `Item`
+    Item = T; //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `Item`
 }
diff --git a/src/test/parse-fail/trait-pub-assoc-ty.rs b/src/test/parse-fail/trait-pub-assoc-ty.rs
new file mode 100644
index 00000000000..02d76234d4e
--- /dev/null
+++ b/src/test/parse-fail/trait-pub-assoc-ty.rs
@@ -0,0 +1,15 @@
+// Copyright 2015 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.
+
+trait Foo {
+    pub type Foo; //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `pub`
+}
+
+fn main() {}
diff --git a/src/test/parse-fail/trait-pub-method.rs b/src/test/parse-fail/trait-pub-method.rs
new file mode 100644
index 00000000000..e76802d2ea0
--- /dev/null
+++ b/src/test/parse-fail/trait-pub-method.rs
@@ -0,0 +1,15 @@
+// Copyright 2015 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.
+
+trait Foo {
+    pub fn foo(); //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `pub`
+}
+
+fn main() {}