Auto merge of #11816 - servo:stable-style, r=nox

Make the style crate (almost) build with a stable compiler

<!-- Please describe your changes on the following line: -->

The bulk of this is adding cargo features to make derived implementations of `heapsize` and `serde` traits optional.

"Almost" because `std::intrinsics::discriminant_value` is currently unstable and doesn’t have any stable replacement that I know of. For now, this PR conditionally replaces it with `unimplemented!()`.

r? @nox

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes <s>fix</s> are part of #11815 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not <s>require tests</s> *have tests yet* because that requires https://github.com/servo/servo/issues/11806, but I still want to land this before it bitrots. (Tests should check that the build succeeds with a stable compiler.)

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11816)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-22 09:43:20 -05:00 committed by GitHub
commit 0fb5d634a0
63 changed files with 506 additions and 348 deletions

View file

@ -85,7 +85,7 @@ impl<'ln> GeckoNode<'ln> {
pub fn initialize_data(self) {
unsafe {
if self.get_node_data().is_null() {
let ptr: NonOpaqueStyleData = Box::into_raw(box RefCell::new(PrivateStyleData::new()));
let ptr: NonOpaqueStyleData = Box::into_raw(Box::new(RefCell::new(PrivateStyleData::new())));
Gecko_SetNodeData(self.node, ptr as *mut ServoNodeData);
}
}