Skip to content

Commit

Permalink
Remove default-except-unstable
Browse files Browse the repository at this point in the history
… and use remaining unstable features unconditionally.
This doesn’t actually change the set of crates that can build on the Stable channel.
  • Loading branch information
SimonSapin committed Jul 1, 2019
1 parent d1efad6 commit bddfe9a
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 68 deletions.
5 changes: 1 addition & 4 deletions components/gfx/Cargo.toml
Expand Up @@ -13,9 +13,6 @@ path = "lib.rs"
test = false
doctest = false

[features]
unstable = ["packed_simd"]

[dependencies]
app_units = "0.7"
bitflags = "1.0"
Expand All @@ -31,7 +28,7 @@ log = "0.4"
malloc_size_of = { path = "../malloc_size_of" }
net_traits = {path = "../net_traits"}
ordered-float = "1.0"
packed_simd = {version = "0.3", optional = true}
packed_simd = "0.3"
range = {path = "../range"}
serde = "1.0"
servo_arc = {path = "../servo_arc"}
Expand Down
13 changes: 2 additions & 11 deletions components/gfx/text/glyph.rs
Expand Up @@ -4,10 +4,7 @@

use app_units::Au;
use euclid::Point2D;
#[cfg(all(
feature = "unstable",
any(target_feature = "sse2", target_feature = "neon")
))]
#[cfg(any(target_feature = "sse2", target_feature = "neon"))]
use packed_simd::u32x4;
use range::{self, EachIndex, Range, RangeIndex};
use std::cmp::{Ordering, PartialOrd};
Expand Down Expand Up @@ -75,7 +72,6 @@ pub type GlyphId = u32;
// TODO: make this more type-safe.

const FLAG_CHAR_IS_SPACE: u32 = 0x40000000;
#[cfg(feature = "unstable")]
#[cfg(any(target_feature = "sse2", target_feature = "neon"))]
const FLAG_CHAR_IS_SPACE_SHIFT: u32 = 30;
const FLAG_IS_SIMPLE_GLYPH: u32 = 0x80000000;
Expand Down Expand Up @@ -625,7 +621,6 @@ impl<'a> GlyphStore {
}

#[inline]
#[cfg(feature = "unstable")]
#[cfg(any(target_feature = "sse2", target_feature = "neon"))]
fn advance_for_byte_range_simple_glyphs(
&self,
Expand Down Expand Up @@ -672,10 +667,7 @@ impl<'a> GlyphStore {

/// When SIMD isn't available, fallback to the slow path.
#[inline]
#[cfg(not(all(
feature = "unstable",
any(target_feature = "sse2", target_feature = "neon")
)))]
#[cfg(not(any(target_feature = "sse2", target_feature = "neon")))]
fn advance_for_byte_range_simple_glyphs(
&self,
range: &Range<ByteIndex>,
Expand All @@ -686,7 +678,6 @@ impl<'a> GlyphStore {

/// Used for SIMD.
#[inline]
#[cfg(feature = "unstable")]
#[cfg(any(target_feature = "sse2", target_feature = "neon"))]
#[allow(unsafe_code)]
fn transmute_entry_buffer_to_u32_buffer(&self) -> &[u32] {
Expand Down
5 changes: 1 addition & 4 deletions components/layout_thread/Cargo.toml
Expand Up @@ -10,9 +10,6 @@ publish = false
name = "layout_thread"
path = "lib.rs"

[features]
unstable = ["parking_lot/nightly"]

[dependencies]
app_units = "0.7"
atomic_refcell = "0.1"
Expand All @@ -36,7 +33,7 @@ malloc_size_of = { path = "../malloc_size_of" }
metrics = {path = "../metrics"}
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
parking_lot = "0.8"
parking_lot = {version = "0.8", features = ["nightly"]}
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "1"
Expand Down
1 change: 0 additions & 1 deletion components/script/Cargo.toml
Expand Up @@ -15,7 +15,6 @@ path = "lib.rs"
[features]
debugmozjs = ['js/debugmozjs']
profilemozjs = ['js/profilemozjs']
unstable = []
unrooted_must_root_lint = ["script_plugins/unrooted_must_root_lint"]
webidl_lint = ["script_plugins/webidl_lint"]
default = ["unrooted_must_root_lint", "webidl_lint"]
Expand Down
5 changes: 1 addition & 4 deletions components/script/dom/bindings/conversions.rs
Expand Up @@ -69,10 +69,7 @@ pub trait IDLInterface {
}

/// A trait to mark an IDL interface as deriving from another one.
#[cfg_attr(
feature = "unstable",
rustc_on_unimplemented(message = "The IDL interface `{Self}` is not derived from `{T}`.")
)]
#[rustc_on_unimplemented(message = "The IDL interface `{Self}` is not derived from `{T}`.")]
pub trait DerivedFrom<T: Castable>: Castable {}

impl<T: Float + ToJSValConvertible> ToJSValConvertible for Finite<T> {
Expand Down
14 changes: 7 additions & 7 deletions components/script/dom/bindings/root.rs
Expand Up @@ -330,13 +330,13 @@ impl<T: DomObject> Deref for Dom<T> {

unsafe impl<T: DomObject> JSTraceable for Dom<T> {
unsafe fn trace(&self, trc: *mut JSTracer) {
#[cfg(all(feature = "unstable", debug_assertions))]
let trace_str = format!("for {} on heap", ::std::intrinsics::type_name::<T>());
#[cfg(all(feature = "unstable", debug_assertions))]
let trace_info = &trace_str[..];
#[cfg(not(all(feature = "unstable", debug_assertions)))]
let trace_info = "for DOM object on heap";

let trace_string;
let trace_info = if cfg!(debug_assertions) {
trace_string = format!("for {} on heap", ::std::intrinsics::type_name::<T>());
&trace_string[..]
} else {
"for DOM object on heap"
};
trace_reflector(trc, trace_info, (*self.ptr.as_ptr()).reflector());
}
}
Expand Down
5 changes: 1 addition & 4 deletions components/script/dom/window.rs
Expand Up @@ -938,10 +938,7 @@ impl WindowMethods for Window {

#[allow(unsafe_code)]
fn Trap(&self) {
#[cfg(feature = "unstable")]
unsafe {
::std::intrinsics::breakpoint()
}
unsafe { ::std::intrinsics::breakpoint() }
}

#[allow(unsafe_code)]
Expand Down
4 changes: 2 additions & 2 deletions components/script/lib.rs
Expand Up @@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#![cfg_attr(feature = "unstable", feature(core_intrinsics))]
#![cfg_attr(feature = "unstable", feature(on_unimplemented))]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![feature(inner_deref)]
#![feature(on_unimplemented)]
#![feature(plugin)]
#![feature(type_alias_enum_variants)]
#![deny(unsafe_code)]
Expand Down
9 changes: 1 addition & 8 deletions components/script/task.rs
Expand Up @@ -32,14 +32,7 @@ macro_rules! task {
pub trait TaskOnce: Send {
#[allow(unsafe_code)]
fn name(&self) -> &'static str {
#[cfg(feature = "unstable")]
unsafe {
::std::intrinsics::type_name::<Self>()
}
#[cfg(not(feature = "unstable"))]
{
"(task name unknown)"
}
unsafe { ::std::intrinsics::type_name::<Self>() }
}

fn run_once(self);
Expand Down
3 changes: 0 additions & 3 deletions components/servo/Cargo.toml
Expand Up @@ -26,9 +26,6 @@ uwp = ["servo_config/uwp"]
webrender_debugger = ["webrender/debugger"]
no_static_freetype = ["webrender/no_static_freetype"]
oculusvr = ["webvr/oculusvr"]
unstable = [
"script/unstable",
]
webdriver = ["webdriver_server"]
webgl_backtrace = [
"script/webgl_backtrace",
Expand Down
1 change: 0 additions & 1 deletion etc/taskcluster/decision_task.py
Expand Up @@ -185,7 +185,6 @@ def linux_tidy_unit_docs():
./mach package --dev
./mach build --dev --features raqote_backend
./mach build --dev --libsimpleservo
./mach build --dev --no-default-features --features default-except-unstable
./mach test-tidy --no-progress --self-test
./etc/memory_reports_over_time.py --test
Expand Down
4 changes: 1 addition & 3 deletions ports/glutin/Cargo.toml
Expand Up @@ -28,16 +28,14 @@ ProductName = "Servo"

[features]
azure_backend = ["libservo/azure_backend"]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
default = ["webdriver", "max_log_level"]
energy-profiling = ["libservo/energy-profiling"]
debugmozjs = ["libservo/debugmozjs"]
js_backtrace = ["libservo/js_backtrace"]
max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["libservo/native-bluetooth"]
profilemozjs = ["libservo/profilemozjs"]
raqote_backend = ["libservo/raqote_backend"]
unstable = ["libservo/unstable"]
webdriver = ["libservo/webdriver"]
webgl_backtrace = ["libservo/webgl_backtrace"]
webrender_debugger = ["libservo/webrender_debugger"]
Expand Down
2 changes: 1 addition & 1 deletion ports/glutin/main.rs
Expand Up @@ -15,7 +15,7 @@
//!
//! [glutin]: https://github.com/tomaka/glutin

#![cfg_attr(feature = "unstable", feature(core_intrinsics))]
#![feature(core_intrinsics)]

#[cfg(not(target_os = "android"))]
include!("main2.rs");
Expand Down
9 changes: 3 additions & 6 deletions ports/glutin/main2.rs
Expand Up @@ -6,7 +6,7 @@
extern crate lazy_static;
#[macro_use]
extern crate log;
#[cfg(all(feature = "unstable", any(target_os = "macos", target_os = "linux")))]
#[cfg(any(target_os = "macos", target_os = "linux"))]
#[macro_use]
extern crate sig;

Expand Down Expand Up @@ -42,13 +42,10 @@ pub mod platform {
pub fn deinit() {}
}

#[cfg(any(
not(feature = "unstable"),
not(any(target_os = "macos", target_os = "linux"))
))]
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
fn install_crash_handler() {}

#[cfg(all(feature = "unstable", any(target_os = "macos", target_os = "linux")))]
#[cfg(any(target_os = "macos", target_os = "linux"))]
fn install_crash_handler() {
use backtrace::Backtrace;
use libc::_exit;
Expand Down
4 changes: 1 addition & 3 deletions ports/libsimpleservo/api/Cargo.toml
Expand Up @@ -27,8 +27,7 @@ gl_generator = "0.11"

[features]
azure_backend = ["libservo/azure_backend"]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
default = ["webdriver", "max_log_level"]
debugmozjs = ["libservo/debugmozjs"]
energy-profiling = ["libservo/energy-profiling"]
googlevr = ["libservo/googlevr"]
Expand All @@ -40,6 +39,5 @@ no_wgl = ["libservo/no_wgl"]
oculusvr = ["libservo/oculusvr"]
raqote_backend = ["libservo/raqote_backend"]
webdriver = ["libservo/webdriver"]
unstable = ["libservo/unstable"]
uwp = ["libservo/uwp"]
webgl_backtrace = ["libservo/webgl_backtrace"]
4 changes: 1 addition & 3 deletions ports/libsimpleservo/capi/Cargo.toml
Expand Up @@ -23,8 +23,7 @@ cbindgen = "0.8"
[features]
azure_backend = ["simpleservo/azure_backend"]
debugmozjs = ["simpleservo/debugmozjs"]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
default = ["webdriver", "max_log_level"]
energy-profiling = ["simpleservo/energy-profiling"]
googlevr = ["simpleservo/googlevr"]
js_backtrace = ["simpleservo/js_backtrace"]
Expand All @@ -33,7 +32,6 @@ native-bluetooth = ["simpleservo/native-bluetooth"]
no_wgl = ["simpleservo/no_wgl"]
oculusvr = ["simpleservo/oculusvr"]
raqote_backend = ["simpleservo/raqote_backend"]
unstable = ["simpleservo/unstable"]
uwp = ["simpleservo/uwp"]
webdriver = ["simpleservo/webdriver"]
webgl_backtrace = ["simpleservo/webgl_backtrace"]
4 changes: 1 addition & 3 deletions ports/libsimpleservo/jniapi/Cargo.toml
Expand Up @@ -28,15 +28,13 @@ cc = "1.0"
[features]
azure_backend = ["simpleservo/azure_backend"]
debugmozjs = ["simpleservo/debugmozjs"]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
default = ["webdriver", "max_log_level"]
energy-profiling = ["simpleservo/energy-profiling"]
googlevr = ["simpleservo/googlevr"]
js_backtrace = ["simpleservo/js_backtrace"]
max_log_level = ["simpleservo/max_log_level"]
native-bluetooth = ["simpleservo/native-bluetooth"]
oculusvr = ["simpleservo/oculusvr"]
raqote_backend = ["simpleservo/raqote_backend"]
unstable = ["simpleservo/unstable"]
webdriver = ["simpleservo/webdriver"]
webgl_backtrace = ["simpleservo/webgl_backtrace"]

0 comments on commit bddfe9a

Please sign in to comment.