about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/impl-trait/recursive-coroutine.current.stderr (renamed from tests/ui/impl-trait/recursive-coroutine.stderr)2
-rw-r--r--tests/ui/impl-trait/recursive-coroutine.next.stderr12
-rw-r--r--tests/ui/impl-trait/recursive-coroutine.rs2
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other.current.stderr (renamed from tests/ui/impl-trait/two_tait_defining_each_other.stderr)6
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other.rs6
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other2.current.stderr (renamed from tests/ui/impl-trait/two_tait_defining_each_other2.stderr)8
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr9
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other2.rs7
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other3.current.stderr (renamed from tests/ui/impl-trait/two_tait_defining_each_other3.stderr)6
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other3.rs5
-rw-r--r--tests/ui/traits/new-solver/alias-relate/deeply-nested-no-hang.rs22
-rw-r--r--tests/ui/traits/new-solver/alias-relate/opaque-hidden-ty-is-rigid-alias.rs8
-rw-r--r--tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr7
-rw-r--r--tests/ui/type-alias-impl-trait/assoc-type-const.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-78450.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr4
-rw-r--r--tests/ui/type-alias-impl-trait/wf-in-associated-type.rs6
17 files changed, 91 insertions, 25 deletions
diff --git a/tests/ui/impl-trait/recursive-coroutine.stderr b/tests/ui/impl-trait/recursive-coroutine.current.stderr
index d36a58a8643..45911b7fc11 100644
--- a/tests/ui/impl-trait/recursive-coroutine.stderr
+++ b/tests/ui/impl-trait/recursive-coroutine.current.stderr
@@ -1,5 +1,5 @@
 error[E0720]: cannot resolve opaque type
-  --> $DIR/recursive-coroutine.rs:5:13
+  --> $DIR/recursive-coroutine.rs:7:13
    |
 LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive opaque type
diff --git a/tests/ui/impl-trait/recursive-coroutine.next.stderr b/tests/ui/impl-trait/recursive-coroutine.next.stderr
new file mode 100644
index 00000000000..45911b7fc11
--- /dev/null
+++ b/tests/ui/impl-trait/recursive-coroutine.next.stderr
@@ -0,0 +1,12 @@
+error[E0720]: cannot resolve opaque type
+  --> $DIR/recursive-coroutine.rs:7:13
+   |
+LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive opaque type
+...
+LL |         let mut gen = Box::pin(foo());
+   |             ------- coroutine captures itself here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/recursive-coroutine.rs b/tests/ui/impl-trait/recursive-coroutine.rs
index 6351cef95a6..f0bee4f120f 100644
--- a/tests/ui/impl-trait/recursive-coroutine.rs
+++ b/tests/ui/impl-trait/recursive-coroutine.rs
@@ -1,3 +1,5 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
 #![feature(coroutines, coroutine_trait)]
 
 use std::ops::{Coroutine, CoroutineState};
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other.stderr b/tests/ui/impl-trait/two_tait_defining_each_other.current.stderr
index 1a42ac525a6..e5f7e5e5c44 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other.stderr
+++ b/tests/ui/impl-trait/two_tait_defining_each_other.current.stderr
@@ -1,16 +1,16 @@
 error: opaque type's hidden type cannot be another opaque type from the same scope
-  --> $DIR/two_tait_defining_each_other.rs:12:5
+  --> $DIR/two_tait_defining_each_other.rs:16:5
    |
 LL |     x // A's hidden type is `Bar`, because all the hidden types of `B` are compared with each other
    |     ^ one of the two opaque types used here has to be outside its defining scope
    |
 note: opaque type whose hidden type is being assigned
-  --> $DIR/two_tait_defining_each_other.rs:4:10
+  --> $DIR/two_tait_defining_each_other.rs:8:10
    |
 LL | type B = impl Foo;
    |          ^^^^^^^^
 note: opaque type being used as hidden type
-  --> $DIR/two_tait_defining_each_other.rs:3:10
+  --> $DIR/two_tait_defining_each_other.rs:7:10
    |
 LL | type A = impl Foo;
    |          ^^^^^^^^
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other.rs b/tests/ui/impl-trait/two_tait_defining_each_other.rs
index 6eb2a11b22c..b43a7cabd05 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other.rs
+++ b/tests/ui/impl-trait/two_tait_defining_each_other.rs
@@ -1,3 +1,7 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+//[next] check-pass
+
 #![feature(type_alias_impl_trait)]
 
 type A = impl Foo;
@@ -10,7 +14,7 @@ fn muh(x: A) -> B {
         return Bar; // B's hidden type is Bar
     }
     x // A's hidden type is `Bar`, because all the hidden types of `B` are compared with each other
-    //~^ ERROR opaque type's hidden type cannot be another opaque type
+    //[current]~^ ERROR opaque type's hidden type cannot be another opaque type
 }
 
 struct Bar;
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.stderr b/tests/ui/impl-trait/two_tait_defining_each_other2.current.stderr
index 4d8f96de162..33866451c6b 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other2.stderr
+++ b/tests/ui/impl-trait/two_tait_defining_each_other2.current.stderr
@@ -1,5 +1,5 @@
 error: unconstrained opaque type
-  --> $DIR/two_tait_defining_each_other2.rs:3:10
+  --> $DIR/two_tait_defining_each_other2.rs:5:10
    |
 LL | type A = impl Foo;
    |          ^^^^^^^^
@@ -7,18 +7,18 @@ LL | type A = impl Foo;
    = note: `A` must be used in combination with a concrete type within the same module
 
 error: opaque type's hidden type cannot be another opaque type from the same scope
-  --> $DIR/two_tait_defining_each_other2.rs:9:5
+  --> $DIR/two_tait_defining_each_other2.rs:11:5
    |
 LL |     x // B's hidden type is A (opaquely)
    |     ^ one of the two opaque types used here has to be outside its defining scope
    |
 note: opaque type whose hidden type is being assigned
-  --> $DIR/two_tait_defining_each_other2.rs:4:10
+  --> $DIR/two_tait_defining_each_other2.rs:6:10
    |
 LL | type B = impl Foo;
    |          ^^^^^^^^
 note: opaque type being used as hidden type
-  --> $DIR/two_tait_defining_each_other2.rs:3:10
+  --> $DIR/two_tait_defining_each_other2.rs:5:10
    |
 LL | type A = impl Foo;
    |          ^^^^^^^^
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr b/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr
new file mode 100644
index 00000000000..e3a4797e44c
--- /dev/null
+++ b/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr
@@ -0,0 +1,9 @@
+error[E0284]: type annotations needed: cannot satisfy `A <: B`
+  --> $DIR/two_tait_defining_each_other2.rs:11:5
+   |
+LL |     x // B's hidden type is A (opaquely)
+   |     ^ cannot satisfy `A <: B`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0284`.
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.rs b/tests/ui/impl-trait/two_tait_defining_each_other2.rs
index 05b09668016..817de109fbe 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other2.rs
+++ b/tests/ui/impl-trait/two_tait_defining_each_other2.rs
@@ -1,13 +1,16 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
 #![feature(type_alias_impl_trait)]
 
-type A = impl Foo; //~ ERROR unconstrained opaque type
+type A = impl Foo; //[current]~ ERROR unconstrained opaque type
 type B = impl Foo;
 
 trait Foo {}
 
 fn muh(x: A) -> B {
     x // B's hidden type is A (opaquely)
-    //~^ ERROR opaque type's hidden type cannot be another opaque type
+    //[current]~^ ERROR opaque type's hidden type cannot be another opaque type
+    //[next]~^^ ERROR type annotations needed: cannot satisfy `A <: B`
 }
 
 struct Bar;
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other3.stderr b/tests/ui/impl-trait/two_tait_defining_each_other3.current.stderr
index b06dc16d5e7..451ba407b71 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other3.stderr
+++ b/tests/ui/impl-trait/two_tait_defining_each_other3.current.stderr
@@ -1,16 +1,16 @@
 error: opaque type's hidden type cannot be another opaque type from the same scope
-  --> $DIR/two_tait_defining_each_other3.rs:10:16
+  --> $DIR/two_tait_defining_each_other3.rs:13:16
    |
 LL |         return x;  // B's hidden type is A (opaquely)
    |                ^ one of the two opaque types used here has to be outside its defining scope
    |
 note: opaque type whose hidden type is being assigned
-  --> $DIR/two_tait_defining_each_other3.rs:4:10
+  --> $DIR/two_tait_defining_each_other3.rs:7:10
    |
 LL | type B = impl Foo;
    |          ^^^^^^^^
 note: opaque type being used as hidden type
-  --> $DIR/two_tait_defining_each_other3.rs:3:10
+  --> $DIR/two_tait_defining_each_other3.rs:6:10
    |
 LL | type A = impl Foo;
    |          ^^^^^^^^
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other3.rs b/tests/ui/impl-trait/two_tait_defining_each_other3.rs
index 37f8ae1b84b..6fb9e6e7188 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other3.rs
+++ b/tests/ui/impl-trait/two_tait_defining_each_other3.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+//[next] check-pass
 #![feature(type_alias_impl_trait)]
 
 type A = impl Foo;
@@ -8,7 +11,7 @@ trait Foo {}
 fn muh(x: A) -> B {
     if false {
         return x;  // B's hidden type is A (opaquely)
-        //~^ ERROR opaque type's hidden type cannot be another opaque type
+        //[current]~^ ERROR opaque type's hidden type cannot be another opaque type
     }
     Bar // A's hidden type is `Bar`, because all the return types are compared with each other
 }
diff --git a/tests/ui/traits/new-solver/alias-relate/deeply-nested-no-hang.rs b/tests/ui/traits/new-solver/alias-relate/deeply-nested-no-hang.rs
new file mode 100644
index 00000000000..4abce7b57d5
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias-relate/deeply-nested-no-hang.rs
@@ -0,0 +1,22 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// regression test for trait-system-refactor-initiative#68
+trait Identity {
+    type Assoc: ?Sized;
+}
+
+impl<T: ?Sized> Identity for T {
+    type Assoc = T;
+}
+
+type Id<T> = <T as Identity>::Assoc;
+
+type Five<T> = Id<Id<Id<Id<Id<T>>>>>;
+type Ty<T> = Five<Five<Five<Five<Five<T>>>>>;
+
+trait Trait<T> {}
+
+impl<T> Trait<T> for Ty<T> {}
+impl Trait<u32> for Ty<i32> {}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/alias-relate/opaque-hidden-ty-is-rigid-alias.rs b/tests/ui/traits/new-solver/alias-relate/opaque-hidden-ty-is-rigid-alias.rs
new file mode 100644
index 00000000000..29a73e1a967
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias-relate/opaque-hidden-ty-is-rigid-alias.rs
@@ -0,0 +1,8 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+
+fn test<T: Iterator>(x: T::Item) -> impl Sized {
+    x
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr b/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr
index 73d46c4df96..4207c2f80b8 100644
--- a/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr
+++ b/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr
@@ -1,7 +1,3 @@
-WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
-WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
-WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
-WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
 error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc`
   --> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1
    |
@@ -11,7 +7,8 @@ LL | struct LocalTy;
 LL | impl Trait for <LocalTy as Overflow>::Assoc {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc`
    |
-   = note: upstream crates may add a new impl of trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc` in future versions
+   = note: downstream crates may implement trait `std::marker::Sized` for type `<LocalTy as Overflow>::Assoc`
+   = note: downstream crates may implement trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/type-alias-impl-trait/assoc-type-const.rs b/tests/ui/type-alias-impl-trait/assoc-type-const.rs
index 62f66914ee3..6632a3450e5 100644
--- a/tests/ui/type-alias-impl-trait/assoc-type-const.rs
+++ b/tests/ui/type-alias-impl-trait/assoc-type-const.rs
@@ -1,7 +1,9 @@
 // Tests that we properly detect defining usages when using
 // const generics in an associated opaque type
-// check-pass
 
+// check-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
 #![feature(impl_trait_in_assoc_type)]
 
 trait UnwrapItemsExt<'a, const C: usize> {
diff --git a/tests/ui/type-alias-impl-trait/issue-78450.rs b/tests/ui/type-alias-impl-trait/issue-78450.rs
index 2a984c1ed71..236e9f4e88c 100644
--- a/tests/ui/type-alias-impl-trait/issue-78450.rs
+++ b/tests/ui/type-alias-impl-trait/issue-78450.rs
@@ -1,4 +1,6 @@
 // check-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
 
 #![feature(impl_trait_in_assoc_type)]
 
diff --git a/tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr b/tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr
index 7d72c9f811a..c4ad8434ed1 100644
--- a/tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr
+++ b/tests/ui/type-alias-impl-trait/wf-in-associated-type.fail.stderr
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-in-associated-type.rs:36:23
+  --> $DIR/wf-in-associated-type.rs:38:23
    |
 LL |     impl<'a, T> Trait<'a, T> for () {
    |          -- 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 () {
    |               ++++
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-in-associated-type.rs:36:23
+  --> $DIR/wf-in-associated-type.rs:38:23
    |
 LL |     impl<'a, T> Trait<'a, T> for () {
    |          -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
diff --git a/tests/ui/type-alias-impl-trait/wf-in-associated-type.rs b/tests/ui/type-alias-impl-trait/wf-in-associated-type.rs
index 31fbef9f78f..b966ca4bff0 100644
--- a/tests/ui/type-alias-impl-trait/wf-in-associated-type.rs
+++ b/tests/ui/type-alias-impl-trait/wf-in-associated-type.rs
@@ -1,14 +1,16 @@
 // WF check for impl Trait in associated type position.
 //
-// revisions: pass fail
+// revisions: pass pass_next fail
 // [pass] check-pass
+// [pass_next] compile-flags: -Ztrait-solver=next
+// [pass_next] check-pass
 // [fail] check-fail
 
 #![feature(impl_trait_in_assoc_type)]
 
 // The hidden type here (`&'a T`) requires proving `T: 'a`.
 // We know it holds because of implied bounds from the impl header.
-#[cfg(pass)]
+#[cfg(any(pass, pass_next))]
 mod pass {
     trait Trait<Req> {
         type Opaque1;