aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/lib.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-06-22 09:43:20 -0500
committerGitHub <noreply@github.com>2016-06-22 09:43:20 -0500
commit0fb5d634a007f3d0424f95569ac3f83d500d054c (patch)
tree55550a10bb3a7220282a8905c0eae3962f92ec21 /components/util/lib.rs
parent87d991ebd24886051ad1131bdbe3b9019cb1c4b3 (diff)
parentb103e8baa7145a125f5eb02debe0947ecc24776d (diff)
downloadservo-0fb5d634a007f3d0424f95569ac3f83d500d054c.tar.gz
servo-0fb5d634a007f3d0424f95569ac3f83d500d054c.zip
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 -->
Diffstat (limited to 'components/util/lib.rs')
-rw-r--r--components/util/lib.rs56
1 files changed, 22 insertions, 34 deletions
diff --git a/components/util/lib.rs b/components/util/lib.rs
index 6417fe40a45..ff1a18ab712 100644
--- a/components/util/lib.rs
+++ b/components/util/lib.rs
@@ -2,39 +2,31 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(box_syntax)]
-#![feature(core_intrinsics)]
-#![feature(custom_derive)]
-#![feature(fnbox)]
-#![feature(plugin)]
-#![feature(reflect_marker)]
-#![feature(step_by)]
-
-#![plugin(heapsize_plugin, plugins, serde_macros)]
+#![cfg_attr(feature = "servo", feature(core_intrinsics))]
+#![cfg_attr(feature = "servo", feature(custom_derive))]
+#![cfg_attr(feature = "servo", feature(fnbox))]
+#![cfg_attr(feature = "servo", feature(plugin))]
+#![cfg_attr(feature = "servo", feature(reflect_marker))]
+#![cfg_attr(feature = "servo", plugin(serde_macros))]
#![deny(unsafe_code)]
extern crate app_units;
-extern crate backtrace;
-#[allow(unused_extern_crates)]
-#[macro_use]
-extern crate bitflags;
+#[cfg(feature = "servo")] extern crate backtrace;
+#[allow(unused_extern_crates)] #[macro_use] extern crate bitflags;
extern crate deque;
extern crate euclid;
extern crate getopts;
-extern crate heapsize;
-extern crate ipc_channel;
-#[allow(unused_extern_crates)]
-#[macro_use]
-extern crate lazy_static;
+#[macro_use] extern crate heapsize;
+#[cfg(feature = "servo")] extern crate ipc_channel;
+#[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static;
extern crate libc;
-#[macro_use]
-extern crate log;
+#[macro_use] extern crate log;
extern crate num_cpus;
extern crate num_traits;
extern crate rand;
extern crate rustc_serialize;
-extern crate serde;
+#[cfg(feature = "servo")] extern crate serde;
extern crate smallvec;
extern crate url;
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
@@ -44,28 +36,24 @@ use std::sync::Arc;
pub mod basedir;
pub mod cache;
-#[allow(unsafe_code)]
-pub mod debug_utils;
+#[allow(unsafe_code)] pub mod debug_utils;
pub mod geometry;
-#[allow(unsafe_code)]
-pub mod ipc;
-pub mod linked_list;
-#[allow(unsafe_code)]
-pub mod opts;
-pub mod panicking;
+#[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod ipc;
+#[cfg(feature = "servo")] pub mod linked_list;
+#[allow(unsafe_code)] pub mod opts;
+#[cfg(feature = "servo")] pub mod panicking;
pub mod prefs;
-pub mod print_tree;
+#[cfg(feature = "servo")] pub mod print_tree;
pub mod resource_files;
-#[allow(unsafe_code)]
pub mod str;
pub mod thread;
pub mod thread_state;
pub mod tid;
-pub mod time;
+#[cfg(feature = "servo")] pub mod time;
pub mod vec;
-#[allow(unsafe_code)]
-pub mod workqueue;
+#[allow(unsafe_code)] pub mod workqueue;
+#[cfg(feature = "servo")]
#[allow(unsafe_code)]
pub fn breakpoint() {
unsafe { ::std::intrinsics::breakpoint() };