mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Add some new solver tests
This commit is contained in:
parent
1c580bcb70
commit
8dd4e2b5ca
@ -0,0 +1,26 @@
|
||||
//@ compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Regression test for #119607.
|
||||
|
||||
pub trait IntoFoo {
|
||||
type Item;
|
||||
type IntoIter: Foo<Item = Self::Item>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter;
|
||||
}
|
||||
|
||||
pub trait Foo {
|
||||
type Item;
|
||||
|
||||
fn next(self) -> Option<Self::Item>;
|
||||
}
|
||||
|
||||
pub fn foo<'a, Iter1, Elem1>(a: &'a Iter1)
|
||||
where
|
||||
&'a Iter1: IntoFoo<Item = Elem1>,
|
||||
{
|
||||
a.into_iter().next();
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,23 @@
|
||||
//@ compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Regression test for #119608.
|
||||
|
||||
pub trait Foo {}
|
||||
|
||||
pub trait Bar {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl<T: Foo> Bar for T {
|
||||
type Assoc = T;
|
||||
}
|
||||
|
||||
pub fn foo<I>(_input: <I as Bar>::Assoc)
|
||||
where
|
||||
I: Bar,
|
||||
<I as Bar>::Assoc: Foo,
|
||||
{
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user