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

+1-1
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
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

+2
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

+3-3
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

+5-1
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

+4-4
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
| ^^^^^^^^
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

+5-2
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

+3-3
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

+4-1
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
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// check-pass
2+
// compile-flags: -Ztrait-solver=next
3+
4+
fn test<T: Iterator>(x: T::Item) -> impl Sized {
5+
x
6+
}
7+
8+
fn main() {}

tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
2-
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
3-
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
4-
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
51
error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc`
62
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1
73
|
@@ -11,7 +7,8 @@ LL | struct LocalTy;
117
LL | impl Trait for <LocalTy as Overflow>::Assoc {}
128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc`
139
|
14-
= note: upstream crates may add a new impl of trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc` in future versions
10+
= note: downstream crates may implement trait `std::marker::Sized` for type `<LocalTy as Overflow>::Assoc`
11+
= note: downstream crates may implement trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc`
1512

1613
error: aborting due to previous error
1714

tests/ui/type-alias-impl-trait/assoc-type-const.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Tests that we properly detect defining usages when using
22
// const generics in an associated opaque type
3-
// check-pass
43

4+
// check-pass
5+
// revisions: current next
6+
//[next] compile-flags: -Ztrait-solver=next
57
#![feature(impl_trait_in_assoc_type)]
68

79
trait UnwrapItemsExt<'a, const C: usize> {

tests/ui/type-alias-impl-trait/issue-78450.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// check-pass
2+
// revisions: current next
3+
//[next] compile-flags: -Ztrait-solver=next
24

35
#![feature(impl_trait_in_assoc_type)]
46

tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0309]: the parameter type `T` may not live long enough
2-
--> $DIR/wf-in-associated-type.rs:36:23
2+
--> $DIR/wf-in-associated-type.rs:38:23
33
|
44
LL | impl<'a, T> Trait<'a, T> for () {
55
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
@@ -12,7 +12,7 @@ LL | impl<'a, T: 'a> Trait<'a, T> for () {
1212
| ++++
1313

1414
error[E0309]: the parameter type `T` may not live long enough
15-
--> $DIR/wf-in-associated-type.rs:36:23
15+
--> $DIR/wf-in-associated-type.rs:38:23
1616
|
1717
LL | impl<'a, T> Trait<'a, T> for () {
1818
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...

tests/ui/type-alias-impl-trait/wf-in-associated-type.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
// WF check for impl Trait in associated type position.
22
//
3-
// revisions: pass fail
3+
// revisions: pass pass_next fail
44
// [pass] check-pass
5+
// [pass_next] compile-flags: -Ztrait-solver=next
6+
// [pass_next] check-pass
57
// [fail] check-fail
68

79
#![feature(impl_trait_in_assoc_type)]
810

911
// The hidden type here (`&'a T`) requires proving `T: 'a`.
1012
// We know it holds because of implied bounds from the impl header.
11-
#[cfg(pass)]
13+
#[cfg(any(pass, pass_next))]
1214
mod pass {
1315
trait Trait<Req> {
1416
type Opaque1;

0 commit comments

Comments
 (0)