summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/traits/new-solver
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/traits/new-solver')
-rw-r--r--tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr2
-rw-r--r--tests/ui/traits/new-solver/async.fail.stderr2
-rw-r--r--tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs2
-rw-r--r--tests/ui/traits/new-solver/builtin-fn-must-return-sized.stderr6
-rw-r--r--tests/ui/traits/new-solver/canonicalize-effect-var.rs22
-rw-r--r--tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr6
-rw-r--r--tests/ui/traits/new-solver/cycles/coinduction/fixpoint-exponential-growth.stderr4
-rw-r--r--tests/ui/traits/new-solver/cycles/double-cycle-inductive-coinductive.stderr8
-rw-r--r--tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.rs53
-rw-r--r--tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.stderr10
-rw-r--r--tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs2
-rw-r--r--tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr19
-rw-r--r--tests/ui/traits/new-solver/dont-ice-on-assoc-projection.rs19
-rw-r--r--tests/ui/traits/new-solver/dont-ice-on-assoc-projection.stderr21
-rw-r--r--tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr4
-rw-r--r--tests/ui/traits/new-solver/generator.fail.stderr8
-rw-r--r--tests/ui/traits/new-solver/overflow/exponential-trait-goals.stderr4
-rw-r--r--tests/ui/traits/new-solver/overflow/global-cache.stderr4
-rw-r--r--tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.rs12
-rw-r--r--tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.stderr27
-rw-r--r--tests/ui/traits/new-solver/overflow/recursive-self-normalization-2.stderr4
-rw-r--r--tests/ui/traits/new-solver/overflow/recursive-self-normalization.stderr4
-rw-r--r--tests/ui/traits/new-solver/projection-discr-kind.stderr5
-rw-r--r--tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr4
24 files changed, 220 insertions, 32 deletions
diff --git a/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr
index 8eda64e44..46677a583 100644
--- a/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr
+++ b/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr
@@ -5,6 +5,8 @@ LL | impl<T: TraitB> Overlaps<Box<T>> for <T as TraitB>::Assoc {}
| --------------------------------------------------------- first implementation here
LL | impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<_ as TraitB>::Assoc`
+ |
+ = note: downstream crates may implement trait `TraitB` for type `std::boxed::Box<_>`
error: aborting due to previous error
diff --git a/tests/ui/traits/new-solver/async.fail.stderr b/tests/ui/traits/new-solver/async.fail.stderr
index 72fa2eb31..44097b556 100644
--- a/tests/ui/traits/new-solver/async.fail.stderr
+++ b/tests/ui/traits/new-solver/async.fail.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<[async block@$DIR/async.rs:12:17: 12:25] as Future>::Output == i32`
+error[E0271]: type mismatch resolving `<{async block@$DIR/async.rs:12:17: 12:25} as Future>::Output == i32`
--> $DIR/async.rs:12:17
|
LL | needs_async(async {});
diff --git a/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs
index e311a4af2..6b54718e3 100644
--- a/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs
+++ b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Ztrait-solver=next -Zdrop-tracking-mir
+// compile-flags: -Ztrait-solver=next
// edition: 2021
// revisions: pass fail
//[pass] check-pass
diff --git a/tests/ui/traits/new-solver/builtin-fn-must-return-sized.stderr b/tests/ui/traits/new-solver/builtin-fn-must-return-sized.stderr
index f7551739b..4eaa25961 100644
--- a/tests/ui/traits/new-solver/builtin-fn-must-return-sized.stderr
+++ b/tests/ui/traits/new-solver/builtin-fn-must-return-sized.stderr
@@ -1,10 +1,8 @@
error[E0277]: expected a `Fn<_>` closure, found `fn() -> str`
- --> $DIR/builtin-fn-must-return-sized.rs:15:27
+ --> $DIR/builtin-fn-must-return-sized.rs:15:11
|
LL | foo::<fn() -> str, _>(None, ());
- | --------------------- ^^^^ expected an `Fn<_>` closure, found `fn() -> str`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^ expected an `Fn<_>` closure, found `fn() -> str`
|
= help: the trait `Fn<_>` is not implemented for `fn() -> str`
note: required by a bound in `foo`
diff --git a/tests/ui/traits/new-solver/canonicalize-effect-var.rs b/tests/ui/traits/new-solver/canonicalize-effect-var.rs
new file mode 100644
index 000000000..35b69ed1a
--- /dev/null
+++ b/tests/ui/traits/new-solver/canonicalize-effect-var.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+#![feature(effects)]
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Foo {
+ fn foo();
+}
+
+trait Bar {}
+
+impl const Foo for i32 {
+ fn foo() {}
+}
+
+impl<T> const Foo for T where T: Bar {
+ fn foo() {}
+}
+
+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 5d5f325e4..73d46c4df 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,3 +1,7 @@
+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
|
@@ -6,6 +10,8 @@ LL | impl<T: Copy> Trait for T {}
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
error: aborting due to previous error
diff --git a/tests/ui/traits/new-solver/cycles/coinduction/fixpoint-exponential-growth.stderr b/tests/ui/traits/new-solver/cycles/coinduction/fixpoint-exponential-growth.stderr
index 7d3535e1f..a86115671 100644
--- a/tests/ui/traits/new-solver/cycles/coinduction/fixpoint-exponential-growth.stderr
+++ b/tests/ui/traits/new-solver/cycles/coinduction/fixpoint-exponential-growth.stderr
@@ -5,10 +5,10 @@ LL | impls::<W<_>>();
| ^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `impls`
error[E0275]: overflow evaluating the requirement `W<_>: Trait`
- --> $DIR/fixpoint-exponential-growth.rs:29:5
+ --> $DIR/fixpoint-exponential-growth.rs:29:13
|
LL | impls::<W<_>>();
- | ^^^^^^^^^^^^^
+ | ^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`fixpoint_exponential_growth`)
note: required by a bound in `impls`
diff --git a/tests/ui/traits/new-solver/cycles/double-cycle-inductive-coinductive.stderr b/tests/ui/traits/new-solver/cycles/double-cycle-inductive-coinductive.stderr
index 4b8846da5..a3404da51 100644
--- a/tests/ui/traits/new-solver/cycles/double-cycle-inductive-coinductive.stderr
+++ b/tests/ui/traits/new-solver/cycles/double-cycle-inductive-coinductive.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `(): Trait`
- --> $DIR/double-cycle-inductive-coinductive.rs:32:5
+ --> $DIR/double-cycle-inductive-coinductive.rs:32:19
|
LL | impls_trait::<()>();
- | ^^^^^^^^^^^^^^^^^
+ | ^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`double_cycle_inductive_coinductive`)
note: required by a bound in `impls_trait`
@@ -12,10 +12,10 @@ LL | fn impls_trait<T: Trait>() {}
| ^^^^^ required by this bound in `impls_trait`
error[E0275]: overflow evaluating the requirement `(): TraitRev`
- --> $DIR/double-cycle-inductive-coinductive.rs:35:5
+ --> $DIR/double-cycle-inductive-coinductive.rs:35:23
|
LL | impls_trait_rev::<()>();
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`double_cycle_inductive_coinductive`)
note: required by a bound in `impls_trait_rev`
diff --git a/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.rs b/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.rs
new file mode 100644
index 000000000..279063923
--- /dev/null
+++ b/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.rs
@@ -0,0 +1,53 @@
+// compile-flags: -Ztrait-solver=next
+#![feature(rustc_attrs)]
+
+// Check that we correctly rerun the trait solver for heads of cycles,
+// even if they are not the root.
+
+struct A<T: ?Sized>(*const T);
+struct B<T: ?Sized>(*const T);
+struct C<T: ?Sized>(*const T);
+
+#[rustc_coinductive]
+trait Trait<'a, 'b> {}
+trait NotImplemented {}
+
+impl<'a, 'b, T: ?Sized> Trait<'a, 'b> for A<T> where B<T>: Trait<'a, 'b> {}
+
+// With this the root of `B<T>` is `A<T>`, even if the other impl does
+// not have a cycle with `A<T>`. This candidate never applies because of
+// the `A<T>: NotImplemented` bound.
+impl<'a, 'b, T: ?Sized> Trait<'a, 'b> for B<T>
+where
+ A<T>: Trait<'a, 'b>,
+ A<T>: NotImplemented,
+{
+}
+
+// This impl directly requires 'b to be equal to 'static.
+//
+// Because of the coinductive cycle through `C<T>` it also requires
+// 'a to be 'static.
+impl<'a, T: ?Sized> Trait<'a, 'static> for B<T>
+where
+ C<T>: Trait<'a, 'a>,
+{}
+
+// In the first iteration of `B<T>: Trait<'a, 'b>` we don't add any
+// constraints here, only after setting the provisional result to require
+// `'b == 'static` do we also add that constraint for `'a`.
+impl<'a, 'b, T: ?Sized> Trait<'a, 'b> for C<T>
+where
+ B<T>: Trait<'a, 'b>,
+{}
+
+fn impls_trait<'a, 'b, T: Trait<'a, 'b> + ?Sized>() {}
+
+fn check<'a, T: ?Sized>() {
+ impls_trait::<'a, 'static, A<T>>();
+ //~^ ERROR lifetime may not live long enough
+}
+
+fn main() {
+ check::<()>();
+}
diff --git a/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.stderr b/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.stderr
new file mode 100644
index 000000000..4cbd08981
--- /dev/null
+++ b/tests/ui/traits/new-solver/cycles/fixpoint-rerun-all-cycle-heads.stderr
@@ -0,0 +1,10 @@
+error: lifetime may not live long enough
+ --> $DIR/fixpoint-rerun-all-cycle-heads.rs:47:5
+ |
+LL | fn check<'a, T: ?Sized>() {
+ | -- lifetime `'a` defined here
+LL | impls_trait::<'a, 'static, A<T>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs
index 3cfe7ab87..f06b98a79 100644
--- a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs
+++ b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs
@@ -39,7 +39,7 @@ fn impls_ar<T: AR>() {}
fn main() {
impls_a::<()>();
- // FIXME(-Ztrait-solver=next): This is broken and should error.
+ //~^ ERROR overflow evaluating the requirement `(): A`
impls_ar::<()>();
//~^ ERROR overflow evaluating the requirement `(): AR`
diff --git a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr
index 0e1c86c1b..859b3f3f1 100644
--- a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr
+++ b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr
@@ -1,8 +1,21 @@
+error[E0275]: overflow evaluating the requirement `(): A`
+ --> $DIR/inductive-not-on-stack.rs:41:15
+ |
+LL | impls_a::<()>();
+ | ^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inductive_not_on_stack`)
+note: required by a bound in `impls_a`
+ --> $DIR/inductive-not-on-stack.rs:25:15
+ |
+LL | fn impls_a<T: A>() {}
+ | ^ required by this bound in `impls_a`
+
error[E0275]: overflow evaluating the requirement `(): AR`
- --> $DIR/inductive-not-on-stack.rs:44:5
+ --> $DIR/inductive-not-on-stack.rs:44:16
|
LL | impls_ar::<()>();
- | ^^^^^^^^^^^^^^
+ | ^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inductive_not_on_stack`)
note: required by a bound in `impls_ar`
@@ -11,6 +24,6 @@ note: required by a bound in `impls_ar`
LL | fn impls_ar<T: AR>() {}
| ^^ required by this bound in `impls_ar`
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.rs b/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.rs
new file mode 100644
index 000000000..b9798c79d
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.rs
@@ -0,0 +1,19 @@
+// compile-flags: -Ztrait-solver=next-coherence
+
+// Makes sure we don't ICE on associated const projection when the feature gate
+// is not enabled, since we should avoid encountering ICEs on stable if possible.
+
+trait Bar {
+ const ASSOC: usize;
+}
+impl Bar for () {
+ const ASSOC: usize = 1;
+}
+
+trait Foo {}
+impl Foo for () {}
+impl<T> Foo for T where T: Bar<ASSOC = 0> {}
+//~^ ERROR associated const equality is incomplete
+//~| ERROR conflicting implementations of trait `Foo` for type `()`
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.stderr b/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.stderr
new file mode 100644
index 000000000..7ad495a35
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-ice-on-assoc-projection.stderr
@@ -0,0 +1,21 @@
+error[E0658]: associated const equality is incomplete
+ --> $DIR/dont-ice-on-assoc-projection.rs:15:32
+ |
+LL | impl<T> Foo for T where T: Bar<ASSOC = 0> {}
+ | ^^^^^^^^^
+ |
+ = note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
+ = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
+
+error[E0119]: conflicting implementations of trait `Foo` for type `()`
+ --> $DIR/dont-ice-on-assoc-projection.rs:15:1
+ |
+LL | impl Foo for () {}
+ | --------------- first implementation here
+LL | impl<T> Foo for T where T: Bar<ASSOC = 0> {}
+ | ^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0119, E0658.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr
index ec1c3231a..a31bfd958 100644
--- a/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr
+++ b/tests/ui/traits/new-solver/dont-type_of-tait-in-defining-scope.not_send.stderr
@@ -1,8 +1,8 @@
error[E0283]: type annotations needed: cannot satisfy `Foo: Send`
- --> $DIR/dont-type_of-tait-in-defining-scope.rs:16:5
+ --> $DIR/dont-type_of-tait-in-defining-scope.rs:16:18
|
LL | needs_send::<Foo>();
- | ^^^^^^^^^^^^^^^^^
+ | ^^^
|
= note: cannot satisfy `Foo: Send`
note: required by a bound in `needs_send`
diff --git a/tests/ui/traits/new-solver/generator.fail.stderr b/tests/ui/traits/new-solver/generator.fail.stderr
index d94d41e35..e3fe4bf5a 100644
--- a/tests/ui/traits/new-solver/generator.fail.stderr
+++ b/tests/ui/traits/new-solver/generator.fail.stderr
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `[generator@$DIR/generator.rs:18:21: 18:23]: Generator<A>` is not satisfied
+error[E0277]: the trait bound `{generator@$DIR/generator.rs:18:21: 18:23}: Generator<A>` is not satisfied
--> $DIR/generator.rs:18:21
|
LL | needs_generator(|| {
@@ -10,7 +10,7 @@ LL | |
LL | |
LL | | yield ();
LL | | });
- | |_____^ the trait `Generator<A>` is not implemented for `[generator@$DIR/generator.rs:18:21: 18:23]`
+ | |_____^ the trait `Generator<A>` is not implemented for `{generator@$DIR/generator.rs:18:21: 18:23}`
|
note: required by a bound in `needs_generator`
--> $DIR/generator.rs:14:28
@@ -18,7 +18,7 @@ note: required by a bound in `needs_generator`
LL | fn needs_generator(_: impl Generator<A, Yield = B, Return = C>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `needs_generator`
-error[E0271]: type mismatch resolving `<[generator@$DIR/generator.rs:18:21: 18:23] as Generator<A>>::Yield == B`
+error[E0271]: type mismatch resolving `<{generator@$DIR/generator.rs:18:21: 18:23} as Generator<A>>::Yield == B`
--> $DIR/generator.rs:18:21
|
LL | needs_generator(|| {
@@ -38,7 +38,7 @@ note: required by a bound in `needs_generator`
LL | fn needs_generator(_: impl Generator<A, Yield = B, Return = C>) {}
| ^^^^^^^^^ required by this bound in `needs_generator`
-error[E0271]: type mismatch resolving `<[generator@$DIR/generator.rs:18:21: 18:23] as Generator<A>>::Return == C`
+error[E0271]: type mismatch resolving `<{generator@$DIR/generator.rs:18:21: 18:23} as Generator<A>>::Return == C`
--> $DIR/generator.rs:18:21
|
LL | needs_generator(|| {
diff --git a/tests/ui/traits/new-solver/overflow/exponential-trait-goals.stderr b/tests/ui/traits/new-solver/overflow/exponential-trait-goals.stderr
index 28a99cbbc..beed40f36 100644
--- a/tests/ui/traits/new-solver/overflow/exponential-trait-goals.stderr
+++ b/tests/ui/traits/new-solver/overflow/exponential-trait-goals.stderr
@@ -5,10 +5,10 @@ LL | impls::<W<_>>();
| ^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `impls`
error[E0275]: overflow evaluating the requirement `W<_>: Trait`
- --> $DIR/exponential-trait-goals.rs:17:5
+ --> $DIR/exponential-trait-goals.rs:17:13
|
LL | impls::<W<_>>();
- | ^^^^^^^^^^^^^
+ | ^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`exponential_trait_goals`)
note: required by a bound in `impls`
diff --git a/tests/ui/traits/new-solver/overflow/global-cache.stderr b/tests/ui/traits/new-solver/overflow/global-cache.stderr
index f3b86a083..ebb03d84b 100644
--- a/tests/ui/traits/new-solver/overflow/global-cache.stderr
+++ b/tests/ui/traits/new-solver/overflow/global-cache.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `Inc<Inc<Inc<Inc<Inc<Inc<Inc<...>>>>>>>: Trait`
- --> $DIR/global-cache.rs:21:5
+ --> $DIR/global-cache.rs:21:19
|
LL | impls_trait::<Four<Four<Four<Four<()>>>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "18"]` attribute to your crate (`global_cache`)
note: required by a bound in `impls_trait`
diff --git a/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.rs b/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.rs
new file mode 100644
index 000000000..539c9614e
--- /dev/null
+++ b/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.rs
@@ -0,0 +1,12 @@
+//~ ERROR overflow evaluating the requirement `Self well-formed`
+//~| ERROR overflow evaluating the requirement `Self: Trait`
+
+// This is a non-regression test for issue #115351, where a recursion limit of 0 caused an ICE.
+// compile-flags: -Ztrait-solver=next --crate-type=lib
+// check-fail
+
+#![recursion_limit = "0"]
+trait Trait {}
+impl Trait for u32 {}
+//~^ ERROR overflow evaluating the requirement `u32: Trait`
+//~| ERROR overflow evaluating the requirement `u32 well-formed`
diff --git a/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.stderr b/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.stderr
new file mode 100644
index 000000000..16b25d90a
--- /dev/null
+++ b/tests/ui/traits/new-solver/overflow/recursion-limit-zero-issue-115351.stderr
@@ -0,0 +1,27 @@
+error[E0275]: overflow evaluating the requirement `Self: Trait`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`recursion_limit_zero_issue_115351`)
+
+error[E0275]: overflow evaluating the requirement `Self well-formed`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`recursion_limit_zero_issue_115351`)
+
+error[E0275]: overflow evaluating the requirement `u32: Trait`
+ --> $DIR/recursion-limit-zero-issue-115351.rs:10:16
+ |
+LL | impl Trait for u32 {}
+ | ^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`recursion_limit_zero_issue_115351`)
+
+error[E0275]: overflow evaluating the requirement `u32 well-formed`
+ --> $DIR/recursion-limit-zero-issue-115351.rs:10:16
+ |
+LL | impl Trait for u32 {}
+ | ^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`recursion_limit_zero_issue_115351`)
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/new-solver/overflow/recursive-self-normalization-2.stderr b/tests/ui/traits/new-solver/overflow/recursive-self-normalization-2.stderr
index eebaf21d7..1dc63fae9 100644
--- a/tests/ui/traits/new-solver/overflow/recursive-self-normalization-2.stderr
+++ b/tests/ui/traits/new-solver/overflow/recursive-self-normalization-2.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
- --> $DIR/recursive-self-normalization-2.rs:16:5
+ --> $DIR/recursive-self-normalization-2.rs:16:17
|
LL | needs_bar::<T::Assoc1>();
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`)
note: required by a bound in `needs_bar`
diff --git a/tests/ui/traits/new-solver/overflow/recursive-self-normalization.stderr b/tests/ui/traits/new-solver/overflow/recursive-self-normalization.stderr
index 6a87fe2f1..afc5bfa54 100644
--- a/tests/ui/traits/new-solver/overflow/recursive-self-normalization.stderr
+++ b/tests/ui/traits/new-solver/overflow/recursive-self-normalization.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar`
- --> $DIR/recursive-self-normalization.rs:12:5
+ --> $DIR/recursive-self-normalization.rs:12:17
|
LL | needs_bar::<T::Assoc>();
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`)
note: required by a bound in `needs_bar`
diff --git a/tests/ui/traits/new-solver/projection-discr-kind.stderr b/tests/ui/traits/new-solver/projection-discr-kind.stderr
index 03e28f993..e14953f19 100644
--- a/tests/ui/traits/new-solver/projection-discr-kind.stderr
+++ b/tests/ui/traits/new-solver/projection-discr-kind.stderr
@@ -6,6 +6,11 @@ LL | needs_bar(std::mem::discriminant(&x));
| |
| required by a bound introduced by this call
|
+help: this trait has no implementations, consider adding one
+ --> $DIR/projection-discr-kind.rs:10:1
+ |
+LL | trait Bar {}
+ | ^^^^^^^^^
note: required by a bound in `needs_bar`
--> $DIR/projection-discr-kind.rs:11:22
|
diff --git a/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr b/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
index 83a0452b0..b311ac6b5 100644
--- a/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
+++ b/tests/ui/traits/new-solver/two-projection-param-candidates-are-ambiguous.stderr
@@ -1,8 +1,8 @@
error[E0283]: type annotations needed: cannot satisfy `T: Bar`
- --> $DIR/two-projection-param-candidates-are-ambiguous.rs:26:5
+ --> $DIR/two-projection-param-candidates-are-ambiguous.rs:26:17
|
LL | needs_bar::<T>();
- | ^^^^^^^^^^^^^^
+ | ^
|
= note: cannot satisfy `T: Bar`
= help: the trait `Bar` is implemented for `T`