summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/issue-56701.rs
blob: ba00743fcd12e75701d2e75c8d14a61c24e4d91f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// This shouldn't cause a stack overflow when rustdoc is run

use std::ops::Deref;
use std::ops::DerefMut;

pub trait SimpleTrait {
    type SimpleT;
}

impl<Inner: SimpleTrait, Outer: Deref<Target = Inner>> SimpleTrait for Outer {
    type SimpleT = Inner::SimpleT;
}

pub trait AnotherTrait {
    type AnotherT;
}

impl<T, Simple: SimpleTrait<SimpleT = Vec<T>>> AnotherTrait for Simple {
    type AnotherT = T;
}

pub struct Unrelated<Inner, UnrelatedT: DerefMut<Target = Vec<Inner>>>(UnrelatedT);

impl<Inner, UnrelatedT: DerefMut<Target = Vec<Inner>>> Deref for Unrelated<Inner, UnrelatedT> {
    type Target = Vec<Inner>;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}


pub fn main() { }