about summary refs log tree commit diff
path: root/tests/ui/impl-trait/recursive-bound-eval.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-26 16:10:47 +0000
committerbors <bors@rust-lang.org>2025-09-26 16:10:47 +0000
commit54a8a1db604e4caff93e26e167ad4a6fde9f0681 (patch)
tree4ad8eb2c873b1431c53293cfd0d6c25fc6b853f5 /tests/ui/impl-trait/recursive-bound-eval.rs
parenta8858111044a9391ac7558f969d3bf62ef43222d (diff)
parentc2e39c2f20c568b96fe89c751e65bbbe9116231c (diff)
downloadrust-54a8a1db604e4caff93e26e167ad4a6fde9f0681.tar.gz
rust-54a8a1db604e4caff93e26e167ad4a6fde9f0681.zip
Auto merge of #146885 - lcnr:method-selection-opaques, r=BoxyUwU
support opaque types in method selection

See my notes in https://hackmd.io/4ILASx3mQ3u_gW9r1JyqCw.

This PR builds on https://github.com/rust-lang/rust/pull/145993 and allows not-yet defined opaque types as self types in the `method_autoderef_chain`.

E.g. for `Box<impl Deref<impl Foo>>` this results in the autoderef chain `Box<impl Deref> -> ?deref_hidden_ty -> ?foo_hidden_ty`. Method selection stays ambiguous if the final autoderef step is still an infer var unless that var is an opaque.

TODO: treating opaques as rigid jank.

r? `@BoxyUwU`
Diffstat (limited to 'tests/ui/impl-trait/recursive-bound-eval.rs')
-rw-r--r--tests/ui/impl-trait/recursive-bound-eval.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/ui/impl-trait/recursive-bound-eval.rs b/tests/ui/impl-trait/recursive-bound-eval.rs
index 7859c8983fc..058b12e5651 100644
--- a/tests/ui/impl-trait/recursive-bound-eval.rs
+++ b/tests/ui/impl-trait/recursive-bound-eval.rs
@@ -1,10 +1,9 @@
 //! Test that we can evaluate nested obligations when invoking methods on recursive calls on
 //! an RPIT.
 
-//@revisions: next current
+//@ revisions: next current
 //@[next] compile-flags: -Znext-solver
-
-//@[current] check-pass
+//@ check-pass
 
 pub trait Parser<E> {
     fn parse(&self) -> E;
@@ -18,7 +17,6 @@ impl<E, T: Fn() -> E> Parser<E> for T {
 
 pub fn recursive_fn<E>() -> impl Parser<E> {
     move || recursive_fn().parse()
-    //[next]~^ ERROR: type annotations needed
 }
 
 fn main() {}