Skip to content

Commit 64c5691

Browse files
committed
---
yaml --- r: 159510 b: refs/heads/master c: 7a846b8 h: refs/heads/master v: v3
1 parent 0c6d800 commit 64c5691

7 files changed

+24
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5a28d178afcecfb6d2231bb461c5a66864c50f0d
2+
refs/heads/master: 7a846b86a85d4cf30a45fc81eba35c02b0451be3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2

trunk/src/test/compile-fail/unboxed-closure-sugar-default.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#![feature(default_type_params, unboxed_closures)]
1515
#![allow(dead_code)]
1616

17-
struct Foo<T,U,V=T> {
18-
t: T, u: U
17+
trait Foo<T,U,V=T> {
18+
fn dummy(&self, t: T, u: U, v: V);
1919
}
2020

21-
trait Eq<X> { }
22-
impl<X> Eq<X> for X { }
23-
fn eq<A,B:Eq<A>>() { }
21+
trait Eq<Sized? X> for Sized? { }
22+
impl<Sized? X> Eq<X> for X { }
23+
fn eq<Sized? A,Sized? B>() where A : Eq<B> { }
2424

2525
fn test<'a,'b>() {
2626
// Parens are equivalent to omitting default in angle.

trunk/src/test/compile-fail/unboxed-closure-sugar-region.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717

1818
use std::kinds::marker;
1919

20-
struct Foo<'a,T,U> {
21-
t: T,
22-
u: U,
23-
m: marker::InvariantLifetime<'a>
20+
trait Foo<'a,T,U> {
21+
fn dummy(&'a self) -> &'a (T,U);
2422
}
2523

26-
trait Eq<X> { }
27-
impl<X> Eq<X> for X { }
28-
fn eq<A,B:Eq<A>>() { }
24+
trait Eq<Sized? X> for Sized? { }
25+
impl<Sized? X> Eq<X> for X { }
26+
fn eq<Sized? A,Sized? B:Eq<A>>() { }
27+
2928
fn same_type<A,B:Eq<A>>(a: A, b: B) { }
3029

3130
fn test<'a,'b>() {
@@ -34,10 +33,10 @@ fn test<'a,'b>() {
3433

3534
// Here we specify 'static explicitly in angle-bracket version.
3635
// Parenthesized winds up getting inferred.
37-
eq::< Foo<'static, (int,),()>, Foo(int) >();
36+
eq::< Foo<'static, (int,),()>, Foo(int) >();
3837
}
3938

40-
fn test2(x: Foo<(int,),()>, y: Foo(int)) {
39+
fn test2(x: &Foo<(int,),()>, y: &Foo(int)) {
4140
// Here, the omitted lifetimes are expanded to distinct things.
4241
same_type(x, y) //~ ERROR cannot infer
4342
}

trunk/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
struct One<A>;
1211
#![feature(unboxed_closures)]
1312

14-
fn foo(_: One()) //~ ERROR wrong number of type arguments
13+
trait One<A> { fn foo(&self) -> A; }
14+
15+
fn foo(_: &One()) //~ ERROR wrong number of type arguments
1516
{}
1617

1718
fn main() { }

trunk/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
struct Three<A,B,C>;
1211
#![feature(unboxed_closures)]
1312

14-
fn foo(_: Three()) //~ ERROR wrong number of type arguments
13+
trait Three<A,B,C> { fn dummy(&self) -> (A,B,C); }
14+
15+
fn foo(_: &Three()) //~ ERROR wrong number of type arguments
1516
{}
1617

1718
fn main() { }

trunk/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
struct Zero;
1211
#![feature(unboxed_closures)]
1312

13+
trait Zero { fn dummy(&self); }
14+
1415
fn foo(_: Zero()) //~ ERROR wrong number of type arguments
1516
{}
1617

trunk/src/test/run-pass/unboxed-closures-sugar-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
#![allow(dead_code)]
1717

18-
struct Foo<T,U> {
19-
t: T, u: U
18+
trait Foo<T,U> {
19+
fn dummy(&self) -> (T,U);
2020
}
2121

2222
trait Eq<X> { }

0 commit comments

Comments
 (0)