]> git.lizzy.rs Git - rust.git/commitdiff
Update test error messages based on changes to wfcheck; also, break
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Aug 2015 18:20:27 +0000 (14:20 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Aug 2015 21:58:58 +0000 (17:58 -0400)
apart the tests that tested many things at once.

22 files changed:
src/test/compile-fail/issue-16747.rs
src/test/compile-fail/issue-19380.rs
src/test/compile-fail/object-safety-issue-22040.rs
src/test/compile-fail/regions-enum-not-wf.rs
src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-enum.rs [deleted file]
src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs [new file with mode: 0644]
src/test/compile-fail/regions-outlives-nominal-type-struct.rs [deleted file]
src/test/compile-fail/regions-struct-not-wf.rs
src/test/compile-fail/regions-wf-trait-object.rs
src/test/compile-fail/wf-array-elem-sized.rs
src/test/compile-fail/wf-enum-fields-struct-variant.rs [new file with mode: 0644]
src/test/compile-fail/wf-enum-fields.rs
src/test/compile-fail/wf-in-fn-type-static.rs
src/test/compile-fail/wf-in-obj-type-static.rs
src/test/compile-fail/wf-outlives-ty-in-fn-or-trait.rs

index a3529c9ea90b671d21d9274c51166f826da4aa34..dd7e8a869eca9c3c9d0119f70a03cf281aed76e4 100644 (file)
@@ -15,10 +15,10 @@ trait ListItem<'a> {
 trait Collection { fn len(&self) -> usize; }
 
 struct List<'a, T: ListItem<'a>> {
+    slice: &'a [T]
 //~^ ERROR the parameter type `T` may not live long enough
 //~| HELP consider adding an explicit lifetime bound
 //~| NOTE ...so that the reference type `&'a [T]` does not outlive the data it points at
-    slice: &'a [T]
 }
 impl<'a, T: ListItem<'a>> Collection for List<'a, T> {
     fn len(&self) -> usize {
index e24e6bbeb7bbac40954121f8b4d7a1a18258d118..aae77c90b6bf2980e9820ae9fe0d9e363d3c59c1 100644 (file)
@@ -18,11 +18,11 @@ fn qiz() {}
 }
 
 struct Bar {
-//~^ ERROR E0038
   foos: &'static [&'static (Qiz + 'static)]
 }
 
 const FOO : Foo = Foo;
 const BAR : Bar = Bar { foos: &[&FOO]};
+//~^ ERROR E0038
 
 fn main() { }
index f49ed42fe44d0022bc132a65b4b75a7094b14933..de419a259a24cf4fc0efb6d21eb37bdc2af8c746 100644 (file)
@@ -18,13 +18,14 @@ trait Expr: Debug + PartialEq {
 
 //#[derive(PartialEq)]
 #[derive(Debug)]
-struct SExpr<'x> { //~ ERROR E0038
+struct SExpr<'x> {
     elements: Vec<Box<Expr+ 'x>>,
 }
 
 impl<'x> PartialEq for SExpr<'x> {
     fn eq(&self, other:&SExpr<'x>) -> bool {
         println!("L1: {} L2: {}", self.elements.len(), other.elements.len());
+        //~^ ERROR E0038
         let result = self.elements.len() == other.elements.len();
 
         println!("Got compare {}", result);
@@ -43,8 +44,8 @@ fn print_element_count(&self) {
 }
 
 fn main() {
-    let a: Box<Expr> = Box::new(SExpr::new());
-    let b: Box<Expr> = Box::new(SExpr::new());
+    let a: Box<Expr> = Box::new(SExpr::new()); //~ ERROR E0038
+    let b: Box<Expr> = Box::new(SExpr::new()); //~ ERROR E0038
 
-    assert_eq!(a , b);
+    // assert_eq!(a , b);
 }
index 3be998178722166c5c934b28b61b666226df7fd4..e21f92bc9b885947d84bc603015edeb5c1175413 100644 (file)
 
 #![allow(dead_code)]
 
-enum Ref1<'a, T> { //~ ERROR the parameter type `T` may not live long enough
-    Ref1Variant1(&'a T)
+enum Ref1<'a, T> {
+    Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
 }
 
-enum Ref2<'a, T> { //~ ERROR the parameter type `T` may not live long enough
+enum Ref2<'a, T> {
     Ref2Variant1,
-    Ref2Variant2(isize, &'a T),
+    Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
 }
 
 enum RefOk<'a, T:'a> {
@@ -26,13 +26,13 @@ enum RefOk<'a, T:'a> {
 }
 
 enum RefIndirect<'a, T> {
-        //~^ ERROR the parameter type `T` may not live long enough
     RefIndirectVariant1(isize, RefOk<'a,T>)
+        //~^ ERROR the parameter type `T` may not live long enough
 }
 
 enum RefDouble<'a, 'b, T> {
-        //~^ ERROR reference has a longer lifetime than the data
     RefDoubleVariant1(&'a &'b T)
+        //~^ ERROR reference has a longer lifetime than the data
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs b/src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs
new file mode 100644 (file)
index 0000000..db25a06
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod rev_variant_struct_region {
+    struct Foo<'a> {
+        x: fn(&'a i32),
+    }
+    enum Bar<'a,'b> {
+        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs b/src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs
new file mode 100644 (file)
index 0000000..4037570
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_region {
+    struct Foo<'a> {
+        x: &'a i32,
+    }
+    enum Bar<'a,'b> {
+        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs b/src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs
new file mode 100644 (file)
index 0000000..cc29465
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod rev_variant_struct_type {
+    struct Foo<T> {
+        x: fn(T)
+    }
+    enum Bar<'a,'b> {
+        V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs b/src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs
new file mode 100644 (file)
index 0000000..e269767
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_type {
+    struct Foo<T> {
+        x: T
+    }
+    enum Bar<'a,'b> {
+        F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum.rs b/src/test/compile-fail/regions-outlives-nominal-type-enum.rs
deleted file mode 100644 (file)
index 6fb4093..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod variant_enum_region {
-    enum Foo<'a> {
-        V { x: &'a i32 }
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<'b>
-    }
-}
-
-mod rev_variant_enum_region {
-    enum Foo<'a> {
-        V { x: fn(&'a i32) }
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<'b>
-    }
-}
-
-mod variant_enum_type {
-    enum Foo<T> {
-        V { x: T }
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<&'b i32>
-    }
-}
-
-mod rev_variant_enum_type {
-    enum Foo<T> {
-        V { x: fn(T) }
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<&'b i32>
-    }
-}
-
-#[rustc_error]
-fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs b/src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs
new file mode 100644 (file)
index 0000000..c7e6ace
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod rev_variant_struct_region {
+    struct Foo<'a> {
+        x: fn(&'a i32),
+    }
+    struct Bar<'a,'b> {
+        f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs b/src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs
new file mode 100644 (file)
index 0000000..2fe6444
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_region {
+    struct Foo<'a> {
+        x: &'a i32,
+    }
+    struct Bar<'a,'b> {
+        f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs b/src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs
new file mode 100644 (file)
index 0000000..c4b631b
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod rev_variant_struct_type {
+    struct Foo<T> {
+        x: fn(T)
+    }
+    struct Bar<'a,'b> {
+        f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs b/src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs
new file mode 100644 (file)
index 0000000..1c94894
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
+// arguments (like `'a`) outlive `'b`.
+//
+// Rule OutlivesNominalType from RFC 1214.
+
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+mod variant_struct_type {
+    struct Foo<T> {
+        x: T
+    }
+    struct Bar<'a,'b> {
+        f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
+    }
+}
+
+#[rustc_error]
+fn main() { }
diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct.rs b/src/test/compile-fail/regions-outlives-nominal-type-struct.rs
deleted file mode 100644 (file)
index fb3fddd..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod variant_struct_region {
-    struct Foo<'a> {
-        x: &'a i32,
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<'b>
-    }
-}
-
-mod rev_variant_struct_region {
-    struct Foo<'a> {
-        x: fn(&'a i32),
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<'b>
-    }
-}
-
-mod variant_struct_type {
-    struct Foo<T> {
-        x: T
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<&'b i32>
-    }
-}
-
-mod rev_variant_struct_type {
-    struct Foo<T> {
-        x: fn(T)
-    }
-    struct Bar<'a,'b> { //~ ERROR reference has a longer lifetime
-        f: &'a Foo<&'b i32>
-    }
-}
-
-#[rustc_error]
-fn main() { }
index 17831266f7e134595fe28cd069685f8aa483c287..a7f1828970324868631255e73dceb297df9575bb 100644 (file)
@@ -13,8 +13,8 @@
 #![allow(dead_code)]
 
 struct Ref<'a, T> {
-        //~^ ERROR the parameter type `T` may not live long enough
     field: &'a T
+        //~^ ERROR the parameter type `T` may not live long enough
 }
 
 struct RefOk<'a, T:'a> {
@@ -22,13 +22,13 @@ struct RefOk<'a, T:'a> {
 }
 
 struct RefIndirect<'a, T> {
-        //~^ ERROR the parameter type `T` may not live long enough
     field: RefOk<'a, T>
+        //~^ ERROR the parameter type `T` may not live long enough
 }
 
 struct DoubleRef<'a, 'b, T> {
-        //~^ ERROR reference has a longer lifetime than the data it references
     field: &'a &'b T
+        //~^ ERROR reference has a longer lifetime than the data it references
 }
 
 fn main() { }
index 2ad1163052b37170ca373223bf571132ceb735dd..e1f1fdaeb341d5bbcb10469de482e124e9d9ebf0 100644 (file)
@@ -14,8 +14,8 @@
 trait TheTrait<'t>: 't { }
 
 struct Foo<'a,'b> {
-        //~^ ERROR lifetime bound not satisfied
     x: Box<TheTrait<'a>+'b>
+        //~^ ERROR reference has a longer lifetime
 }
 
 fn main() { }
index aaae41c766762faedb68c2958c15891eada5bbb6..c8b7f35b3aa58355940f5201b3f79a2fab0c7f20 100644 (file)
@@ -13,8 +13,8 @@
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
-struct Foo { //~ WARN E0277
-    foo: [[u8]],
+struct Foo {
+    foo: [[u8]], //~ WARN E0277
 }
 
 #[rustc_error]
diff --git a/src/test/compile-fail/wf-enum-fields-struct-variant.rs b/src/test/compile-fail/wf-enum-fields-struct-variant.rs
new file mode 100644 (file)
index 0000000..5eb53e7
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that we check struct fields for WFedness.
+
+#![feature(associated_type_defaults)]
+#![feature(rustc_attrs)]
+#![allow(dead_code)]
+
+struct IsCopy<T:Copy> {
+    value: T
+}
+
+enum AnotherEnum<A> {
+    AnotherVariant {
+        f: IsCopy<A> //~ ERROR E0277
+    }
+}
+
+#[rustc_error]
+fn main() { }
index 40a939350822b79a56d5bb806cb490cf70e2bb77..76ad40f845768280ca2b39a22d1d43aa8efcdea0 100644 (file)
@@ -22,11 +22,5 @@ enum SomeEnum<A> {
     SomeVariant(IsCopy<A>) //~ ERROR E0277
 }
 
-enum AnotherEnum<A> { //~ ERROR E0277
-    AnotherVariant {
-        f: IsCopy<A>
-    }
-}
-
 #[rustc_error]
 fn main() { }
index 08853c69d6dacd04859a5ac901711618edb55e9f..593c9435f6c751dc607575a58e2018a826507442 100644 (file)
@@ -18,12 +18,12 @@ struct MustBeCopy<T:Copy> {
     t: T
 }
 
-struct Foo<T> { //~ WARN E0310
+struct Foo<T> {
     // needs T: 'static
     x: fn() -> &'static T //~ WARN E0310
 }
 
-struct Bar<T> { //~ WARN E0310
+struct Bar<T> {
     // needs T: Copy
     x: fn(&'static T) //~ WARN E0310
 }
index 36c8f5be308c51f856b7655bef00429a5221fe54..c697dfd50ad471c3b9add3da74dfd81b82e08878 100644 (file)
@@ -19,7 +19,7 @@ struct MustBeCopy<T:Copy> {
     t: T
 }
 
-struct Foo<T> { //~ WARN E0310
+struct Foo<T> {
     // needs T: 'static
     x: Object<&'static T> //~ WARN E0310
 }
index eca128f4a1380219035a8df2436676c424960895..dc0cbeff153a96c66447e498e5c566b7801918ff 100644 (file)
 trait Trait<T> { }
 
 struct Foo<'a,T> {
-    //~^ WARN E0309
     f: &'a fn(T),
     //~^ WARN E0309
 }
 
 struct Bar<'a,T> {
-    //~^ WARN E0309
     f: &'a Trait<T>,
     //~^ WARN E0309
 }