Skip to content

Commit d22f706

Browse files
committed
adapt existing tests
1 parent f169523 commit d22f706

File tree

5 files changed

+6
-30
lines changed

5 files changed

+6
-30
lines changed

src/test/compile-fail/issue-17025.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-test the unsized enum no longer compiles
12+
1113
enum A {
1214
B(char),
1315
C([Box<A>]),

src/test/compile-fail/issue-5883.rs

-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ fn new_struct(r: A+'static)
2020
Struct { r: r }
2121
}
2222

23-
trait Curve {}
24-
enum E {X(Curve+'static)}
2523
fn main() {}

src/test/compile-fail/unsized-enum.rs

-7
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,4 @@ fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
1919
//
2020
// Not OK: `T` is not sized.
2121

22-
enum Bar<U: ?Sized> { BarSome(U), BarNone }
23-
fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
24-
fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
25-
//~^ ERROR `T: std::marker::Sized` is not satisfied
26-
//
27-
// Not OK: `Bar<T>` is not sized, but it should be.
28-
2922
fn main() { }

src/test/compile-fail/unsized3.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,8 @@ fn f3<X: ?Sized + T>(x: &X) {
3131
fn f4<X: T>(x: &X) {
3232
}
3333

34-
// Test with unsized enum.
35-
enum E<X: ?Sized> {
36-
V(X),
37-
}
38-
3934
fn f5<Y>(x: &Y) {}
4035
fn f6<X: ?Sized>(x: &X) {}
41-
fn f7<X: ?Sized>(x1: &E<X>, x2: &E<X>) {
42-
f5(x1);
43-
//~^ ERROR `X: std::marker::Sized` is not satisfied
44-
f6(x2); // ok
45-
}
46-
4736

4837
// Test with unsized struct.
4938
struct S<X: ?Sized> {
@@ -57,13 +46,13 @@ fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
5746
}
5847

5948
// Test some tuples.
60-
fn f9<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
49+
fn f9<X: ?Sized>(x1: Box<S<X>>) {
6150
f5(&(*x1, 34));
6251
//~^ ERROR `X: std::marker::Sized` is not satisfied
6352
}
6453

65-
fn f10<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
66-
f5(&(32, *x2));
54+
fn f10<X: ?Sized>(x1: Box<S<X>>) {
55+
f5(&(32, *x1));
6756
//~^ ERROR `X: std::marker::Sized` is not satisfied
6857
}
6958

src/test/run-pass/unsized2.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,14 @@ trait T7<X: ?Sized+T> {
8989
fn m2(&self, x: &T5<X>);
9090
}
9191

92-
// The last field in a struct or variant may be unsized
92+
// The last field in a struct may be unsized
9393
struct S2<X: ?Sized> {
9494
f: X,
9595
}
9696
struct S3<X: ?Sized> {
9797
f1: isize,
9898
f2: X,
9999
}
100-
enum E<X: ?Sized> {
101-
V1(X),
102-
V2{x: X},
103-
V3(isize, X),
104-
V4{u: isize, x: X},
105-
}
106100

107101
pub fn main() {
108102
}

0 commit comments

Comments
 (0)