1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// check-pass // #26207: Ensure `Deref` cycles are properly handled without errors. #[derive(Copy, Clone)] struct S; impl std::ops::Deref for S { type Target = S; fn deref(&self) -> &S { self } } fn main() { let s: S = *******S; }