]> git.lizzy.rs Git - rust.git/commitdiff
Fallout in tests --- misc error message changes, WF fixes
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 7 Aug 2015 17:23:11 +0000 (13:23 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Aug 2015 21:58:57 +0000 (17:58 -0400)
24 files changed:
src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs
src/test/compile-fail/issue-18389.rs
src/test/compile-fail/issue-20005.rs
src/test/compile-fail/issue-23041.rs
src/test/compile-fail/issue-24013.rs
src/test/compile-fail/issue-3907-2.rs
src/test/compile-fail/kindck-inherited-copy-bound.rs
src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs
src/test/compile-fail/regions-close-object-into-object-1.rs
src/test/compile-fail/regions-close-object-into-object-2.rs
src/test/compile-fail/regions-close-object-into-object-3.rs
src/test/compile-fail/regions-close-object-into-object-4.rs
src/test/compile-fail/regions-close-object-into-object-5.rs
src/test/compile-fail/regions-enum-not-wf.rs
src/test/compile-fail/regions-outlives-projection-container-wc.rs
src/test/compile-fail/regions-outlives-projection-container.rs
src/test/compile-fail/regions-struct-not-wf.rs
src/test/compile-fail/trait-object-safety.rs
src/test/compile-fail/trait-test-2.rs
src/test/compile-fail/traits-negative-impls.rs
src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs
src/test/compile-fail/variance-regions-direct.rs
src/test/run-pass/issue-14254.rs
src/test/run-pass/issue-5708.rs

index d27529bad43052b776fc8702005e62cd1c01425d..16ed73e9095e4381d9f38acf362c7798aff8180e 100644 (file)
@@ -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;
     })
 }
index 41be78dd7b96eede5f0c9aa46bf702cad8fe9ca1..7d95082079f9f13bb2450dfa69024265ef6c44d3 100644 (file)
 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
index d91479a2e4e896169cb34c90d2624b69d06e589e..041289c2ccdbdb4af3393b0e526e89c61cf3e6f4 100644 (file)
@@ -19,6 +19,7 @@ fn to<Dst>(
         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
         )
     }
index 68895759c5c2ad5b0b389fbe21361b529d3108ff..c08cdd72b38258e74645ed96d7fc4a9b1ce3f941 100644 (file)
@@ -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
 }
index 0adad8a88cbc9a9a245617059418d559c58e8a2a..df857a2e6eb1f9766a2cefabd0234aedf1b275dc 100644 (file)
@@ -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 `_`
 }
index 9a166a6752b7e8a22680725592357baa8824196d..ee8bc7d6e290103ccfd30543c9db1f45e59a389e 100644 (file)
@@ -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() {}
index 066590252a54ad769fcb599e94f616d25770b598..0731fbaf01c4306152b16a556ffdc07ae2effb16 100644 (file)
@@ -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() { }
index 9a13541bd0b17a761997824f3b0f5d0f3fcdd757..f2ff877cd8236dc3f1cd6078c79ca6b4c0d3f8a1 100644 (file)
@@ -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() {
index 5472e09ba4be4b95f429820521c2878768ce0b11..5d9818d624b7e273e729db38af14ee17bd586a4b 100644 (file)
@@ -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 { }
 
index 1ef000852d561c2aa65c7c8d0af14b02373f6aab..6cef9956655175019e34e9537d972b17d2eb4951 100644 (file)
@@ -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> {}
index b7dc759b2717f6c12f86a2fab99d3a61af190a7d..3004245b15a24438397847458251434a5ce00a2d 100644 (file)
@@ -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> {}
index 247578d253ea0fc1961dff65b32eabf2e073326c..bc5b7b7cf7874325fdce0825a4e45a9638708e1f 100644 (file)
@@ -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> {}
index 253132e5f07d02ed93ea98fcb613cb440934a750..ac269a4d896f2566bbe0600366e7590d602a5d62 100644 (file)
@@ -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() {}
index 0165dbdabf3c23a2525c87a0998905d73be2c7f8..3be998178722166c5c934b28b61b666226df7fd4 100644 (file)
@@ -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)
 }
 
index 2ceaea98d279703f89aaf873deed387fca41e601..71606ba812fac10b6bfeff57b08cc92220f1cd0c 100644 (file)
@@ -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() {
index 6f5ebf2d1cecf3b246d983821729ce088939d03b..957e56fe5109fed65344c54614d0b9b869c14cd2 100644 (file)
@@ -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 {
index c22812c3d86dc9e687784304428ec04c0e642b62..17831266f7e134595fe28cd069685f8aa483c287 100644 (file)
@@ -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
 }
 
index d45d13556e12188b91d70f2a21cca6aa1a057c5b..baf239f5956d645b924686b0903e290d9c6b05de 100644 (file)
@@ -22,5 +22,6 @@ fn foo() {}
 }
 
 fn main() {
-    let _: &Tr = &St; //~ ERROR cannot convert to a trait object because trait `Tr` is not
+    let _: &Tr = &St; //~ ERROR E0038
+    //~^ ERROR E0038
 }
index b09b10ffa0aad9dc22572e47f9348b44d7d7e7ac..b11cbde292969018ae9ec870d9b2be0895ad83e9 100644 (file)
@@ -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
 }
index 8dc977a8e490bf3aa213e447e39046e2e2e681c5..c37f45dcf50bb8911f9c3f6a140162942ebe9c15 100644 (file)
@@ -32,12 +32,23 @@ impl !Send for TestType {}
 
     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() {
index 8cc531625d17956c0d01223736884c2601774dc1..09687724656fa8febe373f1f01ed750e45efed27 100644 (file)
@@ -22,5 +22,6 @@ fn add(&self, other: &i32) -> i32 { *self + *other }
 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>`
 }
index da4d6c75227fc609bba453dd222f52638b945fe2..319b81bde36ed02bb556fca7367e5ca80a6e49d8 100644 (file)
@@ -42,7 +42,7 @@
 // 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 @@
 // 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),
 }
 
index ed96eee6ddffb8072487b6d4b0c5f88d167dfad9..9049ae0548fa92dac36125bbf0f48b1352adb6b4 100644 (file)
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-trait Foo {
+trait Foo: Sized {
     fn bar(&self);
     fn baz(&self) { }
     fn bah(_: Option<Self>) { }
index dfb560db10067f4c81fec2133926622f4f160bfb..6ab339510991510e54c2e61feb1fc564cab9d970 100644 (file)
@@ -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)> ,
 }