diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-24 12:33:40 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-24 12:33:40 +0530 |
| commit | 2d74b53a034dc538d624f6c3b3ec313d40033415 (patch) | |
| tree | 1620398d3d3627a60fe4703e85bd4099a0ba28d5 | |
| parent | 13efa529462a0f12bb0ffba7ed1ea58925e6a1b7 (diff) | |
| parent | a1396d250ad5b1b7e9143a6a844ed7ba40bd0e55 (diff) | |
| download | rust-2d74b53a034dc538d624f6c3b3ec313d40033415.tar.gz rust-2d74b53a034dc538d624f6c3b3ec313d40033415.zip | |
Rollup merge of #22720 - edwardw:enum-struct-ident-walk-into-a-bar, r=nick29581
Closes #22589 Closes #22647 Closes #22665 Closes #22712
| -rw-r--r-- | src/test/parse-fail/issue-22647.rs | 25 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-22712.rs | 19 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/test/parse-fail/issue-22647.rs b/src/test/parse-fail/issue-22647.rs new file mode 100644 index 00000000000..5de86270010 --- /dev/null +++ b/src/test/parse-fail/issue-22647.rs @@ -0,0 +1,25 @@ +// 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. + +fn main() { + let caller<F> = |f: F| //~ ERROR unexpected token: `<` + where F: Fn() -> i32 + { + let x = f(); + println!("Y {}",x); + return x; + }; + + caller(bar_handler); +} + +fn bar_handler() -> i32 { + 5 +} diff --git a/src/test/parse-fail/issue-22712.rs b/src/test/parse-fail/issue-22712.rs new file mode 100644 index 00000000000..abc9e599467 --- /dev/null +++ b/src/test/parse-fail/issue-22712.rs @@ -0,0 +1,19 @@ +// 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. + +struct Foo<B> { + buffer: B +} + +fn bar() { + let Foo<Vec<u8>> //~ ERROR unexpected token: `<` +} + +fn main() {} |
