Add test for #72554.
This commit is contained in:
parent
d3cba254e4
commit
eb8d9002fa
20
src/test/ui/issues/issue-72554.rs
Normal file
20
src/test/ui/issues/issue-72554.rs
Normal file
@ -0,0 +1,20 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
#[derive(Hash)]
|
||||
pub enum ElemDerived { //~ ERROR recursive type `ElemDerived` has infinite size
|
||||
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() {}
|
13
src/test/ui/issues/issue-72554.stderr
Normal file
13
src/test/ui/issues/issue-72554.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0072]: recursive type `ElemDerived` has infinite size
|
||||
--> $DIR/issue-72554.rs:4:1
|
||||
|
|
||||
LL | pub enum ElemDerived {
|
||||
| ^^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
|
||||
LL | A(ElemDerived)
|
||||
| ----------- recursive without indirection
|
||||
|
|
||||
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ElemDerived` representable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0072`.
|
Loading…
x
Reference in New Issue
Block a user