forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122171 - compiler-errors:next-solver-tests,…
… r=lcnr Add some new solver tests Fixes rust-lang#119607 Fixes rust-lang#119608 r? lcnr
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
tests/ui/traits/next-solver/assembly/param-env-alias-bound-conflict.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
23 changes: 23 additions & 0 deletions
23
tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |