about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/traits/new-solver/provisional-result-done.rs4
-rw-r--r--tests/ui/traits/new-solver/provisional-result-done.stderr15
-rw-r--r--tests/ui/traits/new-solver/temporary-ambiguity.rs22
3 files changed, 32 insertions, 9 deletions
diff --git a/tests/ui/traits/new-solver/provisional-result-done.rs b/tests/ui/traits/new-solver/provisional-result-done.rs
index a3d97927bad..254ab356ad8 100644
--- a/tests/ui/traits/new-solver/provisional-result-done.rs
+++ b/tests/ui/traits/new-solver/provisional-result-done.rs
@@ -1,9 +1,5 @@
 // known-bug: unknown
 // compile-flags: -Ztrait-solver=next
-// failure-status: 101
-// normalize-stderr-test "note: .*\n\n" -> ""
-// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
-// rustc-env:RUST_BACKTRACE=0
 
 // This tests checks that we update results in the provisional cache when
 // we pop a goal from the stack.
diff --git a/tests/ui/traits/new-solver/provisional-result-done.stderr b/tests/ui/traits/new-solver/provisional-result-done.stderr
index ffc92b81f08..5bd0613d259 100644
--- a/tests/ui/traits/new-solver/provisional-result-done.stderr
+++ b/tests/ui/traits/new-solver/provisional-result-done.stderr
@@ -1,6 +1,11 @@
-error: the compiler unexpectedly panicked. this is a bug.
+error[E0283]: type annotations needed: cannot satisfy `Bar<T>: Coinductive`
+  --> $DIR/provisional-result-done.rs:16:25
+   |
+LL | impl<T> Coinductive for Bar<T>
+   |                         ^^^^^^
+   |
+   = note: cannot satisfy `Bar<T>: Coinductive`
 
-query stack during panic:
-#0 [check_well_formed] checking that `<impl at $DIR/provisional-result-done.rs:20:1: 20:31>` is well-formed
-#1 [check_mod_type_wf] checking that types are well-formed in top-level module
-end of query stack
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/traits/new-solver/temporary-ambiguity.rs b/tests/ui/traits/new-solver/temporary-ambiguity.rs
new file mode 100644
index 00000000000..18ee0545700
--- /dev/null
+++ b/tests/ui/traits/new-solver/temporary-ambiguity.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+// Checks that we don't explode when we assemble >1 candidate for a goal.
+
+struct Wrapper<T>(T);
+
+trait Foo {}
+
+impl Foo for Wrapper<i32> {}
+
+impl Foo for Wrapper<()> {}
+
+fn needs_foo(_: impl Foo) {}
+
+fn main() {
+    let mut x = Default::default();
+    let w = Wrapper(x);
+    needs_foo(w);
+    x = 1;
+    drop(x);
+}