diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-11-20 15:08:02 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-11-26 11:42:06 -0500 |
| commit | f4e29e7e9aa1da4fc91a6074b0e4df44a2986517 (patch) | |
| tree | 0da944aff45bf45cd6e085b92aa78110d62cfb20 /src/test/compile-fail | |
| parent | 74a1041a4d7ae08d223f5ec623f6a698962d5667 (diff) | |
| download | rust-f4e29e7e9aa1da4fc91a6074b0e4df44a2986517.tar.gz rust-f4e29e7e9aa1da4fc91a6074b0e4df44a2986517.zip | |
Fixup various places that were doing `&T+'a` and do `&(T+'a)`
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/dst-index.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-12470.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-14285.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-copy.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-send-object.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-send-object1.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-send-object2.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/region-object-lifetime-1.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-bounded-by-send.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-close-object-into-object.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-trait-variance.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-not-on-impl.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-not-on-struct.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-sugar.rs | 4 |
14 files changed, 21 insertions, 21 deletions
diff --git a/src/test/compile-fail/dst-index.rs b/src/test/compile-fail/dst-index.rs index 542562b69e6..f6511d68662 100644 --- a/src/test/compile-fail/dst-index.rs +++ b/src/test/compile-fail/dst-index.rs @@ -25,7 +25,7 @@ impl Index<uint, str> for S { struct T; impl Index<uint, Show + 'static> for T { - fn index<'a>(&'a self, idx: &uint) -> &'a Show + 'static { + fn index<'a>(&'a self, idx: &uint) -> &'a (Show + 'static) { static x: uint = 42; &x } diff --git a/src/test/compile-fail/issue-12470.rs b/src/test/compile-fail/issue-12470.rs index aa7e3cd3739..0202d538cf6 100644 --- a/src/test/compile-fail/issue-12470.rs +++ b/src/test/compile-fail/issue-12470.rs @@ -24,7 +24,7 @@ impl X for B { } struct A<'a> { - p: &'a X+'a + p: &'a (X+'a) } fn make_a<'a>(p: &'a X) -> A<'a> { diff --git a/src/test/compile-fail/issue-14285.rs b/src/test/compile-fail/issue-14285.rs index 624ddf0c8bb..cbf4412a81d 100644 --- a/src/test/compile-fail/issue-14285.rs +++ b/src/test/compile-fail/issue-14285.rs @@ -14,7 +14,7 @@ struct A; impl Foo for A {} -struct B<'a>(&'a Foo+'a); +struct B<'a>(&'a (Foo+'a)); fn foo<'a>(a: &Foo) -> B<'a> { B(a) //~ ERROR cannot infer an appropriate lifetime diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs index 499144698fb..202529c30b3 100644 --- a/src/test/compile-fail/kindck-copy.rs +++ b/src/test/compile-fail/kindck-copy.rs @@ -44,15 +44,15 @@ fn test<'a,T,U:Copy>(_: &'a int) { // borrowed object types are generally ok assert_copy::<&'a Dummy>(); - assert_copy::<&'a Dummy+Copy>(); - assert_copy::<&'static Dummy+Copy>(); + assert_copy::<&'a (Dummy+Copy)>(); + assert_copy::<&'static (Dummy+Copy)>(); // owned object types are not ok assert_copy::<Box<Dummy>>(); //~ ERROR `core::kinds::Copy` is not implemented assert_copy::<Box<Dummy+Copy>>(); //~ ERROR `core::kinds::Copy` is not implemented // mutable object types are not ok - assert_copy::<&'a mut Dummy+Copy>(); //~ ERROR `core::kinds::Copy` is not implemented + assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::kinds::Copy` is not implemented // closures are like an `&mut` object assert_copy::<||>(); //~ ERROR `core::kinds::Copy` is not implemented diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/compile-fail/kindck-send-object.rs index 9217d05002d..4fbb3eab8c4 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/compile-fail/kindck-send-object.rs @@ -19,7 +19,7 @@ trait Message : Send { } // careful with object types, who knows what they close over... fn object_ref_with_static_bound_not_ok() { - assert_send::<&'static Dummy+'static>(); + assert_send::<&'static (Dummy+'static)>(); //~^ ERROR the trait `core::kinds::Send` is not implemented } @@ -36,7 +36,7 @@ fn closure_with_no_bound_not_ok<'a>() { } fn object_with_send_bound_ok() { - assert_send::<&'static Dummy+Send>(); + assert_send::<&'static (Dummy+Send)>(); assert_send::<Box<Dummy+Send>>(); assert_send::<proc():Send>; assert_send::<||:Send>; diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/compile-fail/kindck-send-object1.rs index ff8daa045c6..a5519753643 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/compile-fail/kindck-send-object1.rs @@ -21,13 +21,13 @@ fn test51<'a>() { //~^ ERROR the trait `core::kinds::Send` is not implemented } fn test52<'a>() { - assert_send::<&'a Dummy+Send>(); + assert_send::<&'a (Dummy+Send)>(); //~^ ERROR does not fulfill the required lifetime } // ...unless they are properly bounded fn test60() { - assert_send::<&'static Dummy+Send>(); + assert_send::<&'static (Dummy+Send)>(); } fn test61() { assert_send::<Box<Dummy+Send>>(); diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/compile-fail/kindck-send-object2.rs index d46c6e68c05..ea8c2628306 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/compile-fail/kindck-send-object2.rs @@ -23,7 +23,7 @@ fn test53() { // ...unless they are properly bounded fn test60() { - assert_send::<&'static Dummy+Send>(); + assert_send::<&'static (Dummy+Send)>(); } fn test61() { assert_send::<Box<Dummy+Send>>(); diff --git a/src/test/compile-fail/region-object-lifetime-1.rs b/src/test/compile-fail/region-object-lifetime-1.rs index 01daeb628ef..4758ce71fff 100644 --- a/src/test/compile-fail/region-object-lifetime-1.rs +++ b/src/test/compile-fail/region-object-lifetime-1.rs @@ -28,14 +28,14 @@ fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { // Borrowed receiver with two distinct lifetimes, but we know that // 'b:'a, hence &'a () is permitted. -fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a Foo+'b) -> &'a () { +fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () { x.borrowed() } // Here we have two distinct lifetimes, but we try to return a pointer // with the longer lifetime when (from the signature) we only know // that it lives as long as the shorter lifetime. Therefore, error. -fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a Foo+'b) -> &'b () { +fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () { x.borrowed() //~ ERROR cannot infer } diff --git a/src/test/compile-fail/regions-bounded-by-send.rs b/src/test/compile-fail/regions-bounded-by-send.rs index 182b40ceaae..660a9be4f63 100644 --- a/src/test/compile-fail/regions-bounded-by-send.rs +++ b/src/test/compile-fail/regions-bounded-by-send.rs @@ -57,12 +57,12 @@ fn box_with_region_not_ok<'a>() { // objects with insufficient bounds no ok fn object_with_random_bound_not_ok<'a>() { - assert_send::<&'a Dummy+'a>(); + assert_send::<&'a (Dummy+'a)>(); //~^ ERROR not implemented } fn object_with_send_bound_not_ok<'a>() { - assert_send::<&'a Dummy+Send>(); + assert_send::<&'a (Dummy+Send)>(); //~^ ERROR does not fulfill } diff --git a/src/test/compile-fail/regions-close-object-into-object.rs b/src/test/compile-fail/regions-close-object-into-object.rs index 835c55c9bd1..48945868bd3 100644 --- a/src/test/compile-fail/regions-close-object-into-object.rs +++ b/src/test/compile-fail/regions-close-object-into-object.rs @@ -10,7 +10,7 @@ trait A<T> {} -struct B<'a, T>(&'a A<T>+'a); +struct B<'a, T>(&'a (A<T>+'a)); trait X {} impl<'a, T> X for B<'a, T> {} diff --git a/src/test/compile-fail/regions-trait-variance.rs b/src/test/compile-fail/regions-trait-variance.rs index 3ceb4e3fef6..4e31a41c4e0 100644 --- a/src/test/compile-fail/regions-trait-variance.rs +++ b/src/test/compile-fail/regions-trait-variance.rs @@ -31,7 +31,7 @@ impl Drop for B { } struct A<'r> { - p: &'r X+'r + p: &'r (X+'r) } fn make_a(p:&X) -> A { diff --git a/src/test/compile-fail/trait-bounds-not-on-impl.rs b/src/test/compile-fail/trait-bounds-not-on-impl.rs index 38c78144601..a034352c4a6 100644 --- a/src/test/compile-fail/trait-bounds-not-on-impl.rs +++ b/src/test/compile-fail/trait-bounds-not-on-impl.rs @@ -13,7 +13,7 @@ trait Foo { struct Bar; -impl Foo + Owned for Bar { //~ ERROR bounded traits are only valid in type position +impl Foo + Owned for Bar { //~ ERROR not a trait } fn main() { } diff --git a/src/test/compile-fail/trait-bounds-not-on-struct.rs b/src/test/compile-fail/trait-bounds-not-on-struct.rs index 0a5909ff2ef..081efa429c3 100644 --- a/src/test/compile-fail/trait-bounds-not-on-struct.rs +++ b/src/test/compile-fail/trait-bounds-not-on-struct.rs @@ -11,6 +11,6 @@ struct Foo; -fn foo(_x: Box<Foo + Send>) { } //~ ERROR kind bounds can only be used on trait types +fn foo(_x: Box<Foo + Send>) { } //~ ERROR expected a reference to a trait fn main() { } diff --git a/src/test/compile-fail/trait-bounds-sugar.rs b/src/test/compile-fail/trait-bounds-sugar.rs index 7ed8db4fcd2..4da496621d1 100644 --- a/src/test/compile-fail/trait-bounds-sugar.rs +++ b/src/test/compile-fail/trait-bounds-sugar.rs @@ -16,14 +16,14 @@ trait Foo {} fn a(_x: Box<Foo+Send>) { } -fn b(_x: &'static Foo+'static) { +fn b(_x: &'static (Foo+'static)) { } fn c(x: Box<Foo+Sync>) { a(x); //~ ERROR mismatched types } -fn d(x: &'static Foo+Sync) { +fn d(x: &'static (Foo+Sync)) { b(x); //~ ERROR cannot infer //~^ ERROR mismatched types } |
