Skip to content

Commit 576d58f

Browse files
author
bors-servo
authored
Auto merge of #2708 - Gankro:fix-enum, r=glennw
work around a rustc bug rustc tries to expand enum tags to fill padding even if the requested size is smaller. This causes any code manipulating the enum's raw repr to produce buggy results, as it will write garbage into the padding, corrupting what rustc thinks is the tag. This is being fixed upstream, but for now just work around it by making the tags the same size rustc expects. See rust-lang/rust#50098 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2708) <!-- Reviewable:end -->
2 parents 4b65822 + dc129ab commit 576d58f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webrender_api/src/display_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl LayoutPrimitiveInfo {
8989

9090
pub type LayoutPrimitiveInfo = PrimitiveInfo<LayoutPixel>;
9191

92-
#[repr(u8)]
92+
#[repr(u64)]
9393
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
9494
pub enum SpecificDisplayItem {
9595
Clip(ClipDisplayItem),
@@ -472,7 +472,7 @@ pub enum TransformStyle {
472472
// within a stacking context, rather than just the glyphs. If
473473
// this change occurs, we'll update the naming of this.
474474
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
475-
#[repr(C, u8)]
475+
#[repr(u32)]
476476
pub enum GlyphRasterSpace {
477477
// Rasterize glyphs in local-space, applying supplied scale to glyph sizes.
478478
// Best performance, but lower quality.

0 commit comments

Comments
 (0)