diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-13 21:43:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-13 21:43:09 -0500 |
commit | 86a5135ffaa60d4743b6f6950fc395c2615e85ba (patch) | |
tree | ed0e65587ac5c4c5a27dbfeee1c9135bafbbd8ec /components/layout/table.rs | |
parent | f0b8dad063b459db12ac27d44afff32cd6923d30 (diff) | |
parent | b505c9e94817847e19f22854b2ee4258f66f18d2 (diff) | |
download | servo-86a5135ffaa60d4743b6f6950fc395c2615e85ba.tar.gz servo-86a5135ffaa60d4743b6f6950fc395c2615e85ba.zip |
Auto merge of #18870 - servo:cast, r=KiChjang
Use pointer casts instead of tramsutes to raw::TraitObject
Casting `*const T` to `*const U` with `U: Sized` is allowed even if `T: ?Sized`. This safely extracts the data pointer out of a trait object, without relying on the memory representation of trait objects.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18870)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/table.rs')
-rw-r--r-- | components/layout/table.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/layout/table.rs b/components/layout/table.rs index a0c7c69ce85..7009e4ec60b 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -34,10 +34,14 @@ use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderP use table_row::TableRowFlow; use table_wrapper::TableLayout; +#[allow(unsafe_code)] +unsafe impl ::flow::HasBaseFlow for TableFlow {} + /// A table flow corresponded to the table's internal table fragment under a table wrapper flow. /// The properties `position`, `float`, and `margin-*` are used on the table wrapper fragment, /// not table fragment per CSS 2.1 § 10.5. #[derive(Serialize)] +#[repr(C)] pub struct TableFlow { pub block_flow: BlockFlow, |