]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-49376.rs
Rollup merge of #101655 - dns2utf8:box_docs, r=dtolnay
[rust.git] / src / test / ui / impl-trait / issues / issue-49376.rs
1 // check-pass
2
3 // Tests for nested self-reference which caused a stack overflow.
4
5 use std::fmt::Debug;
6 use std::ops::*;
7
8 fn gen() -> impl PartialOrd + PartialEq + Debug { }
9
10 struct Bar {}
11 trait Foo<T = Self> {}
12 trait FooNested<T = Option<Self>> {}
13 impl Foo for Bar {}
14 impl FooNested for Bar {}
15
16 fn foo() -> impl Foo + FooNested {
17     Bar {}
18 }
19
20 fn test_impl_ops() -> impl Add + Sub + Mul + Div { 1 }
21 fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { 1 }
22
23 fn main() {}