Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add regression tests
  • Loading branch information
lcnr committed Dec 8, 2023
commit 1490c58076d019eacf1d0db3dbe93299ecc68a15
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// check-pass
// compile-flags: -Ztrait-solver=next

// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/1
// a minimization of a pattern in core.
fn next<T: Iterator<Item = U>, U>(t: &mut T) -> Option<U> {
t.next()
}

fn foo<T: Iterator>(t: &mut T) {
let _: Option<T::Item> = next(t);
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// check-pass
// compile-flags: -Ztrait-solver=next

// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/1,
// a minimization of a pattern in core.

trait Iterator {
type Item;
}

struct Flatten<I>(I);

impl<I, U> Iterator for Flatten<I>
where
I: Iterator<Item = U>,
{
type Item = U;
}

fn needs_iterator<I: Iterator>() {}

fn environment<J>()
where
J: Iterator,
{
needs_iterator::<Flatten<J>>();
}

fn main() {}