summary refs log tree commit diff
path: root/src/test/rustdoc-ui/deref-recursive-cycle.rs
blob: 4cb518cbbbd5c14fd0057c91a03a71b0ffe0f582 (plain)
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;
}