Skip to content

Add test self-in-enum-definition #62916

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

Merged
merged 2 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Refer to #50072 re. hack.
  • Loading branch information
Centril committed Jul 24, 2019
commit 7fdfe8b85476f5178df651dd836d556c2bf7917f
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[repr(u8)]
enum Alpha {
V1 = 41,
V2 = Self::V1 as u8 + 1, // OK -- but why?
V2 = Self::V1 as u8 + 1, // OK; See #50072.
V3 = Self::V1 {} as u8 + 2, //~ ERROR cycle detected when const-evaluating
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ note: cycle used when collecting item types in top-level module
LL | / #[repr(u8)]
LL | | enum Alpha {
LL | | V1 = 41,
LL | | V2 = Self::V1 as u8 + 1, // OK -- but why?
LL | | V2 = Self::V1 as u8 + 1, // OK; See #50072.
... |
LL | |
LL | | fn main() {}
Expand Down