rust/tests/ui/impl-trait/issues/issue-49376.rs
2024-02-16 20:02:50 +00:00

24 lines
500 B
Rust

//@ check-pass
// 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> {}
trait FooNested<T = Option<Self>> {}
impl Foo for Bar {}
impl FooNested for Bar {}
fn foo() -> impl Foo + FooNested {
Bar {}
}
fn test_impl_ops() -> impl Add + Sub + Mul + Div { 1 }
fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { 1 }
fn main() {}