about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-default.rs10
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-region.rs17
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs5
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs5
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs3
-rw-r--r--src/test/run-pass/unboxed-closures-sugar-1.rs4
6 files changed, 23 insertions, 21 deletions
diff --git a/src/test/compile-fail/unboxed-closure-sugar-default.rs b/src/test/compile-fail/unboxed-closure-sugar-default.rs
index d015f8195c5..06a93406392 100644
--- a/src/test/compile-fail/unboxed-closure-sugar-default.rs
+++ b/src/test/compile-fail/unboxed-closure-sugar-default.rs
@@ -14,13 +14,13 @@
 #![feature(default_type_params, unboxed_closures)]
 #![allow(dead_code)]
 
-struct Foo<T,U,V=T> {
-    t: T, u: U
+trait Foo<T,U,V=T> {
+    fn dummy(&self, t: T, u: U, v: V);
 }
 
-trait Eq<X> { }
-impl<X> Eq<X> for X { }
-fn eq<A,B:Eq<A>>() { }
+trait Eq<Sized? X> for Sized? { }
+impl<Sized? X> Eq<X> for X { }
+fn eq<Sized? A,Sized? B>() where A : Eq<B> { }
 
 fn test<'a,'b>() {
     // Parens are equivalent to omitting default in angle.
diff --git a/src/test/compile-fail/unboxed-closure-sugar-region.rs b/src/test/compile-fail/unboxed-closure-sugar-region.rs
index 9cef2d951bf..a938f126c16 100644
--- a/src/test/compile-fail/unboxed-closure-sugar-region.rs
+++ b/src/test/compile-fail/unboxed-closure-sugar-region.rs
@@ -17,15 +17,14 @@
 
 use std::kinds::marker;
 
-struct Foo<'a,T,U> {
-    t: T,
-    u: U,
-    m: marker::InvariantLifetime<'a>
+trait Foo<'a,T,U> {
+    fn dummy(&'a self) -> &'a (T,U);
 }
 
-trait Eq<X> { }
-impl<X> Eq<X> for X { }
-fn eq<A,B:Eq<A>>() { }
+trait Eq<Sized? X> for Sized? { }
+impl<Sized? X> Eq<X> for X { }
+fn eq<Sized? A,Sized? B:Eq<A>>() { }
+
 fn same_type<A,B:Eq<A>>(a: A, b: B) { }
 
 fn test<'a,'b>() {
@@ -34,10 +33,10 @@ fn test<'a,'b>() {
 
     // Here we specify 'static explicitly in angle-bracket version.
     // Parenthesized winds up getting inferred.
-    eq::< Foo<'static, (int,),()>,               Foo(int)                      >();
+    eq::< Foo<'static, (int,),()>,      Foo(int)                      >();
 }
 
-fn test2(x: Foo<(int,),()>, y: Foo(int)) {
+fn test2(x: &Foo<(int,),()>, y: &Foo(int)) {
     // Here, the omitted lifetimes are expanded to distinct things.
     same_type(x, y) //~ ERROR cannot infer
 }
diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs
index 5e3ebc70b86..d9efab974d8 100644
--- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs
+++ b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs
@@ -8,10 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct One<A>;
 #![feature(unboxed_closures)]
 
-fn foo(_: One()) //~ ERROR wrong number of type arguments
+trait One<A> { fn foo(&self) -> A; }
+
+fn foo(_: &One()) //~ ERROR wrong number of type arguments
 {}
 
 fn main() { }
diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs
index c34f55ed4f9..dcfcb7d4772 100644
--- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs
+++ b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs
@@ -8,10 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct Three<A,B,C>;
 #![feature(unboxed_closures)]
 
-fn foo(_: Three()) //~ ERROR wrong number of type arguments
+trait Three<A,B,C> { fn dummy(&self) -> (A,B,C); }
+
+fn foo(_: &Three()) //~ ERROR wrong number of type arguments
 {}
 
 fn main() { }
diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs
index f7ff53310b0..a8ac62444aa 100644
--- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs
+++ b/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs
@@ -8,9 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct Zero;
 #![feature(unboxed_closures)]
 
+trait Zero { fn dummy(&self); }
+
 fn foo(_: Zero()) //~ ERROR wrong number of type arguments
 {}
 
diff --git a/src/test/run-pass/unboxed-closures-sugar-1.rs b/src/test/run-pass/unboxed-closures-sugar-1.rs
index b358e7ce288..edcb85006ca 100644
--- a/src/test/run-pass/unboxed-closures-sugar-1.rs
+++ b/src/test/run-pass/unboxed-closures-sugar-1.rs
@@ -15,8 +15,8 @@
 
 #![allow(dead_code)]
 
-struct Foo<T,U> {
-    t: T, u: U
+trait Foo<T,U> {
+    fn dummy(&self) -> (T,U);
 }
 
 trait Eq<X> { }