From acf60be004f4ffe4230add3d2d03233e5f52065c Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 20 Sep 2017 12:34:51 -0700 Subject: [PATCH 1/5] Remove unused 'start' feature flag --- ports/servo/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/servo/main.rs b/ports/servo/main.rs index 2df41625f22..19063d1176a 100644 --- a/ports/servo/main.rs +++ b/ports/servo/main.rs @@ -15,7 +15,7 @@ //! //! [glutin]: https://github.com/tomaka/glutin -#![feature(start, core_intrinsics)] +#![feature(core_intrinsics)] #[cfg(target_os = "android")] extern crate android_injected_glue; From 9064907e14eccc1646a1f8e349f72456cfc8ceb5 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 20 Sep 2017 12:39:35 -0700 Subject: [PATCH 2/5] Remove unnecessary 'stmt_expr_attributes' feature flag --- components/script/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/script/lib.rs b/components/script/lib.rs index 008f23826c9..d150f8a6b82 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -14,7 +14,6 @@ #![feature(on_unimplemented)] #![feature(plugin)] #![feature(proc_macro)] -#![feature(stmt_expr_attributes)] #![feature(try_from)] #![feature(unboxed_closures)] #![feature(untagged_unions)] From f31c8e6673b1ef82b96dd29c342681ccfdf5af28 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 20 Sep 2017 13:19:52 -0700 Subject: [PATCH 3/5] Remove unused 'unboxed_closures' feature flag --- components/script/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/script/lib.rs b/components/script/lib.rs index d150f8a6b82..a61dee873f3 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -15,7 +15,6 @@ #![feature(plugin)] #![feature(proc_macro)] #![feature(try_from)] -#![feature(unboxed_closures)] #![feature(untagged_unions)] #![deny(unsafe_code)] From 2795e5fa9c30a5d40efb90a9064bbce9fcc9302e Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 20 Sep 2017 13:26:40 -0700 Subject: [PATCH 4/5] Stop using unstable 'unique' feature The `Unique` wrapper was only needed to provide the `Sync` trait. --- components/gfx/lib.rs | 1 - components/gfx/text/shaping/harfbuzz.rs | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index ce24b697444..97bda55b563 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -7,7 +7,6 @@ #![feature(box_syntax)] #![feature(cfg_target_feature)] #![feature(range_contains)] -#![feature(unique)] #![deny(unsafe_code)] diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index ce61dd30c0e..1069e3460ba 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -164,7 +164,7 @@ impl Shaper { Shaper::float_to_fixed(pt_size) as c_int); // configure static function callbacks. - hb_font_set_funcs(hb_font, HB_FONT_FUNCS.as_ptr(), font as *mut Font as *mut c_void, None); + hb_font_set_funcs(hb_font, HB_FONT_FUNCS.0, font as *mut Font as *mut c_void, None); Shaper { hb_face: hb_face, @@ -411,9 +411,13 @@ impl Shaper { } } -// Callbacks from Harfbuzz when font map and glyph advance lookup needed. +/// Callbacks from Harfbuzz when font map and glyph advance lookup needed. +struct FontFuncs(*mut hb_font_funcs_t); + +unsafe impl Sync for FontFuncs {} + lazy_static! { - static ref HB_FONT_FUNCS: ptr::Unique = unsafe { + static ref HB_FONT_FUNCS: FontFuncs = unsafe { let hb_funcs = hb_font_funcs_create(); hb_font_funcs_set_glyph_func(hb_funcs, Some(glyph_func), ptr::null_mut(), None); hb_font_funcs_set_glyph_h_advance_func( @@ -421,7 +425,7 @@ lazy_static! { hb_font_funcs_set_glyph_h_kerning_func( hb_funcs, Some(glyph_h_kerning_func), ptr::null_mut(), None); - ptr::Unique::new_unchecked(hb_funcs) + FontFuncs(hb_funcs) }; } From 2f030966bfc49802d2eba5fcea4464af0be27d0b Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 20 Sep 2017 15:27:00 -0700 Subject: [PATCH 5/5] Split feature gates into lines for easy grepping --- components/script_plugins/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index b35acdf3109..7548ccd92d2 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -15,7 +15,10 @@ #![deny(unsafe_code)] -#![feature(box_syntax, plugin, plugin_registrar, rustc_private)] +#![feature(box_syntax)] +#![feature(plugin)] +#![feature(plugin_registrar)] +#![feature(rustc_private)] #[macro_use] extern crate rustc;