Skip to content

Commit 28e5c95

Browse files
committed
update tests
1 parent e3850f4 commit 28e5c95

16 files changed

+69
-25
lines changed

tests/ui/impl-trait/recursive-coroutine.stderr renamed to tests/ui/impl-trait/recursive-coroutine.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0720]: cannot resolve opaque type
2-
--> $DIR/recursive-coroutine.rs:5:13
2+
--> $DIR/recursive-coroutine.rs:7:13
33
|
44
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive opaque type
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0720]: cannot resolve opaque type
2+
--> $DIR/recursive-coroutine.rs:7:13
3+
|
4+
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive opaque type
6+
...
7+
LL | let mut gen = Box::pin(foo());
8+
| ------- coroutine captures itself here
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0720`.

tests/ui/impl-trait/recursive-coroutine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
13
#![feature(coroutines, coroutine_trait)]
24

35
use std::ops::{Coroutine, CoroutineState};

tests/ui/impl-trait/two_tait_defining_each_other.stderr renamed to tests/ui/impl-trait/two_tait_defining_each_other.current.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error: opaque type's hidden type cannot be another opaque type from the same scope
2-
--> $DIR/two_tait_defining_each_other.rs:12:5
2+
--> $DIR/two_tait_defining_each_other.rs:16:5
33
|
44
LL | x // A's hidden type is `Bar`, because all the hidden types of `B` are compared with each other
55
| ^ one of the two opaque types used here has to be outside its defining scope
66
|
77
note: opaque type whose hidden type is being assigned
8-
--> $DIR/two_tait_defining_each_other.rs:4:10
8+
--> $DIR/two_tait_defining_each_other.rs:8:10
99
|
1010
LL | type B = impl Foo;
1111
| ^^^^^^^^
1212
note: opaque type being used as hidden type
13-
--> $DIR/two_tait_defining_each_other.rs:3:10
13+
--> $DIR/two_tait_defining_each_other.rs:7:10
1414
|
1515
LL | type A = impl Foo;
1616
| ^^^^^^^^

tests/ui/impl-trait/two_tait_defining_each_other.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
//[next] check-pass
4+
15
#![feature(type_alias_impl_trait)]
26

37
type A = impl Foo;
@@ -10,7 +14,7 @@ fn muh(x: A) -> B {
1014
return Bar; // B's hidden type is Bar
1115
}
1216
x // A's hidden type is `Bar`, because all the hidden types of `B` are compared with each other
13-
//~^ ERROR opaque type's hidden type cannot be another opaque type
17+
//[current]~^ ERROR opaque type's hidden type cannot be another opaque type
1418
}
1519

1620
struct Bar;

tests/ui/impl-trait/two_tait_defining_each_other2.stderr renamed to tests/ui/impl-trait/two_tait_defining_each_other2.current.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
error: unconstrained opaque type
2-
--> $DIR/two_tait_defining_each_other2.rs:3:10
2+
--> $DIR/two_tait_defining_each_other2.rs:5:10
33
|
44
LL | type A = impl Foo;
55
| ^^^^^^^^
66
|
77
= note: `A` must be used in combination with a concrete type within the same module
88

99
error: opaque type's hidden type cannot be another opaque type from the same scope
10-
--> $DIR/two_tait_defining_each_other2.rs:9:5
10+
--> $DIR/two_tait_defining_each_other2.rs:11:5
1111
|
1212
LL | x // B's hidden type is A (opaquely)
1313
| ^ one of the two opaque types used here has to be outside its defining scope
1414
|
1515
note: opaque type whose hidden type is being assigned
16-
--> $DIR/two_tait_defining_each_other2.rs:4:10
16+
--> $DIR/two_tait_defining_each_other2.rs:6:10
1717
|
1818
LL | type B = impl Foo;
1919
| ^^^^^^^^
2020
note: opaque type being used as hidden type
21-
--> $DIR/two_tait_defining_each_other2.rs:3:10
21+
--> $DIR/two_tait_defining_each_other2.rs:5:10
2222
|
2323
LL | type A = impl Foo;
2424
| ^^^^^^^^
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0284]: type annotations needed: cannot satisfy `A <: B`
2+
--> $DIR/two_tait_defining_each_other2.rs:11:5
3+
|
4+
LL | x // B's hidden type is A (opaquely)
5+
| ^ cannot satisfy `A <: B`
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0284`.

tests/ui/impl-trait/two_tait_defining_each_other2.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
13
#![feature(type_alias_impl_trait)]
24

3-
type A = impl Foo; //~ ERROR unconstrained opaque type
5+
type A = impl Foo; //[current]~ ERROR unconstrained opaque type
46
type B = impl Foo;
57

68
trait Foo {}
79

810
fn muh(x: A) -> B {
911
x // B's hidden type is A (opaquely)
10-
//~^ ERROR opaque type's hidden type cannot be another opaque type
12+
//[current]~^ ERROR opaque type's hidden type cannot be another opaque type
13+
//[next]~^^ ERROR type annotations needed: cannot satisfy `A <: B`
1114
}
1215

1316
struct Bar;

tests/ui/impl-trait/two_tait_defining_each_other3.stderr renamed to tests/ui/impl-trait/two_tait_defining_each_other3.current.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error: opaque type's hidden type cannot be another opaque type from the same scope
2-
--> $DIR/two_tait_defining_each_other3.rs:10:16
2+
--> $DIR/two_tait_defining_each_other3.rs:13:16
33
|
44
LL | return x; // B's hidden type is A (opaquely)
55
| ^ one of the two opaque types used here has to be outside its defining scope
66
|
77
note: opaque type whose hidden type is being assigned
8-
--> $DIR/two_tait_defining_each_other3.rs:4:10
8+
--> $DIR/two_tait_defining_each_other3.rs:7:10
99
|
1010
LL | type B = impl Foo;
1111
| ^^^^^^^^
1212
note: opaque type being used as hidden type
13-
--> $DIR/two_tait_defining_each_other3.rs:3:10
13+
--> $DIR/two_tait_defining_each_other3.rs:6:10
1414
|
1515
LL | type A = impl Foo;
1616
| ^^^^^^^^

tests/ui/impl-trait/two_tait_defining_each_other3.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
//[next] check-pass
14
#![feature(type_alias_impl_trait)]
25

36
type A = impl Foo;
@@ -8,7 +11,7 @@ trait Foo {}
811
fn muh(x: A) -> B {
912
if false {
1013
return x; // B's hidden type is A (opaquely)
11-
//~^ ERROR opaque type's hidden type cannot be another opaque type
14+
//[current]~^ ERROR opaque type's hidden type cannot be another opaque type
1215
}
1316
Bar // A's hidden type is `Bar`, because all the return types are compared with each other
1417
}

0 commit comments

Comments
 (0)