Skip to content

Commit

Permalink
Also test under next solver
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 11, 2024
1 parent ad00868 commit 964e311
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/ui/impl-trait/recursive-bound-eval.next.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0282]: type annotations needed
--> $DIR/recursive-bound-eval.rs:20:13
|
LL | move || recursive_fn().parse()
| ^^^^^^^^^^^^^^ cannot infer type

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0282`.
6 changes: 5 additions & 1 deletion tests/ui/impl-trait/recursive-bound-eval.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! Test that we can evaluate nested obligations when invoking methods on recursive calls on
//! an RPIT.

//@ check-pass
//@revisions: next current
//@[next] compile-flags: -Znext-solver

//@[current] check-pass

pub trait Parser<E> {
fn parse(&self) -> E;
Expand All @@ -15,6 +18,7 @@ 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() {}

0 comments on commit 964e311

Please sign in to comment.