2019-11-04 00:00:00 +00:00
|
|
|
// check-pass
|
2018-09-06 14:41:12 +02:00
|
|
|
|
2018-05-12 16:43:42 -03:00
|
|
|
// Tests for nested self-reference which caused a stack overflow.
|
|
|
|
|
|
|
|
use std::fmt::Debug;
|
|
|
|
use std::ops::*;
|
|
|
|
|
|
|
|
fn gen() -> impl PartialOrd + PartialEq + Debug { }
|
|
|
|
|
|
|
|
struct Bar {}
|
|
|
|
trait Foo<T = Self> {}
|
2018-12-16 16:18:45 +03:00
|
|
|
trait FooNested<T = Option<Self>> {}
|
2018-05-12 16:43:42 -03:00
|
|
|
impl Foo for Bar {}
|
2018-12-16 16:18:45 +03:00
|
|
|
impl FooNested for Bar {}
|
2018-05-12 16:43:42 -03:00
|
|
|
|
2018-12-16 16:18:45 +03:00
|
|
|
fn foo() -> impl Foo + FooNested {
|
2018-05-12 16:43:42 -03:00
|
|
|
Bar {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_impl_ops() -> impl Add + Sub + Mul + Div { 1 }
|
|
|
|
fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { 1 }
|
|
|
|
|
|
|
|
fn main() {}
|