Skip to content

Commit d158a60

Browse files
committed
---
yaml --- r: 152721 b: refs/heads/try2 c: db9af1d h: refs/heads/master i: 152719: 57185bb v: v3
1 parent df35c3c commit d158a60

File tree

10 files changed

+34
-15
lines changed

10 files changed

+34
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8bcfabaeac4374e374f473c048b9b03f468685da
8+
refs/heads/try2: db9af1d505809c965e719bf4ad775ff984ee3da6
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,12 @@ impl<'a> Parser<'a> {
16581658
let bounds = {
16591659
if self.eat(&token::BINOP(token::PLUS)) {
16601660
let (_, bounds) = self.parse_ty_param_bounds(false);
1661+
if bounds.len() == 0 {
1662+
let last_span = self.last_span;
1663+
self.span_err(last_span,
1664+
"at least one type parameter bound \
1665+
must be specified after the `+`");
1666+
}
16611667
Some(bounds)
16621668
} else {
16631669
None

branches/try2/src/test/compile-fail/kindck-send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn test<'a,T,U:Send>(_: &'a int) {
4040
assert_send::<&'static Dummy>(); //~ ERROR does not fulfill `Send`
4141
assert_send::<&'a Dummy>(); //~ ERROR does not fulfill `Send`
4242
assert_send::<&'a Dummy+Send>(); //~ ERROR does not fulfill `Send`
43-
assert_send::<Box<Dummy+>>(); //~ ERROR does not fulfill `Send`
43+
assert_send::<Box<Dummy>>(); //~ ERROR does not fulfill `Send`
4444

4545
// ...unless they are properly bounded
4646
assert_send::<&'static Dummy+Send>();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2012 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+
use std::fmt::Show;
12+
13+
fn main() {
14+
let x: Box<Show+> = box 3 as Box<Show+>;
15+
//~^ ERROR at least one type parameter bound must be specified
16+
//~^^ ERROR at least one type parameter bound must be specified
17+
}
18+

branches/try2/src/test/compile-fail/trait-bounds-cant-coerce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn c(x: Box<Foo+Share+Send>) {
1919
a(x);
2020
}
2121

22-
fn d(x: Box<Foo+>) {
22+
fn d(x: Box<Foo>) {
2323
a(x); //~ ERROR found no bounds
2424
}
2525

branches/try2/src/test/run-pass/close-over-big-then-small-data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ impl<A:Clone> Invokable<A> for Invoker<A> {
3333
}
3434
}
3535

36-
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<Invokable<A>+> {
36+
fn f<A:Clone + 'static>(a: A, b: u16) -> Box<Invokable<A>> {
3737
box Invoker {
3838
a: a,
3939
b: b,
40-
} as (Box<Invokable<A>>+)
40+
} as (Box<Invokable<A>>)
4141
}
4242

4343
pub fn main() {

branches/try2/src/test/run-pass/closure-syntax.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ fn bar<'b>() {
5959
foo::< <'a>|int, f32, &'a int|:'b + Share -> &'a int>();
6060
foo::<proc()>();
6161
foo::<proc() -> ()>();
62-
foo::<proc():>();
6362
foo::<proc():'static>();
6463
foo::<proc():Share>();
6564
foo::<proc<'a>(int, f32, &'a int):'static + Share -> &'a int>();

branches/try2/src/test/run-pass/issue-7673-cast-generically-implemented-trait.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ pub fn main() {}
2020
trait A {}
2121
impl<T: 'static> A for T {}
2222

23-
fn owned1<T: 'static>(a: T) { box a as Box<A+>; } /* note `:` */
2423
fn owned2<T: 'static>(a: Box<T>) { a as Box<A>; }
2524
fn owned3<T: 'static>(a: Box<T>) { box a as Box<A>; }

branches/try2/src/test/run-pass/proc-bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828

2929

3030
let a = 3;
31-
bar::<proc():>(proc() {
31+
bar::<proc()>(proc() {
3232
let b = &a;
3333
println!("{}", *b);
3434
});

branches/try2/src/test/run-pass/trait-bounds-basic.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,19 @@
1212
trait Foo {
1313
}
1414

15-
fn a(_x: Box<Foo+>) {
16-
}
17-
1815
fn b(_x: Box<Foo+Send>) {
1916
}
2017

2118
fn c(x: Box<Foo+Share+Send>) {
22-
a(x);
19+
e(x);
2320
}
2421

2522
fn d(x: Box<Foo+Send>) {
26-
b(x);
23+
e(x);
2724
}
2825

29-
fn e(x: Box<Foo>) { // sugar for Box<Foo+Owned>
30-
a(x);
26+
fn e(x: Box<Foo>) {
27+
e(x);
3128
}
3229

3330
pub fn main() { }

0 commit comments

Comments
 (0)