mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
Add regression test
so that we can catch regressions when we move away from chalk.
This commit is contained in:
parent
1d1a86f350
commit
e12460bbca
1 changed files with 32 additions and 0 deletions
|
@ -1756,3 +1756,35 @@ const C: usize = 2 + 2;
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn regression_14164() {
|
||||
check_types(
|
||||
r#"
|
||||
trait Rec {
|
||||
type K;
|
||||
type Rebind<Tok>: Rec<K = Tok>;
|
||||
}
|
||||
|
||||
trait Expr<K> {
|
||||
type Part: Rec<K = K>;
|
||||
fn foo(_: <Self::Part as Rec>::Rebind<i32>) {}
|
||||
}
|
||||
|
||||
struct Head<K>(K);
|
||||
impl<K> Rec for Head<K> {
|
||||
type K = K;
|
||||
type Rebind<Tok> = Head<Tok>;
|
||||
}
|
||||
|
||||
fn test<E>()
|
||||
where
|
||||
E: Expr<usize, Part = Head<usize>>,
|
||||
{
|
||||
let head;
|
||||
//^^^^ Head<i32>
|
||||
E::foo(head);
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue