2019-11-04 00:00:00 +00:00
|
|
|
//@ check-pass
|
2018-09-06 12:41:12 +00:00
|
|
|
|
2018-05-12 19:43:42 +00: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 13:18:45 +00:00
|
|
|
trait FooNested<T = Option<Self>> {}
|
2018-05-12 19:43:42 +00:00
|
|
|
impl Foo for Bar {}
|
2018-12-16 13:18:45 +00:00
|
|
|
impl FooNested for Bar {}
|
2018-05-12 19:43:42 +00:00
|
|
|
|
2018-12-16 13:18:45 +00:00
|
|
|
fn foo() -> impl Foo + FooNested {
|
2018-05-12 19:43:42 +00: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() {}
|