mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
34 lines
711 B
Rust
34 lines
711 B
Rust
// 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() { }
|