mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
20 lines
252 B
Rust
20 lines
252 B
Rust
//@ check-pass
|
|
|
|
trait Trait {
|
|
type Item;
|
|
}
|
|
|
|
struct Struct<A: Trait<Item = B>, B> {
|
|
pub field: A,
|
|
}
|
|
|
|
fn identity<T>(x: T) -> T {
|
|
x
|
|
}
|
|
|
|
fn test<A: Trait<Item = B>, B>(x: &Struct<A, B>) {
|
|
let x: &Struct<_, _> = identity(x);
|
|
}
|
|
|
|
fn main() {}
|