Skip to content

Commit 3041520

Browse files
committed
---
yaml --- r: 164833 b: refs/heads/try c: 9c9253e h: refs/heads/master i: 164831: 6be8718 v: v3
1 parent 0bf1717 commit 3041520

File tree

5 files changed

+93
-1
lines changed

5 files changed

+93
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5-
refs/heads/try: 0fefd835f22adfd73e735dd6ee2b5e541291d636
5+
refs/heads/try: 9c9253e859c8a7d1cf522e56bca09502bda38573
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test that we generate obsolete syntax errors around usages of `proc`.
12+
13+
fn foo(p: proc()) { } //~ ERROR obsolete syntax: the `proc` type
14+
15+
fn bar() { proc() 1; } //~ ERROR obsolete syntax: `proc` expression
16+
17+
fn main() { }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
// Test that parentheses form doesn't work with struct types appearing in local variables.
13+
14+
struct Bar<A,R> {
15+
f: A, r: R
16+
}
17+
18+
fn bar() {
19+
let x: Box<Bar()> = panic!();
20+
//~^ ERROR E0169
21+
}
22+
23+
fn main() { }
24+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test that parentheses form doesn't work in expression paths.
12+
13+
struct Bar<A,R> {
14+
f: A, r: R
15+
}
16+
17+
impl<A,B> Bar<A,B> {
18+
fn new() -> Bar<A,B> { panic!() }
19+
}
20+
21+
fn bar() {
22+
let b = Box::Bar::<int,uint>::new(); // OK
23+
24+
let b = Box::Bar::()::new();
25+
//~^ ERROR expected ident, found `(`
26+
}
27+
28+
fn main() { }
29+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test that parentheses form doesn't work with struct types appearing in argument types.
12+
13+
struct Bar<A,R> {
14+
f: A, r: R
15+
}
16+
17+
fn foo(b: Box<Bar()>) {
18+
//~^ ERROR E0169
19+
}
20+
21+
fn main() { }
22+

0 commit comments

Comments
 (0)