2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-09-06 07:41:12 -05:00
|
|
|
|
2018-05-12 14:43:42 -05: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 07:18:45 -06:00
|
|
|
trait FooNested<T = Option<Self>> {}
|
2018-05-12 14:43:42 -05:00
|
|
|
impl Foo for Bar {}
|
2018-12-16 07:18:45 -06:00
|
|
|
impl FooNested for Bar {}
|
2018-05-12 14:43:42 -05:00
|
|
|
|
2018-12-16 07:18:45 -06:00
|
|
|
fn foo() -> impl Foo + FooNested {
|
2018-05-12 14:43:42 -05: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() {}
|