From d22f7061507e78d5b83b03f6e3cf420b9969a92c Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 24 Oct 2016 20:55:56 +0200 Subject: [PATCH] adapt existing tests --- src/test/compile-fail/issue-17025.rs | 2 ++ src/test/compile-fail/issue-5883.rs | 2 -- src/test/compile-fail/unsized-enum.rs | 7 ------- src/test/compile-fail/unsized3.rs | 17 +++-------------- src/test/run-pass/unsized2.rs | 8 +------- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/src/test/compile-fail/issue-17025.rs b/src/test/compile-fail/issue-17025.rs index 2a1a3397d54..f250103b144 100644 --- a/src/test/compile-fail/issue-17025.rs +++ b/src/test/compile-fail/issue-17025.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-test the unsized enum no longer compiles + enum A { B(char), C([Box]), diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index 019a7bdc734..e14d9f3a35c 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -20,6 +20,4 @@ fn new_struct(r: A+'static) Struct { r: r } } -trait Curve {} -enum E {X(Curve+'static)} fn main() {} diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index 61b2b01b355..5d791215f36 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -19,11 +19,4 @@ fn foo2() { not_sized::>() } // // Not OK: `T` is not sized. -enum Bar { BarSome(U), BarNone } -fn bar1() { not_sized::>() } -fn bar2() { is_sized::>() } -//~^ ERROR `T: std::marker::Sized` is not satisfied -// -// Not OK: `Bar` is not sized, but it should be. - fn main() { } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index f88165c02e9..9b6ccf22c8d 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -31,19 +31,8 @@ fn f3(x: &X) { fn f4(x: &X) { } -// Test with unsized enum. -enum E { - V(X), -} - fn f5(x: &Y) {} fn f6(x: &X) {} -fn f7(x1: &E, x2: &E) { - f5(x1); - //~^ ERROR `X: std::marker::Sized` is not satisfied - f6(x2); // ok -} - // Test with unsized struct. struct S { @@ -57,13 +46,13 @@ fn f8(x1: &S, x2: &S) { } // Test some tuples. -fn f9(x1: Box>, x2: Box>) { +fn f9(x1: Box>) { f5(&(*x1, 34)); //~^ ERROR `X: std::marker::Sized` is not satisfied } -fn f10(x1: Box>, x2: Box>) { - f5(&(32, *x2)); +fn f10(x1: Box>) { + f5(&(32, *x1)); //~^ ERROR `X: std::marker::Sized` is not satisfied } diff --git a/src/test/run-pass/unsized2.rs b/src/test/run-pass/unsized2.rs index 5b9fa5230d1..50d8d3d27f2 100644 --- a/src/test/run-pass/unsized2.rs +++ b/src/test/run-pass/unsized2.rs @@ -89,7 +89,7 @@ trait T7 { fn m2(&self, x: &T5); } -// The last field in a struct or variant may be unsized +// The last field in a struct may be unsized struct S2 { f: X, } @@ -97,12 +97,6 @@ struct S3 { f1: isize, f2: X, } -enum E { - V1(X), - V2{x: X}, - V3(isize, X), - V4{u: isize, x: X}, -} pub fn main() { }