rust/tests/rustdoc-ui/ice-blanket-impl-56701.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
776 B
Rust
Raw Normal View History

2024-04-06 16:41:59 -05:00
//@ check-pass
// This shouldn't cause a stack overflow when rustdoc is run
2024-04-06 16:41:09 -05:00
// https://github.com/rust-lang/rust/issues/56701
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() { }