diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-03-10 12:28:44 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-03-11 23:39:16 +0200 |
| commit | f98b1763140e4c9b0f122bde2f5cbd24227554a2 (patch) | |
| tree | 70e9da4c25e7f110b2ac58f3c6500dbb309bf772 /src/test/parse-fail | |
| parent | 98491827b920884e4ea1182dcacce2a650dde861 (diff) | |
| download | rust-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.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/trait-pub-assoc-ty.rs | 15 | ||||
| -rw-r--r-- | src/test/parse-fail/trait-pub-method.rs | 15 |
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() {} |
