rust/tests/ui/issues/issue-23336.rs
2023-01-11 09:32:08 +00:00

11 lines
242 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); }