mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
23 lines
383 B
Rust
23 lines
383 B
Rust
use std::collections::BTreeSet;
|
|
|
|
#[derive(Hash)]
|
|
pub enum ElemDerived {
|
|
//~^ ERROR recursive type `ElemDerived` has infinite size
|
|
//~| ERROR cycle detected
|
|
A(ElemDerived)
|
|
}
|
|
|
|
|
|
pub enum Elem {
|
|
Derived(ElemDerived)
|
|
}
|
|
|
|
pub struct Set(BTreeSet<Elem>);
|
|
|
|
impl Set {
|
|
pub fn into_iter(self) -> impl Iterator<Item = Elem> {
|
|
self.0.into_iter()
|
|
}
|
|
}
|
|
|
|
fn main() {}
|