mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
12 lines
243 B
Rust
12 lines
243 B
Rust
//@ run-pass
|
|
pub trait Data { fn doit(&self) {} }
|
|
impl<T> Data for T {}
|
|
pub trait UnaryLogic { type D: Data; }
|
|
impl UnaryLogic for () { type D = i32; }
|
|
|
|
pub fn crashes<T: UnaryLogic>(t: T::D) {
|
|
t.doit();
|
|
}
|
|
|
|
fn main() { crashes::<()>(0); }
|