Skip to content

non-c-like repr(u8) enum miscompilation? #50098

Closed
@Gankra

Description

@Gankra

Kinda vague since we just ran into it and it's late for me, but we're seeing a behaviour change marking

enum Foo { A(f32), B }

as #[repr(u8)] and otherwise not changing the program:

servo/webrender#2673 (comment)

Making it #[repr(C, u8)] works correctly.

All 3 layouts of the enum should be identical, so this is especially surprising that literally anything is changing. We're only seeing the issue in release builds. I can help reduce/bisect/debug this further tomorrow.

Metadata

Metadata

Assignees

Labels

I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions