about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-06 21:51:20 +0000
committerbors <bors@rust-lang.org>2024-05-06 21:51:20 +0000
commit7d83a4c131ab9ae81a74c6fd825c827d74a2881d (patch)
tree8414ae3e2899e46289b2350e134b459ba1e1f117 /tests
parentce652dbb9a1e62e7ba91e5b5ce6063a7e0b3c448 (diff)
parent61751b232eb2a31e81024c4299cd5e489781399b (diff)
downloadrust-7d83a4c131ab9ae81a74c6fd825c827d74a2881d.tar.gz
rust-7d83a4c131ab9ae81a74c6fd825c827d74a2881d.zip
Auto merge of #124822 - matthiaskrgr:rollup-h7fc52t, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124759 (Record impl args in the proof tree in new solver)
 - #124809 (borrowck: prepopulate opaque storage more eagerly)
 - #124815 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/impl-trait/dyn-trait-elided-two-inputs-ref-assoc.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs3
-rw-r--r--tests/ui/impl-trait/issues/issue-105826.rs3
-rw-r--r--tests/ui/traits/next-solver/select-alias-bound-as-param.rs13
-rw-r--r--tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.next.stderr14
-rw-r--r--tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.rs29
-rw-r--r--tests/ui/traits/trait-upcasting/upcast-defining-opaque.current.stderr (renamed from tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.current.stderr)6
-rw-r--r--tests/ui/traits/trait-upcasting/upcast-defining-opaque.rs24
8 files changed, 49 insertions, 46 deletions
diff --git a/tests/ui/impl-trait/dyn-trait-elided-two-inputs-ref-assoc.rs b/tests/ui/impl-trait/dyn-trait-elided-two-inputs-ref-assoc.rs
index 2dc19b9ad68..e9706b656f2 100644
--- a/tests/ui/impl-trait/dyn-trait-elided-two-inputs-ref-assoc.rs
+++ b/tests/ui/impl-trait/dyn-trait-elided-two-inputs-ref-assoc.rs
@@ -2,6 +2,9 @@
 // when there are multiple inputs.  The `dyn Bar` should default to `+
 // 'static`. This used to erroneously generate an error (cc #62517).
 //
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
 //@ check-pass
 
 trait Foo {
diff --git a/tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs b/tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs
index f7546a05bfd..df03150e29a 100644
--- a/tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs
+++ b/tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs
@@ -1,3 +1,6 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
 //@ check-pass
 
 pub fn main() {}
diff --git a/tests/ui/impl-trait/issues/issue-105826.rs b/tests/ui/impl-trait/issues/issue-105826.rs
index e3488140dcc..33c5ed5fdeb 100644
--- a/tests/ui/impl-trait/issues/issue-105826.rs
+++ b/tests/ui/impl-trait/issues/issue-105826.rs
@@ -1,3 +1,6 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
 //@ check-pass
 
 use std::io::Write;
diff --git a/tests/ui/traits/next-solver/select-alias-bound-as-param.rs b/tests/ui/traits/next-solver/select-alias-bound-as-param.rs
new file mode 100644
index 00000000000..fd40ef1f872
--- /dev/null
+++ b/tests/ui/traits/next-solver/select-alias-bound-as-param.rs
@@ -0,0 +1,13 @@
+//@ check-pass
+//@ compile-flags: -Znext-solver
+
+pub(crate) fn y() -> impl FnMut() {
+    || {}
+}
+
+pub(crate) fn x(a: (), b: ()) {
+    let x = ();
+    y()()
+}
+
+fn main() {}
diff --git a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.next.stderr b/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.next.stderr
deleted file mode 100644
index 3c2bc0b9190..00000000000
--- a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.next.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: internal compiler error: error performing operation: query type op
-  --> $DIR/illegal-upcast-from-impl-opaque.rs:25:1
-   |
-LL | fn illegal(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: 
-  --> $DIR/illegal-upcast-from-impl-opaque.rs:25:1
-   |
-LL | fn illegal(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-query stack during panic:
-end of query stack
diff --git a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.rs b/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.rs
deleted file mode 100644
index f344474054a..00000000000
--- a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-//@ revisions: current next
-//@[next] compile-flags: -Znext-solver
-//@[next] failure-status: 101
-//@[next] known-bug: unknown
-//@[next] normalize-stderr-test "note: .*\n\n" -> ""
-//@[next] normalize-stderr-test "thread 'rustc' panicked.*\n.*\n" -> ""
-//@[next] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
-//@[next] normalize-stderr-test "delayed at .*" -> ""
-//@[next] rustc-env:RUST_BACKTRACE=0
-
-#![feature(trait_upcasting, type_alias_impl_trait)]
-
-trait Super {
-    type Assoc;
-}
-
-trait Sub: Super {}
-
-impl<T: ?Sized> Super for T {
-    type Assoc = i32;
-}
-
-type Foo = impl Sized;
-
-fn illegal(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
-    x //[current]~ mismatched types
-}
-
-fn main() {}
diff --git a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.current.stderr b/tests/ui/traits/trait-upcasting/upcast-defining-opaque.current.stderr
index c54a1c42bad..a259abb28ae 100644
--- a/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl-opaque.current.stderr
+++ b/tests/ui/traits/trait-upcasting/upcast-defining-opaque.current.stderr
@@ -1,11 +1,11 @@
 error[E0308]: mismatched types
-  --> $DIR/illegal-upcast-from-impl-opaque.rs:26:5
+  --> $DIR/upcast-defining-opaque.rs:21:5
    |
 LL | type Foo = impl Sized;
    |            ---------- the found opaque type
 LL |
-LL | fn illegal(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
-   |                                         ----------------------- expected `&dyn Super<Assoc = i32>` because of return type
+LL | fn upcast(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
+   |                                        ----------------------- expected `&dyn Super<Assoc = i32>` because of return type
 LL |     x
    |     ^ expected trait `Super`, found trait `Sub`
    |
diff --git a/tests/ui/traits/trait-upcasting/upcast-defining-opaque.rs b/tests/ui/traits/trait-upcasting/upcast-defining-opaque.rs
new file mode 100644
index 00000000000..cb1501a94a2
--- /dev/null
+++ b/tests/ui/traits/trait-upcasting/upcast-defining-opaque.rs
@@ -0,0 +1,24 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] check-pass
+
+#![feature(trait_upcasting, type_alias_impl_trait)]
+
+trait Super {
+    type Assoc;
+}
+
+trait Sub: Super {}
+
+impl<T: ?Sized> Super for T {
+    type Assoc = i32;
+}
+
+type Foo = impl Sized;
+
+fn upcast(x: &dyn Sub<Assoc = Foo>) -> &dyn Super<Assoc = i32> {
+    x //[current]~ mismatched types
+}
+
+fn main() {}