mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
23 lines
344 B
Rust
23 lines
344 B
Rust
// compile-flags: -Znext-solver
|
|
// check-pass
|
|
|
|
trait Mirror {
|
|
type Assoc;
|
|
}
|
|
|
|
impl<T> Mirror for T {
|
|
type Assoc = T;
|
|
}
|
|
|
|
trait Test {}
|
|
impl Test for i64 {}
|
|
impl Test for u64 {}
|
|
|
|
fn mirror_me<T: Mirror>(t: T, s: <T as Mirror>::Assoc) where <T as Mirror>::Assoc: Test {}
|
|
|
|
fn main() {
|
|
let mut x = 0;
|
|
mirror_me(x, 1);
|
|
x = 1i64;
|
|
}
|