Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test for #72554 #72718

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/test/ui/issues/issue-72554.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions src/test/ui/issues/issue-72554.stderr
Original file line number Diff line number Diff line change
@@ -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`.