about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-08-07 13:23:11 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-08-12 17:58:57 -0400
commitdee8b54b71e6cb8145fc00b64f35c736a70c6bcf (patch)
treeb20a15ef0e8b755f886b5ce68eb9660636b025b9
parentf4aaedb51e47022cdd6c8857976e209e9d135e3f (diff)
downloadrust-dee8b54b71e6cb8145fc00b64f35c736a70c6bcf.tar.gz
rust-dee8b54b71e6cb8145fc00b64f35c736a70c6bcf.zip
Fallout in tests --- misc error message changes, WF fixes
-rw-r--r--src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs4
-rw-r--r--src/test/compile-fail/issue-18389.rs5
-rw-r--r--src/test/compile-fail/issue-20005.rs1
-rw-r--r--src/test/compile-fail/issue-23041.rs3
-rw-r--r--src/test/compile-fail/issue-24013.rs2
-rw-r--r--src/test/compile-fail/issue-3907-2.rs3
-rw-r--r--src/test/compile-fail/kindck-inherited-copy-bound.rs4
-rw-r--r--src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs2
-rw-r--r--src/test/compile-fail/regions-close-object-into-object-1.rs2
-rw-r--r--src/test/compile-fail/regions-close-object-into-object-2.rs2
-rw-r--r--src/test/compile-fail/regions-close-object-into-object-3.rs2
-rw-r--r--src/test/compile-fail/regions-close-object-into-object-4.rs2
-rw-r--r--src/test/compile-fail/regions-close-object-into-object-5.rs11
-rw-r--r--src/test/compile-fail/regions-enum-not-wf.rs6
-rw-r--r--src/test/compile-fail/regions-outlives-projection-container-wc.rs3
-rw-r--r--src/test/compile-fail/regions-outlives-projection-container.rs2
-rw-r--r--src/test/compile-fail/regions-struct-not-wf.rs9
-rw-r--r--src/test/compile-fail/trait-object-safety.rs3
-rw-r--r--src/test/compile-fail/trait-test-2.rs6
-rw-r--r--src/test/compile-fail/traits-negative-impls.rs15
-rw-r--r--src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs3
-rw-r--r--src/test/compile-fail/variance-regions-direct.rs4
-rw-r--r--src/test/run-pass/issue-14254.rs2
-rw-r--r--src/test/run-pass/issue-5708.rs2
24 files changed, 64 insertions, 34 deletions
diff --git a/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs b/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs
index d27529bad43..16ed73e9095 100644
--- a/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs
+++ b/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs
@@ -12,7 +12,9 @@ fn bar<F>(blk: F) where F: FnOnce() + 'static {
 }
 
 fn foo(x: &()) {
-    bar(|| { //~ ERROR cannot infer an appropriate lifetime
+    bar(|| {
+        //~^ ERROR cannot infer
+        //~| ERROR does not fulfill
         let _ = x;
     })
 }
diff --git a/src/test/compile-fail/issue-18389.rs b/src/test/compile-fail/issue-18389.rs
index 41be78dd7b9..7d95082079f 100644
--- a/src/test/compile-fail/issue-18389.rs
+++ b/src/test/compile-fail/issue-18389.rs
@@ -11,10 +11,7 @@
 use std::any::Any;
 use std::any::TypeId;
 
-pub trait Pt {}
-pub trait Rt {}
-
-trait Private<P: Pt, R: Rt> {
+trait Private<P, R> {
     fn call(&self, p: P, r: R);
 }
 pub trait Public: Private< //~ ERROR private trait in exported type parameter bound
diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs
index d91479a2e4e..041289c2ccd 100644
--- a/src/test/compile-fail/issue-20005.rs
+++ b/src/test/compile-fail/issue-20005.rs
@@ -19,6 +19,7 @@ trait To {
         self //~ error: the trait `core::marker::Sized` is not implemented
     ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
         From::from( //~ error: the trait `core::marker::Sized` is not implemented
+            //~^ ERROR E0277
             self
         )
     }
diff --git a/src/test/compile-fail/issue-23041.rs b/src/test/compile-fail/issue-23041.rs
index 68895759c5c..c08cdd72b38 100644
--- a/src/test/compile-fail/issue-23041.rs
+++ b/src/test/compile-fail/issue-23041.rs
@@ -13,6 +13,5 @@ fn main()
 {
     fn bar(x:i32) ->i32 { 3*x };
     let b:Box<Any> = Box::new(bar as fn(_)->_);
-    b.downcast_ref::<fn(_)->_>();
-    //~^ ERROR cannot determine a type for this expression: unconstrained type
+    b.downcast_ref::<fn(_)->_>(); //~ ERROR E0101
 }
diff --git a/src/test/compile-fail/issue-24013.rs b/src/test/compile-fail/issue-24013.rs
index 0adad8a88cb..df857a2e6eb 100644
--- a/src/test/compile-fail/issue-24013.rs
+++ b/src/test/compile-fail/issue-24013.rs
@@ -13,5 +13,5 @@ fn main() {
     let a = 1;
     let b = 2;
     unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
-    //~^ ERROR cannot determine a type for this expression: unconstrained type
+    //~^ ERROR unable to infer enough type information about `_`
 }
diff --git a/src/test/compile-fail/issue-3907-2.rs b/src/test/compile-fail/issue-3907-2.rs
index 9a166a6752b..ee8bc7d6e29 100644
--- a/src/test/compile-fail/issue-3907-2.rs
+++ b/src/test/compile-fail/issue-3907-2.rs
@@ -17,6 +17,7 @@ struct S {
     name: isize
 }
 
-fn bar(_x: Foo) {} //~ ERROR the trait `core::marker::Sized` is not implemented
+fn bar(_x: Foo) {}
+//~^ ERROR E0277
 
 fn main() {}
diff --git a/src/test/compile-fail/kindck-inherited-copy-bound.rs b/src/test/compile-fail/kindck-inherited-copy-bound.rs
index 066590252a5..0731fbaf01c 100644
--- a/src/test/compile-fail/kindck-inherited-copy-bound.rs
+++ b/src/test/compile-fail/kindck-inherited-copy-bound.rs
@@ -31,7 +31,9 @@ fn a() {
 fn b() {
     let x: Box<_> = box 3;
     let y = &x;
-    let z = &x as &Foo; //~ ERROR E0038
+    let z = &x as &Foo;
+    //~^ ERROR E0038
+    //~| ERROR E0038
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs b/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs
index 9a13541bd0b..f2ff877cd82 100644
--- a/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs
+++ b/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs
@@ -47,7 +47,7 @@ fn with_assoc<'a,'b>() {
     // outlive 'a. In this case, that means TheType<'b>::TheAssocType,
     // which is &'b (), must outlive 'a.
 
-    let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR cannot infer
+    let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime
 }
 
 fn main() {
diff --git a/src/test/compile-fail/regions-close-object-into-object-1.rs b/src/test/compile-fail/regions-close-object-into-object-1.rs
index 5472e09ba4b..5d9818d624b 100644
--- a/src/test/compile-fail/regions-close-object-into-object-1.rs
+++ b/src/test/compile-fail/regions-close-object-into-object-1.rs
@@ -12,7 +12,7 @@
 #![allow(warnings)]
 
 trait A<T> { }
-struct B<'a, T>(&'a (A<T>+'a));
+struct B<'a, T:'a>(&'a (A<T>+'a));
 
 trait X { }
 
diff --git a/src/test/compile-fail/regions-close-object-into-object-2.rs b/src/test/compile-fail/regions-close-object-into-object-2.rs
index 1ef000852d5..6cef9956655 100644
--- a/src/test/compile-fail/regions-close-object-into-object-2.rs
+++ b/src/test/compile-fail/regions-close-object-into-object-2.rs
@@ -11,7 +11,7 @@
 #![feature(box_syntax)]
 
 trait A<T> { }
-struct B<'a, T>(&'a (A<T>+'a));
+struct B<'a, T:'a>(&'a (A<T>+'a));
 
 trait X { }
 impl<'a, T> X for B<'a, T> {}
diff --git a/src/test/compile-fail/regions-close-object-into-object-3.rs b/src/test/compile-fail/regions-close-object-into-object-3.rs
index b7dc759b271..3004245b15a 100644
--- a/src/test/compile-fail/regions-close-object-into-object-3.rs
+++ b/src/test/compile-fail/regions-close-object-into-object-3.rs
@@ -12,7 +12,7 @@
 #![allow(warnings)]
 
 trait A<T> { }
-struct B<'a, T>(&'a (A<T>+'a));
+struct B<'a, T:'a>(&'a (A<T>+'a));
 
 trait X { }
 impl<'a, T> X for B<'a, T> {}
diff --git a/src/test/compile-fail/regions-close-object-into-object-4.rs b/src/test/compile-fail/regions-close-object-into-object-4.rs
index 247578d253e..bc5b7b7cf78 100644
--- a/src/test/compile-fail/regions-close-object-into-object-4.rs
+++ b/src/test/compile-fail/regions-close-object-into-object-4.rs
@@ -11,7 +11,7 @@
 #![feature(box_syntax)]
 
 trait A<T> { }
-struct B<'a, T>(&'a (A<T>+'a));
+struct B<'a, T:'a>(&'a (A<T>+'a));
 
 trait X { }
 impl<'a, T> X for B<'a, T> {}
diff --git a/src/test/compile-fail/regions-close-object-into-object-5.rs b/src/test/compile-fail/regions-close-object-into-object-5.rs
index 253132e5f07..ac269a4d896 100644
--- a/src/test/compile-fail/regions-close-object-into-object-5.rs
+++ b/src/test/compile-fail/regions-close-object-into-object-5.rs
@@ -16,15 +16,22 @@ trait A<T>
     fn get(&self) -> T { panic!() }
 }
 
-struct B<'a, T>(&'a (A<T>+'a));
+struct B<'a, T:'a>(&'a (A<T>+'a));
 
 trait X { fn foo(&self) {} }
 
 impl<'a, T> X for B<'a, T> {}
 
 fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
-    box B(&*v) as Box<X> //~ ERROR the parameter type `T` may not live long enough
+    // oh dear!
+    box B(&*v) as Box<X>
         //~^ ERROR the parameter type `T` may not live long enough
+        //~| WARNING the parameter type `T` may not live long enough
+        //~| WARNING the parameter type `T` may not live long enough
+        //~| ERROR the parameter type `T` may not live long enough
+        //~| WARNING the parameter type `T` may not live long enough
+        //~| ERROR the parameter type `T` may not live long enough
+        //~| ERROR the parameter type `T` may not live long enough
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/regions-enum-not-wf.rs b/src/test/compile-fail/regions-enum-not-wf.rs
index 0165dbdabf3..3be99817872 100644
--- a/src/test/compile-fail/regions-enum-not-wf.rs
+++ b/src/test/compile-fail/regions-enum-not-wf.rs
@@ -25,11 +25,13 @@ enum RefOk<'a, T:'a> {
     RefOkVariant1(&'a T)
 }
 
-enum RefIndirect<'a, T> { //~ ERROR the parameter type `T` may not live long enough
+enum RefIndirect<'a, T> {
+        //~^ ERROR the parameter type `T` may not live long enough
     RefIndirectVariant1(isize, RefOk<'a,T>)
 }
 
-enum RefDouble<'a, 'b, T> { //~ ERROR reference has a longer lifetime than the data
+enum RefDouble<'a, 'b, T> {
+        //~^ ERROR reference has a longer lifetime than the data
     RefDoubleVariant1(&'a &'b T)
 }
 
diff --git a/src/test/compile-fail/regions-outlives-projection-container-wc.rs b/src/test/compile-fail/regions-outlives-projection-container-wc.rs
index 2ceaea98d27..71606ba812f 100644
--- a/src/test/compile-fail/regions-outlives-projection-container-wc.rs
+++ b/src/test/compile-fail/regions-outlives-projection-container-wc.rs
@@ -41,7 +41,8 @@ fn with_assoc<'a,'b>() {
     // outlive 'a. In this case, that means TheType<'b>::TheAssocType,
     // which is &'b (), must outlive 'a.
 
-    let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR cannot infer
+    let _: &'a WithAssoc<TheType<'b>> = loop { };
+    //~^ ERROR reference has a longer lifetime
 }
 
 fn main() {
diff --git a/src/test/compile-fail/regions-outlives-projection-container.rs b/src/test/compile-fail/regions-outlives-projection-container.rs
index 6f5ebf2d1ce..957e56fe510 100644
--- a/src/test/compile-fail/regions-outlives-projection-container.rs
+++ b/src/test/compile-fail/regions-outlives-projection-container.rs
@@ -45,7 +45,7 @@ fn with_assoc<'a,'b>() {
     // outlive 'a. In this case, that means TheType<'b>::TheAssocType,
     // which is &'b (), must outlive 'a.
 
-    let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR cannot infer
+    let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime
 }
 
 fn with_assoc1<'a,'b>() where 'b : 'a {
diff --git a/src/test/compile-fail/regions-struct-not-wf.rs b/src/test/compile-fail/regions-struct-not-wf.rs
index c22812c3d86..17831266f7e 100644
--- a/src/test/compile-fail/regions-struct-not-wf.rs
+++ b/src/test/compile-fail/regions-struct-not-wf.rs
@@ -12,7 +12,8 @@
 
 #![allow(dead_code)]
 
-struct Ref<'a, T> { //~ ERROR the parameter type `T` may not live long enough
+struct Ref<'a, T> {
+        //~^ ERROR the parameter type `T` may not live long enough
     field: &'a T
 }
 
@@ -20,11 +21,13 @@ struct RefOk<'a, T:'a> {
     field: &'a T
 }
 
-struct RefIndirect<'a, T> { //~ ERROR the parameter type `T` may not live long enough
+struct RefIndirect<'a, T> {
+        //~^ ERROR the parameter type `T` may not live long enough
     field: RefOk<'a, T>
 }
 
-struct DoubleRef<'a, 'b, T> { //~ ERROR reference has a longer lifetime than the data it references
+struct DoubleRef<'a, 'b, T> {
+        //~^ ERROR reference has a longer lifetime than the data it references
     field: &'a &'b T
 }
 
diff --git a/src/test/compile-fail/trait-object-safety.rs b/src/test/compile-fail/trait-object-safety.rs
index d45d13556e1..baf239f5956 100644
--- a/src/test/compile-fail/trait-object-safety.rs
+++ b/src/test/compile-fail/trait-object-safety.rs
@@ -22,5 +22,6 @@ impl Tr for St {
 }
 
 fn main() {
-    let _: &Tr = &St; //~ ERROR cannot convert to a trait object because trait `Tr` is not
+    let _: &Tr = &St; //~ ERROR E0038
+    //~^ ERROR E0038
 }
diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs
index b09b10ffa0a..b11cbde2929 100644
--- a/src/test/compile-fail/trait-test-2.rs
+++ b/src/test/compile-fail/trait-test-2.rs
@@ -17,6 +17,8 @@ impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} }
 fn main() {
     10.dup::<i32>(); //~ ERROR does not take type parameters
     10.blah::<i32, i32>(); //~ ERROR incorrect number of type parameters
-    (box 10 as Box<bar>).dup(); //~ ERROR cannot convert to a trait object
-    //~^ ERROR the trait `bar` is not implemented for the type `bar`
+    (box 10 as Box<bar>).dup();
+    //~^ ERROR E0038
+    //~| ERROR E0038
+    //~| ERROR E0277
 }
diff --git a/src/test/compile-fail/traits-negative-impls.rs b/src/test/compile-fail/traits-negative-impls.rs
index 8dc977a8e49..c37f45dcf50 100644
--- a/src/test/compile-fail/traits-negative-impls.rs
+++ b/src/test/compile-fail/traits-negative-impls.rs
@@ -32,12 +32,23 @@ fn dummy() {
 
     Outer(TestType);
     //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy::TestType`
+    //~| ERROR the trait `core::marker::Send` is not implemented for the type `dummy::TestType`
+}
+
+fn dummy1b() {
+    struct TestType;
+    impl !Send for TestType {}
 
     is_send(TestType);
-    //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy::TestType`
+    //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy1b::TestType`
+}
+
+fn dummy1c() {
+    struct TestType;
+    impl !Send for TestType {}
 
     is_send((8, TestType));
-    //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy::TestType`
+    //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy1c::TestType`
 }
 
 fn dummy2() {
diff --git a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs b/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs
index 8cc531625d1..09687724656 100644
--- a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs
+++ b/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs
@@ -22,5 +22,6 @@ impl MyAdd for i32 {
 fn main() {
     let x: i32 = 5;
     let y = x as MyAdd<i32>;
-    //~^ ERROR as `MyAdd<i32>`
+    //~^ ERROR E0038
+    //~| ERROR cast to unsized type: `i32` as `MyAdd<i32>`
 }
diff --git a/src/test/compile-fail/variance-regions-direct.rs b/src/test/compile-fail/variance-regions-direct.rs
index da4d6c75227..319b81bde36 100644
--- a/src/test/compile-fail/variance-regions-direct.rs
+++ b/src/test/compile-fail/variance-regions-direct.rs
@@ -42,7 +42,7 @@ struct Test4<'a, 'b:'a> { //~ ERROR regions=[[-, o];[];[]]
 // contravariant context:
 
 #[rustc_variance]
-struct Test5<'a, 'b> { //~ ERROR regions=[[+, o];[];[]]
+struct Test5<'a, 'b:'a> { //~ ERROR regions=[[+, o];[];[]]
     x: extern "Rust" fn(&'a mut &'b isize),
 }
 
@@ -52,7 +52,7 @@ struct Test5<'a, 'b> { //~ ERROR regions=[[+, o];[];[]]
 // argument list occurs in an invariant context.
 
 #[rustc_variance]
-struct Test6<'a, 'b> { //~ ERROR regions=[[-, o];[];[]]
+struct Test6<'a, 'b:'a> { //~ ERROR regions=[[-, o];[];[]]
     x: &'a mut extern "Rust" fn(&'b isize),
 }
 
diff --git a/src/test/run-pass/issue-14254.rs b/src/test/run-pass/issue-14254.rs
index ed96eee6ddf..9049ae0548f 100644
--- a/src/test/run-pass/issue-14254.rs
+++ b/src/test/run-pass/issue-14254.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-trait Foo {
+trait Foo: Sized {
     fn bar(&self);
     fn baz(&self) { }
     fn bah(_: Option<Self>) { }
diff --git a/src/test/run-pass/issue-5708.rs b/src/test/run-pass/issue-5708.rs
index dfb560db100..6ab33951099 100644
--- a/src/test/run-pass/issue-5708.rs
+++ b/src/test/run-pass/issue-5708.rs
@@ -52,7 +52,7 @@ pub trait MyTrait<T> {
     fn dummy(&self, t: T) -> T { panic!() }
 }
 
-pub struct MyContainer<'a, T> {
+pub struct MyContainer<'a, T:'a> {
     foos: Vec<&'a (MyTrait<T>+'a)> ,
 }