about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-27 07:24:39 +0000
committerbors <bors@rust-lang.org>2022-10-27 07:24:39 +0000
commit9dd3d29ec848efd753667292277fd9f297d7db8d (patch)
tree6393506c984e64e78f554a9205deb89f8499cf8b /src
parent44fcfb0a9606fa08ea293a71f2e6d470227ef9df (diff)
parent901649eeb7a42d521b222ee42701cc06655e9cd8 (diff)
downloadrust-9dd3d29ec848efd753667292277fd9f297d7db8d.tar.gz
rust-9dd3d29ec848efd753667292277fd9f297d7db8d.zip
Auto merge of #103601 - compiler-errors:no-opaque-probe-in-nll-relate, r=oli-obk
Remove `commit_if_ok` probe from NLL type relation

It was not really necessary to add the `commit_if_ok` in #100092 -- I added it to protect us against weird inference error messages due to recursive RPIT calls, but we are always on the error path when this happens anyways, and I can't come up with an example that makes this manifest.

Fixes #103599

r? `@oli-obk` since you reviewed #100092, feel free to re-roll.

:b: :loudspeaker:  beta-nominating this since it's on beta (which forks in ~a week~ two days :fearful:) -- worst case we could revert the original PR on beta and land this on nightly, to give it some extra soak time...
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/impl-trait/issue-103599.rs10
-rw-r--r--src/test/ui/impl-trait/issue-103599.stderr14
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/issue-103599.rs b/src/test/ui/impl-trait/issue-103599.rs
new file mode 100644
index 00000000000..043ae67f2e1
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103599.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+trait T {}
+
+fn wrap(x: impl T) -> impl T {
+    //~^ WARN function cannot return without recursing
+    wrap(wrap(x))
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-103599.stderr b/src/test/ui/impl-trait/issue-103599.stderr
new file mode 100644
index 00000000000..82038c1dceb
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103599.stderr
@@ -0,0 +1,14 @@
+warning: function cannot return without recursing
+  --> $DIR/issue-103599.rs:5:1
+   |
+LL | fn wrap(x: impl T) -> impl T {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+LL |
+LL |     wrap(wrap(x))
+   |          ------- recursive call site
+   |
+   = help: a `loop` may express intention better if this is on purpose
+   = note: `#[warn(unconditional_recursion)]` on by default
+
+warning: 1 warning emitted
+