Backed out 2 changesets (bug 1475197) for causing linux build bustages because of compile errors.
authorCosmin Sabou <csabou@mozilla.com>
Thu, 26 Jul 2018 07:38:47 +0300
changeset 428500 129b25a6bcfd65ef7e096d445faebdc63781ee1c
parent 428499 108e22d963cb5fe47634fd33f1d5a787920c4eb1
child 428501 c92cbb9c1b4dec5d3a00d26d94c2f8d92d5e9151
push id105700
push usershindli@mozilla.com
push dateThu, 26 Jul 2018 11:27:50 +0000
treeherdermozilla-inbound@dcf2daeeb390 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1475197
milestone63.0a1
backs out108e22d963cb5fe47634fd33f1d5a787920c4eb1
4bd5f858842255dfcc1cbe918314de324ecb2fbc
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1475197) for causing linux build bustages because of compile errors. Backed out changeset 108e22d963cb (bug 1475197) Backed out changeset 4bd5f8588422 (bug 1475197)
Cargo.lock
layout/style/test/test_selectors.html
servo/components/malloc_size_of/Cargo.toml
servo/components/malloc_size_of/lib.rs
servo/components/selectors/Cargo.toml
servo/components/selectors/attr.rs
servo/components/selectors/lib.rs
servo/components/selectors/matching.rs
servo/components/selectors/parser.rs
servo/components/style/Cargo.toml
servo/components/style/gecko/pseudo_element.rs
servo/components/style/gecko/pseudo_element_definition.mako.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/lib.rs
third_party/rust/thin-slice/.cargo-checksum.json
third_party/rust/thin-slice/Cargo.toml
third_party/rust/thin-slice/README.md
third_party/rust/thin-slice/src/lib.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1146,17 +1146,16 @@ dependencies = [
  "app_units 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "hashglobe 0.1.0",
  "selectors 0.19.0",
  "servo_arc 0.1.1",
  "smallbitvec 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "thin-slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "malloc_size_of_derive"
 version = "0.0.1"
 dependencies = [
  "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1816,17 +1815,16 @@ dependencies = [
  "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
  "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "servo_arc 0.1.1",
  "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "thin-slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "semver"
 version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1984,17 +1982,16 @@ dependencies = [
  "rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.19.0",
  "servo_arc 0.1.1",
  "smallbitvec 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "style_derive 0.0.1",
  "style_traits 0.0.1",
- "thin-slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "uluru 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2115,21 +2112,16 @@ name = "textwrap"
 version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "thin-slice"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
 name = "thread_local"
 version = "0.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2740,17 +2732,16 @@ dependencies = [
 "checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59"
 "checksum syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c67da57e61ebc7b7b6fff56bb34440ca3a83db037320b0507af4c10368deda7d"
 "checksum synstructure 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "98cad891cd238c98e1f0aec9f7c0f620aa696e4e5f7daba56ac67b5e86a6b049"
 "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
 "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
 "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
 "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
-"checksum thin-slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85b3e41c2cf31e81a7ec4ad3acd69abde19887e0f7f8e74dcdedc8cb7b158ef8"
 "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
 "checksum thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf947d192a9be60ef5131cc7a4648886ba89d712f16700ebbf80c8a69d05d48f"
 "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
 "checksum tokio-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "febd81b3e2ef615c6c8077347b33f3f3deec3d708ecd08194c9707b7a1eccfc9"
 "checksum tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ab83e7adb5677e42e405fa4ceff75659d93c4d7d7dd22f52fcec59ee9f02af"
 "checksum tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9"
 "checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"
 "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -298,24 +298,16 @@ function run() {
         ifdoc.body.innerHTML = "";
         style_text.data = "";
         test_unparseable_via_api(selector);
     }
 
     // [attr] selector
     test_parseable("[attr]")
     test_parseable_via_api("[attr");
-    test_parseable("[ATTR]")
-    should_serialize_to("[attr]", "[attr]");
-    should_serialize_to("[ATTR]", "[ATTR]");
-
-    // Whether we should drop the bar is debatable. This matches Edge
-    // and Safari at the time of writing.
-    should_serialize_to("[|attr]", "[attr]");
-    should_serialize_to("[|ATTR]", "[ATTR]");
 
     // [attr= ] selector
     test_parseable("[attr=\"x\"]");
     test_parseable("[attr='x']");
     test_parseable("[attr=x]");
     test_parseable("[attr=\"\"]");
     test_parseable("[attr='']");
     test_parseable("[attr=\"foo bar\"]");
--- a/servo/components/malloc_size_of/Cargo.toml
+++ b/servo/components/malloc_size_of/Cargo.toml
@@ -32,14 +32,13 @@ hyper_serde = { version = "0.8", optiona
 mozjs = { version = "0.7.1", features = ["promises"], optional = true }
 selectors = { path = "../selectors" }
 serde = { version = "1.0.27", optional = true }
 serde_bytes = { version = "0.10", optional = true }
 servo_arc = { path = "../servo_arc" }
 smallbitvec = "2.1.0"
 smallvec = "0.6"
 string_cache = { version = "0.7", optional = true }
-thin-slice = "0.1.0"
 time = { version = "0.1.17", optional = true }
 url = { version = "1.2", optional = true }
 webrender_api = { git = "https://github.com/servo/webrender", features = ["ipc"], optional = true }
 xml5ever = { version = "0.12", optional = true }
 void = "1.0.2"
--- a/servo/components/malloc_size_of/lib.rs
+++ b/servo/components/malloc_size_of/lib.rs
@@ -58,17 +58,16 @@ extern crate selectors;
 extern crate serde;
 #[cfg(feature = "servo")]
 extern crate serde_bytes;
 extern crate servo_arc;
 extern crate smallbitvec;
 extern crate smallvec;
 #[cfg(feature = "servo")]
 extern crate string_cache;
-extern crate thin_slice;
 #[cfg(feature = "servo")]
 extern crate time;
 #[cfg(feature = "url")]
 extern crate url;
 extern crate void;
 #[cfg(feature = "webrender_api")]
 extern crate webrender_api;
 #[cfg(feature = "servo")]
@@ -227,34 +226,16 @@ impl<T: ?Sized> MallocShallowSizeOf for 
 }
 
 impl<T: MallocSizeOf + ?Sized> MallocSizeOf for Box<T> {
     fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
         self.shallow_size_of(ops) + (**self).size_of(ops)
     }
 }
 
-impl<T> MallocShallowSizeOf for thin_slice::ThinBoxedSlice<T> {
-    fn shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        let mut n = 0;
-        unsafe {
-            n += thin_slice::ThinBoxedSlice::spilled_storage(self)
-                .map_or(0, |ptr| ops.malloc_size_of(ptr));
-            n += ops.malloc_size_of(&**self);
-        }
-        n
-    }
-}
-
-impl<T: MallocSizeOf> MallocSizeOf for thin_slice::ThinBoxedSlice<T> {
-    fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
-        self.shallow_size_of(ops) + (**self).size_of(ops)
-    }
-}
-
 impl MallocSizeOf for () {
     fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
         0
     }
 }
 
 impl<T1, T2> MallocSizeOf for (T1, T2)
     where T1: MallocSizeOf, T2: MallocSizeOf
@@ -784,17 +765,17 @@ where
             Component::LastOfType |
             Component::OnlyOfType |
             Component::Host(None) => 0,
         }
     }
 }
 
 impl<Impl: selectors::parser::SelectorImpl> MallocSizeOf
-    for selectors::attr::AttrSelectorWithOptionalNamespace<Impl>
+    for selectors::attr::AttrSelectorWithNamespace<Impl>
 {
     fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
         0
     }
 }
 
 impl MallocSizeOf for Void {
     #[inline]
--- a/servo/components/selectors/Cargo.toml
+++ b/servo/components/selectors/Cargo.toml
@@ -24,12 +24,11 @@ bitflags = "1.0"
 matches = "0.1"
 cssparser = "0.24.0"
 log = "0.4"
 fnv = "1.0"
 phf = "0.7.18"
 precomputed-hash = "0.1"
 servo_arc = { version = "0.1", path = "../servo_arc" }
 smallvec = "0.6"
-thin-slice = "0.1.0"
 
 [build-dependencies]
 phf_codegen = "0.7.18"
--- a/servo/components/selectors/attr.rs
+++ b/servo/components/selectors/attr.rs
@@ -2,30 +2,30 @@
  * 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/. */
 
 use cssparser::ToCss;
 use parser::SelectorImpl;
 use std::fmt;
 
 #[derive(Clone, Eq, PartialEq)]
-pub struct AttrSelectorWithOptionalNamespace<Impl: SelectorImpl> {
-    pub namespace: Option<NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>>,
+pub struct AttrSelectorWithNamespace<Impl: SelectorImpl> {
+    pub namespace: NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>,
     pub local_name: Impl::LocalName,
     pub local_name_lower: Impl::LocalName,
     pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
     pub never_matches: bool,
 }
 
-impl<Impl: SelectorImpl> AttrSelectorWithOptionalNamespace<Impl> {
-    pub fn namespace(&self) -> Option<NamespaceConstraint<&Impl::NamespaceUrl>> {
-        self.namespace.as_ref().map(|ns| match ns {
+impl<Impl: SelectorImpl> AttrSelectorWithNamespace<Impl> {
+    pub fn namespace(&self) -> NamespaceConstraint<&Impl::NamespaceUrl> {
+        match self.namespace {
             NamespaceConstraint::Any => NamespaceConstraint::Any,
             NamespaceConstraint::Specific((_, ref url)) => NamespaceConstraint::Specific(url),
-        })
+        }
     }
 }
 
 #[derive(Clone, Eq, PartialEq)]
 pub enum NamespaceConstraint<NamespaceUrl> {
     Any,
 
     /// Empty string for no namespace
--- a/servo/components/selectors/lib.rs
+++ b/servo/components/selectors/lib.rs
@@ -13,17 +13,16 @@ extern crate fnv;
 #[macro_use]
 extern crate log;
 #[macro_use]
 extern crate matches;
 extern crate phf;
 extern crate precomputed_hash;
 extern crate servo_arc;
 extern crate smallvec;
-extern crate thin_slice;
 
 pub mod attr;
 pub mod bloom;
 mod builder;
 pub mod context;
 pub mod matching;
 mod nth_index_cache;
 pub mod parser;
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -694,50 +694,43 @@ where
             element.attr_matches(
                 &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
                 select_name(is_html, local_name, local_name_lower),
                 &AttrSelectorOperation::Exists,
             )
         },
         Component::AttributeInNoNamespace {
             ref local_name,
+            ref local_name_lower,
             ref value,
             operator,
             case_sensitivity,
             never_matches,
         } => {
             if never_matches {
                 return false;
             }
             let is_html = element.is_html_element_in_html_document();
             element.attr_matches(
                 &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
-                local_name,
+                select_name(is_html, local_name, local_name_lower),
                 &AttrSelectorOperation::WithValue {
                     operator: operator,
                     case_sensitivity: case_sensitivity.to_unconditional(is_html),
                     expected_value: value,
                 },
             )
         },
         Component::AttributeOther(ref attr_sel) => {
             if attr_sel.never_matches {
                 return false;
             }
             let is_html = element.is_html_element_in_html_document();
-            let empty_string;
-            let namespace = match attr_sel.namespace() {
-                Some(ns) => ns,
-                None => {
-                    empty_string = ::parser::namespace_empty_string::<E::Impl>();
-                    NamespaceConstraint::Specific(&empty_string)
-                }
-            };
             element.attr_matches(
-                &namespace,
+                &attr_sel.namespace(),
                 select_name(is_html, &attr_sel.local_name, &attr_sel.local_name_lower),
                 &match attr_sel.operation {
                     ParsedAttrSelectorOperation::Exists => AttrSelectorOperation::Exists,
                     ParsedAttrSelectorOperation::WithValue {
                         operator,
                         case_sensitivity,
                         ref expected_value,
                     } => AttrSelectorOperation::WithValue {
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -1,31 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-use attr::{AttrSelectorOperator, AttrSelectorWithOptionalNamespace};
-use attr::{NamespaceConstraint, ParsedAttrSelectorOperation};
-use attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE};
+use attr::{AttrSelectorOperator, AttrSelectorWithNamespace, ParsedAttrSelectorOperation};
+use attr::{NamespaceConstraint, ParsedCaseSensitivity, SELECTOR_WHITESPACE};
 use bloom::BLOOM_HASH_MASK;
 use builder::{SelectorBuilder, SpecificityAndFlags};
 use context::QuirksMode;
 use cssparser::{BasicParseError, BasicParseErrorKind, ParseError, ParseErrorKind};
 use cssparser::{CowRcStr, Delimiter, SourceLocation};
 use cssparser::{CssStringWriter, Parser as CssParser, ToCss, Token};
 use cssparser::{parse_nth, serialize_identifier};
 use precomputed_hash::PrecomputedHash;
 use servo_arc::ThinArc;
 use sink::Push;
 use smallvec::SmallVec;
 use std::borrow::{Borrow, Cow};
 use std::fmt::{self, Debug, Display, Write};
 use std::iter::Rev;
 use std::slice;
-use thin_slice::ThinBoxedSlice;
 pub use visitor::{SelectorVisitor, Visit};
 
 /// A trait that represents a pseudo-element.
 pub trait PseudoElement: Sized + ToCss {
     /// The `SelectorImpl` this pseudo-element is used for.
     type Impl: SelectorImpl;
 
     /// Whether the pseudo-element supports a given state selector to the right
@@ -42,18 +40,16 @@ pub trait PseudoElement: Sized + ToCss {
 pub trait NonTSPseudoClass: Sized + ToCss {
     /// The `SelectorImpl` this pseudo-element is used for.
     type Impl: SelectorImpl;
 
     /// Whether this pseudo-class is :active or :hover.
     fn is_active_or_hover(&self) -> bool;
 }
 
-/// Returns a Cow::Borrowed if `s` is already ASCII lowercase, and a
-/// Cow::Owned if `s` had to be converted into ASCII lowercase.
 fn to_ascii_lowercase(s: &str) -> Cow<str> {
     if let Some(first_uppercase) = s.bytes().position(|byte| byte >= b'A' && byte <= b'Z') {
         let mut string = s.to_owned();
         string[first_uppercase..].make_ascii_lowercase();
         string.into()
     } else {
         s.into()
     }
@@ -427,39 +423,32 @@ where
                     local_name,
                     local_name_lower,
                 ) {
                     return false;
                 }
             },
             AttributeInNoNamespace {
                 ref local_name,
+                ref local_name_lower,
                 never_matches,
                 ..
             } if !never_matches =>
             {
                 if !visitor.visit_attribute_selector(
                     &NamespaceConstraint::Specific(&namespace_empty_string::<Impl>()),
                     local_name,
-                    local_name,
+                    local_name_lower,
                 ) {
                     return false;
                 }
             },
             AttributeOther(ref attr_selector) if !attr_selector.never_matches => {
-                let empty_string;
-                let namespace = match attr_selector.namespace() {
-                    Some(ns) => ns,
-                    None => {
-                        empty_string = ::parser::namespace_empty_string::<Impl>();
-                        NamespaceConstraint::Specific(&empty_string)
-                    }
-                };
                 if !visitor.visit_attribute_selector(
-                    &namespace,
+                    &attr_selector.namespace(),
                     &attr_selector.local_name,
                     &attr_selector.local_name_lower,
                 ) {
                     return false;
                 }
             },
 
             NonTSPseudoClass(ref pseudo_class) => {
@@ -821,38 +810,38 @@ pub enum Component<Impl: SelectorImpl> {
 
     ID(Impl::Identifier),
     Class(Impl::ClassName),
 
     AttributeInNoNamespaceExists {
         local_name: Impl::LocalName,
         local_name_lower: Impl::LocalName,
     },
-    // Used only when local_name is already lowercase.
     AttributeInNoNamespace {
         local_name: Impl::LocalName,
+        local_name_lower: Impl::LocalName,
         operator: AttrSelectorOperator,
         value: Impl::AttrValue,
         case_sensitivity: ParsedCaseSensitivity,
         never_matches: bool,
     },
     // Use a Box in the less common cases with more data to keep size_of::<Component>() small.
-    AttributeOther(Box<AttrSelectorWithOptionalNamespace<Impl>>),
+    AttributeOther(Box<AttrSelectorWithNamespace<Impl>>),
 
     /// Pseudo-classes
     ///
     /// CSS3 Negation only takes a simple simple selector, but we still need to
     /// treat it as a compound selector because it might be a type selector
     /// which we represent as a namespace and a localname.
     ///
     /// Note: if/when we upgrade this to CSS4, which supports combinators, we
     /// need to think about how this should interact with
     /// visit_complex_selector, and what the consumers of those APIs should do
     /// about the presence of combinators in negation.
-    Negation(ThinBoxedSlice<Component<Impl>>),
+    Negation(Box<[Component<Impl>]>),
     FirstChild,
     LastChild,
     OnlyChild,
     Root,
     Empty,
     Scope,
     NthChild(i32, i32),
     NthLastChild(i32, i32),
@@ -954,17 +943,17 @@ impl<Impl: SelectorImpl> Debug for Selec
     }
 }
 
 impl<Impl: SelectorImpl> Debug for Component<Impl> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.to_css(f)
     }
 }
-impl<Impl: SelectorImpl> Debug for AttrSelectorWithOptionalNamespace<Impl> {
+impl<Impl: SelectorImpl> Debug for AttrSelectorWithNamespace<Impl> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.to_css(f)
     }
 }
 impl<Impl: SelectorImpl> Debug for LocalName<Impl> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.to_css(f)
     }
@@ -1244,29 +1233,28 @@ impl<Impl: SelectorImpl> ToCss for Compo
                 write_affine(dest, a, b)?;
                 dest.write_char(')')
             },
             NonTSPseudoClass(ref pseudo) => pseudo.to_css(dest),
         }
     }
 }
 
-impl<Impl: SelectorImpl> ToCss for AttrSelectorWithOptionalNamespace<Impl> {
+impl<Impl: SelectorImpl> ToCss for AttrSelectorWithNamespace<Impl> {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
     where
         W: fmt::Write,
     {
         dest.write_char('[')?;
         match self.namespace {
-            Some(NamespaceConstraint::Specific((ref prefix, _))) => {
+            NamespaceConstraint::Specific((ref prefix, _)) => {
                 display_to_css_identifier(prefix, dest)?;
                 dest.write_char('|')?
             },
-            Some(NamespaceConstraint::Any) => dest.write_str("*|")?,
-            None => {}
+            NamespaceConstraint::Any => dest.write_str("*|")?,
         }
         display_to_css_identifier(&self.local_name, dest)?;
         match self.operation {
             ParsedAttrSelectorOperation::Exists => {},
             ParsedAttrSelectorOperation::WithValue {
                 operator,
                 case_sensitivity,
                 ref expected_value,
@@ -1635,18 +1623,18 @@ where
     let location = input.current_source_location();
     let operator = match input.next() {
         // [foo]
         Err(_) => {
             let local_name_lower = to_ascii_lowercase(&local_name).as_ref().into();
             let local_name = local_name.as_ref().into();
             if let Some(namespace) = namespace {
                 return Ok(Component::AttributeOther(Box::new(
-                    AttrSelectorWithOptionalNamespace {
-                        namespace: Some(namespace),
+                    AttrSelectorWithNamespace {
+                        namespace: namespace,
                         local_name: local_name,
                         local_name_lower: local_name_lower,
                         operation: ParsedAttrSelectorOperation::Exists,
                         never_matches: false,
                     },
                 )));
             } else {
                 return Ok(Component::AttributeInNoNamespaceExists {
@@ -1692,51 +1680,50 @@ where
         AttrSelectorOperator::Substring |
         AttrSelectorOperator::Suffix => value.is_empty(),
     };
 
     let mut case_sensitivity = parse_attribute_flags(input)?;
 
     let value = value.as_ref().into();
     let local_name_lower;
-    let local_name_is_ascii_lowercase;
     {
         let local_name_lower_cow = to_ascii_lowercase(&local_name);
         if let ParsedCaseSensitivity::CaseSensitive = case_sensitivity {
             if namespace.is_none() &&
                 include!(concat!(
                     env!("OUT_DIR"),
                     "/ascii_case_insensitive_html_attributes.rs"
                 )).contains(&*local_name_lower_cow)
             {
                 case_sensitivity =
                     ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument
             }
         }
         local_name_lower = local_name_lower_cow.as_ref().into();
-        local_name_is_ascii_lowercase = matches!(local_name_lower_cow, Cow::Borrowed(..));
     }
     let local_name = local_name.as_ref().into();
-    if namespace.is_some() || !local_name_is_ascii_lowercase {
+    if let Some(namespace) = namespace {
         Ok(Component::AttributeOther(Box::new(
-            AttrSelectorWithOptionalNamespace {
-                namespace,
-                local_name,
-                local_name_lower,
-                never_matches,
+            AttrSelectorWithNamespace {
+                namespace: namespace,
+                local_name: local_name,
+                local_name_lower: local_name_lower,
+                never_matches: never_matches,
                 operation: ParsedAttrSelectorOperation::WithValue {
                     operator: operator,
                     case_sensitivity: case_sensitivity,
                     expected_value: value,
                 },
             },
         )))
     } else {
         Ok(Component::AttributeInNoNamespace {
             local_name: local_name,
+            local_name_lower: local_name_lower,
             operator: operator,
             value: value,
             case_sensitivity: case_sensitivity,
             never_matches: never_matches,
         })
     }
 }
 
@@ -1793,17 +1780,17 @@ where
             Some(SimpleSelectorParseResult::SlottedPseudo(_)) => {
                 let e = SelectorParseErrorKind::NonSimpleSelectorInNegation;
                 return Err(input.new_custom_error(e));
             },
         }
     }
 
     // Success.
-    Ok(Component::Negation(sequence.into_vec().into_boxed_slice().into()))
+    Ok(Component::Negation(sequence.into_vec().into_boxed_slice()))
 }
 
 /// simple_selector_sequence
 /// : [ type_selector | universal ] [ HASH | class | attrib | pseudo | negation ]*
 /// | [ HASH | class | attrib | pseudo | negation ]+
 ///
 /// `Err(())` means invalid selector.
 /// `Ok(None)` is an empty selector
@@ -2684,16 +2671,17 @@ pub mod tests {
         );
         assert_eq!(
             parse("[attr|=\"foo\"]"),
             Ok(SelectorList::from_vec(vec![
                 Selector::from_vec(
                     vec![
                         Component::AttributeInNoNamespace {
                             local_name: DummyAtom::from("attr"),
+                            local_name_lower: DummyAtom::from("attr"),
                             operator: AttrSelectorOperator::DashMatch,
                             value: DummyAtom::from("foo"),
                             never_matches: false,
                             case_sensitivity: ParsedCaseSensitivity::CaseSensitive,
                         },
                     ],
                     specificity(0, 1, 0),
                 ),
--- a/servo/components/style/Cargo.toml
+++ b/servo/components/style/Cargo.toml
@@ -61,17 +61,16 @@ servo_arc = { path = "../servo_arc" }
 servo_atoms = {path = "../atoms", optional = true}
 servo_config = {path = "../config", optional = true}
 smallbitvec = "2.1.1"
 smallvec = "0.6"
 string_cache = { version = "0.7", optional = true }
 style_derive = {path = "../style_derive"}
 style_traits = {path = "../style_traits"}
 servo_url = {path = "../url", optional = true}
-thin-slice = "0.1.0"
 time = "0.1"
 uluru = "0.2"
 unicode-bidi = "0.3"
 unicode-segmentation = "1.0"
 void = "1.0.2"
 
 [target.'cfg(windows)'.dependencies]
 kernel32-sys = "0.2"
--- a/servo/components/style/gecko/pseudo_element.rs
+++ b/servo/components/style/gecko/pseudo_element.rs
@@ -10,17 +10,16 @@
 
 use cssparser::ToCss;
 use gecko_bindings::structs::{self, CSSPseudoElementType};
 use properties::{ComputedValues, PropertyFlags};
 use properties::longhands::display::computed_value::T as Display;
 use selector_parser::{NonTSPseudoClass, PseudoElementCascadeType, SelectorImpl};
 use std::fmt;
 use string_cache::Atom;
-use thin_slice::ThinBoxedSlice;
 use values::serialize_atom_identifier;
 
 include!(concat!(
     env!("OUT_DIR"),
     "/gecko/pseudo_element_definition.rs"
 ));
 
 impl ::selectors::parser::PseudoElement for PseudoElement {
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /// Gecko's pseudo-element definition.
 #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
 pub enum PseudoElement {
     % for pseudo in PSEUDOS:
         /// ${pseudo.value}
         % if pseudo.is_tree_pseudo_element():
-        ${pseudo.capitalized()}(ThinBoxedSlice<Atom>),
+        ${pseudo.capitalized()}(Box<[Atom]>),
         % else:
         ${pseudo.capitalized()},
         % endif
     % endfor
 }
 
 /// Important: If you change this, you should also update Gecko's
 /// nsCSSPseudoElements::IsEagerlyCascadedInServo.
@@ -204,17 +204,17 @@ impl PseudoElement {
     }
 
     /// Construct a tree pseudo-element from atom and args.
     #[inline]
     pub fn from_tree_pseudo_atom(atom: &Atom, args: Box<[Atom]>) -> Option<Self> {
         % for pseudo in PSEUDOS:
             % if pseudo.is_tree_pseudo_element():
                 if atom == &atom!("${pseudo.value}") {
-                    return Some(PseudoElement::${pseudo.capitalized()}(args.into()));
+                    return Some(PseudoElement::${pseudo.capitalized()}(args));
                 }
             % endif
         % endfor
         None
     }
 
     /// Constructs a pseudo-element from a string of text.
     ///
@@ -251,17 +251,17 @@ impl PseudoElement {
     ///
     /// Returns `None` if the pseudo-element is not recognized.
     #[inline]
     pub fn tree_pseudo_element(name: &str, args: Box<[Atom]>) -> Option<Self> {
         debug_assert!(name.starts_with("-moz-tree-"));
         let tree_part = &name[10..];
         % for pseudo in TREE_PSEUDOS:
             if tree_part.eq_ignore_ascii_case("${pseudo.value[11:]}") {
-                return Some(${pseudo_element_variant(pseudo, "args.into()")});
+                return Some(${pseudo_element_variant(pseudo, "args")});
             }
         % endfor
         None
     }
 }
 
 impl ToCss for PseudoElement {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -8,40 +8,38 @@ use cssparser::{BasicParseError, BasicPa
 use cssparser::{CowRcStr, SourceLocation, ToCss, Token};
 use element_state::{DocumentState, ElementState};
 use gecko_bindings::structs;
 use gecko_bindings::structs::RawServoSelectorList;
 use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
 use invalidation::element::document_state::InvalidationMatchingData;
 use selector_parser::{Direction, SelectorParser};
 use selectors::SelectorList;
-use selectors::parser::{self as selector_parser, Selector};
-use selectors::parser::{SelectorParseErrorKind, Visit};
+use selectors::parser::{self as selector_parser, Selector, SelectorParseErrorKind, Visit};
 use selectors::visitor::SelectorVisitor;
 use std::fmt;
 use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss as ToCss_};
-use thin_slice::ThinBoxedSlice;
 
 pub use gecko::pseudo_element::{PseudoElement, EAGER_PSEUDOS, EAGER_PSEUDO_COUNT, PSEUDO_COUNT};
 pub use gecko::snapshot::SnapshotMap;
 
 bitflags! {
     // See NonTSPseudoClass::is_enabled_in()
     struct NonTSPseudoClassFlag: u8 {
         const PSEUDO_CLASS_ENABLED_IN_UA_SHEETS = 1 << 0;
         const PSEUDO_CLASS_ENABLED_IN_CHROME = 1 << 1;
         const PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME =
             NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS.bits |
             NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_CHROME.bits;
     }
 }
 
 /// The type used for storing pseudo-class string arguments.
-pub type PseudoClassStringArg = ThinBoxedSlice<u16>;
+pub type PseudoClassStringArg = Box<[u16]>;
 
 macro_rules! pseudo_class_name {
     (bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*],
      string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*]) => {
         /// Our representation of a non tree-structural pseudo-class.
         #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
         pub enum NonTSPseudoClass {
             $(
@@ -53,17 +51,17 @@ macro_rules! pseudo_class_name {
                 $s_name(PseudoClassStringArg),
             )*
             /// The `:dir` pseudo-class.
             Dir(Box<Direction>),
             /// The non-standard `:-moz-any` pseudo-class.
             ///
             /// TODO(emilio): We disallow combinators and pseudos here, so we
             /// should use SimpleSelector instead
-            MozAny(ThinBoxedSlice<Selector<SelectorImpl>>),
+            MozAny(Box<[Selector<SelectorImpl>]>),
             /// The non-standard `:-moz-locale-dir` pseudo-class.
             MozLocaleDir(Box<Direction>),
         }
     }
 }
 apply_non_ts_list!(pseudo_class_name);
 
 impl ToCss for NonTSPseudoClass {
@@ -402,34 +400,34 @@ impl<'a, 'i> ::selectors::Parser<'i> for
             (bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*],
              string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*]) => {
                 match_ignore_ascii_case! { &name,
                     $($s_css => {
                         let name = parser.expect_ident_or_string()?;
                         // convert to null terminated utf16 string
                         // since that's what Gecko deals with
                         let utf16: Vec<u16> = name.encode_utf16().chain(Some(0u16)).collect();
-                        NonTSPseudoClass::$s_name(utf16.into_boxed_slice().into())
+                        NonTSPseudoClass::$s_name(utf16.into_boxed_slice())
                     }, )*
                     "-moz-locale-dir" => {
                         NonTSPseudoClass::MozLocaleDir(
                             Box::new(Direction::parse(parser)?)
                         )
                     },
                     "dir" => {
                         NonTSPseudoClass::Dir(
                             Box::new(Direction::parse(parser)?)
                         )
                     },
                     "-moz-any" => {
                         NonTSPseudoClass::MozAny(
                             selector_parser::parse_compound_selector_list(
                                 self,
                                 parser,
-                            )?.into()
+                            )?
                         )
                     }
                     _ => return Err(parser.new_custom_error(
                         SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name.clone())
                     ))
                 }
             }
         }
--- a/servo/components/style/lib.rs
+++ b/servo/components/style/lib.rs
@@ -88,17 +88,16 @@ extern crate servo_config;
 extern crate servo_url;
 extern crate smallbitvec;
 extern crate smallvec;
 #[cfg(feature = "servo")]
 extern crate string_cache;
 #[macro_use]
 extern crate style_derive;
 extern crate style_traits;
-extern crate thin_slice;
 extern crate time;
 extern crate uluru;
 extern crate unicode_bidi;
 #[allow(unused_extern_crates)]
 extern crate unicode_segmentation;
 extern crate void;
 
 #[macro_use]
deleted file mode 100644
--- a/third_party/rust/thin-slice/.cargo-checksum.json
+++ /dev/null
@@ -1,1 +0,0 @@
-{"files":{"Cargo.toml":"4e814457b6228f1d617315305eeda7c1d4f3510074c394a44858daced98438af","README.md":"7bbdabe6f919f88d407a9b6361bd75bd43d09c533631776ae2db1851f93a77af","src/lib.rs":"5b1f2bfc9edfc6036a8880cde88f862931eec5036e6cf63690f82921053b29fe"},"package":"85b3e41c2cf31e81a7ec4ad3acd69abde19887e0f7f8e74dcdedc8cb7b158ef8"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/thin-slice/Cargo.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
-#
-# When uploading crates to the registry Cargo will automatically
-# "normalize" Cargo.toml files for maximal compatibility
-# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g. crates.io) dependencies
-#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
-
-[package]
-name = "thin-slice"
-version = "0.1.0"
-authors = ["Cameron McCormack <cam@mcc.id.au>"]
-description = "An owned slice that packs the slice storage into a single word when possible"
-readme = "README.md"
-keywords = ["slice", "tagged", "pointer"]
-license = "MPL-2.0"
-repository = "https://github.com/heycam/thin-slice"
-
-[dependencies]
deleted file mode 100644
--- a/third_party/rust/thin-slice/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# thin-slice
-
-An owned slice that packs the slice storage into a single word when possible.
-
-## Usage
-
-```rust
-extern crate thin_slice;
-
-struct Ticket {
-    numbers: Box<[u8]>,
-    winning: bool,
-}
-
-struct ThinTicket {
-    numbers: ThinBoxedSlice<u8>,
-    winning: bool,
-}
-
-fn main() {
-    let nums = vec![4, 8, 15, 16, 23, 42].into_boxed_slice();
-    let ticket = ThinTicket {
-        numbers: nums.into(),
-        winning: false,
-    };
-    println!("Numbers: {:?}", ticket.numbers);
-
-    println!("size_of::<usize>():      {}", mem::size_of::<usize>());
-    println!("size_of::<Ticket>():     {}", mem::size_of::<Ticket>());
-    println!("size_of::<ThinTicket>(): {}", mem::size_of::<ThinTicket>());
-}
-```
-
-Output on `x86_64`:
-
-```
-size_of::<usize>():      8
-size_of::<Ticket>():     24
-size_of::<ThinTicket>(): 16
-```
-
-## License
-
-thin-slice is distributed under the terms of the
-[Mozilla Public License, v. 2.0](https://www.mozilla.org/MPL/2.0/).
deleted file mode 100644
--- a/third_party/rust/thin-slice/src/lib.rs
+++ /dev/null
@@ -1,544 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-//! An owned slice that tries to use only one word of storage.
-//!
-//! `ThinBoxedSlice<T>` can be used in place of `Box<[T]>` on the `x86_64`
-//! architecture to hold ownership of a slice when it's important to reduce
-//! memory usage of the box itself. When the slice length is less than
-//! `0xffff`, a single word is used to encode the slice pointer and length.
-//! When it is greater than `0xffff`, a heap allocation is used to store the
-//! fat pointer representing the slice.
-//!
-//! A `ThinBoxedSlice<T>` is always created by converting from a `Box<[T]>`.
-//!
-//! On any architecture other than `x86_64`, a `ThinBoxedSlice<T>` will simply
-//! use a `Box<[T]>` internally.
-//!
-//! # Examples
-//!
-//! Creating a `ThinBoxedSlice`:
-//!
-//! ```
-//! # use thin_slice::ThinBoxedSlice;
-//! let fat_pointer = vec![10, 20, 30].into_boxed_slice();
-//! let thin_pointer: ThinBoxedSlice<_> = fat_pointer.into();
-//! ```
-
-use std::cmp::Ordering;
-use std::fmt;
-use std::hash::{Hash, Hasher};
-#[cfg(target_arch = "x86_64")]
-use std::marker::PhantomData;
-#[cfg(target_arch = "x86_64")]
-use std::mem;
-use std::ops::{Deref, DerefMut};
-#[cfg(target_arch = "x86_64")]
-use std::ptr::NonNull;
-#[cfg(target_arch = "x86_64")]
-use std::slice;
-
-/// An owned slice that tries to use only one word of storage.
-///
-/// See the [module-level documentation](index.html) for more.
-pub struct ThinBoxedSlice<T> {
-    /// Storage for the slice.
-    ///
-    /// Once `std::num::NonZeroUsize` has stabilized, we can switch to that.
-    ///
-    /// The value stored here depends on the length of the slice.
-    ///
-    /// If len = 0, `data` will be `1usize`.
-    ///
-    /// If 0 < len < 0xffff, then len will be stored in the top 16 bits of
-    /// data, and the lower 48 bits will be the pointer to the elements.
-    ///
-    /// If len >= 0xffff, then the top 16 bits of data will be 0xffff, and
-    /// the lower 48 bits will be a pointer to a heap allocated `Box<[T]>`.
-    #[cfg(target_arch = "x86_64")]
-    data: NonNull<()>,
-
-    #[cfg(not(target_arch = "x86_64"))]
-    data: Box<[T]>,
-
-    #[cfg(target_arch = "x86_64")]
-    _phantom: PhantomData<Box<[T]>>,
-}
-
-#[cfg(target_arch = "x86_64")]
-const TAG_MASK: usize = 0xffff000000000000;
-
-#[cfg(target_arch = "x86_64")]
-const PTR_MASK: usize = 0x0000ffffffffffff;
-
-#[cfg(target_arch = "x86_64")]
-const PTR_HIGH: usize = 0x0000800000000000;
-
-#[cfg(target_arch = "x86_64")]
-const TAG_SHIFT: usize = 48;
-
-#[cfg(target_arch = "x86_64")]
-const TAG_LIMIT: usize = TAG_MASK >> TAG_SHIFT;
-
-#[cfg(target_arch = "x86_64")]
-enum Storage<T> {
-    Inline(*mut T, usize),
-    Spilled(*mut Box<[T]>),
-}
-
-#[cfg(target_arch = "x86_64")]
-impl<T> ThinBoxedSlice<T> {
-    /// Constructs a `ThinBoxedSlice` from a raw pointer.
-    ///
-    /// Like `Box::from_raw`, after calling this function, the raw pointer is
-    /// owned by the resulting `ThinBoxedSlice`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// let x = vec![10, 20, 30].into_boxed_slice();       // a Box<[i32]>
-    /// let ptr = Box::into_raw(x);                        // a *mut [i32]
-    /// let x = unsafe { ThinBoxedSlice::from_raw(ptr) };  // a ThinBoxedSlice<i32>
-    /// ```
-    #[inline]
-    pub unsafe fn from_raw(raw: *mut [T]) -> ThinBoxedSlice<T> {
-        let len = (*raw).len();
-        let ptr = (*raw).as_mut_ptr();
-        let storage = if len == 0 {
-            Storage::Inline(1usize as *mut _, 0)
-        } else if len < TAG_LIMIT {
-            Storage::Inline(ptr, len)
-        } else {
-            let boxed_slice = Box::from_raw(raw);
-            Storage::Spilled(Box::into_raw(Box::new(boxed_slice)))
-        };
-        ThinBoxedSlice {
-            data: storage.into_data(),
-            _phantom: PhantomData,
-        }
-    }
-
-    /// Consumes the `ThinBoxedSlice`, returning a raw pointer to the slice
-    /// it owned.
-    ///
-    /// Like `Box::into_raw`, after calling this function, the caller is
-    /// responsible for the memory previously managed by the `ThinBoxedSlice`.
-    /// In particular, the caller should properly destroy the `[T]` and release
-    /// the memory. The proper way to do so is to convert the raw pointer back
-    /// into a `Box` or a `ThinBoxedSlice`, with either the `Box::from_raw` or
-    /// `ThinBoxedSlice::from_raw` functions.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// let x = vec![10, 20, 30].into_boxed_slice();
-    /// let x = ThinBoxedSlice::from(x);
-    /// let ptr = ThinBoxedSlice::into_raw(x);
-    /// ```
-    #[inline]
-    pub fn into_raw(b: ThinBoxedSlice<T>) -> *mut [T] {
-        unsafe {
-            match b.into_storage() {
-                Storage::Inline(ptr, len) => {
-                    slice::from_raw_parts_mut(ptr, len)
-                }
-                Storage::Spilled(ptr) => {
-                    Box::into_raw(*Box::from_raw(ptr))
-                }
-            }
-        }
-    }
-
-    /// Consumes and leaks the `ThinBoxedSlice`, returning a mutable reference,
-    /// `&'a mut [T]`. Here, the lifetime `'a` may be chosen to be `'static`.
-    ///
-    /// Like `Box::leak`, this function is mainly useful for data that lives
-    /// for the remainder of the program's life. Dropping the returned
-    /// reference will cause a memory leak. If this is not acceptable, the
-    /// reference should first be wrapped with the `Box::from_raw` function
-    /// producing a `Box`, or with the `ThinBoxedSlice::from_raw` function
-    /// producing a `ThinBoxedSlice`. This value can then be dropped which will
-    /// properly destroy `[T]` and release the allocated memory.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// fn main() {
-    ///     let x = ThinBoxedSlice::from(vec![1, 2, 3].into_boxed_slice());
-    ///     let static_ref = ThinBoxedSlice::leak(x);
-    ///     static_ref[0] = 4;
-    ///     assert_eq!(*static_ref, [4, 2, 3]);
-    /// }
-    /// ```
-    #[inline]
-    pub fn leak(b: ThinBoxedSlice<T>) -> &'static mut [T] {
-        unsafe { &mut *ThinBoxedSlice::into_raw(b) }
-    }
-
-    /// Returns a pointer to the heap allocation that stores the fat pointer
-    /// to the slice, if any. This is useful for systems that need to measure
-    /// memory allocation, but is otherwise an opaque pointer.
-    #[inline]
-    pub fn spilled_storage(&self) -> Option<*const ()> {
-        match self.storage() {
-            Storage::Inline(..) => None,
-            Storage::Spilled(ptr) => Some(ptr as *const ()),
-        }
-    }
-
-    #[inline]
-    fn storage(&self) -> Storage<T> {
-        Storage::from_data(self.data.clone())
-    }
-
-    #[inline]
-    fn into_storage(self) -> Storage<T> {
-        let storage = self.storage();
-        mem::forget(self);
-        storage
-    }
-}
-
-#[cfg(not(target_arch = "x86_64"))]
-impl<T> ThinBoxedSlice<T> {
-    /// Constructs a `ThinBoxedSlice` from a raw pointer.
-    ///
-    /// Like `Box::from_raw`, after calling this function, the raw pointer is
-    /// owned by the resulting `ThinBoxedSlice`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// let x = vec![10, 20, 30].into_boxed_slice();       // a Box<[i32]>
-    /// let ptr = Box::into_raw(x);                        // a *mut [i32]
-    /// let x = unsafe { ThinBoxedSlice::from_raw(ptr) };  // a ThinBoxedSlice<i32>
-    /// ```
-    #[inline]
-    pub unsafe fn from_raw(raw: *mut [T]) -> ThinBoxedSlice<T> {
-        ThinBoxedSlice {
-            data: Box::from_raw(raw),
-        }
-    }
-
-    /// Consumes the `ThinBoxedSlice`, returning a raw pointer to the slice
-    /// it owned.
-    ///
-    /// Like `Box::into_raw`, after calling this function, the caller is
-    /// responsible for the memory previously managed by the `ThinBoxedSlice`.
-    /// In particular, the caller should properly destroy the `[T]` and release
-    /// the memory. The proper way to do so is to convert the raw pointer back
-    /// into a `Box` or a `ThinBoxedSlice`, with either the `Box::from_raw` or
-    /// `ThinBoxedSlice::from_raw` functions.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// let x = vec![10, 20, 30].into_boxed_slice();
-    /// let x = ThinBoxedSlice::from(x);
-    /// let ptr = ThinBoxedSlice::into_raw(x);
-    /// ```
-    #[inline]
-    pub fn into_raw(b: ThinBoxedSlice<T>) -> *mut [T] {
-        Box::into_raw(b.data)
-    }
-
-    /// Consumes and leaks the `ThinBoxedSlice`, returning a mutable reference,
-    /// `&'a mut [T]`. Here, the lifetime `'a` may be chosen to be `'static`.
-    ///
-    /// Like `Box::leak`, this function is mainly useful for data that lives
-    /// for the remainder of the program's life. Dropping the returned
-    /// reference will cause a memory leak. If this is not acceptable, the
-    /// reference should first be wrapped with the `Box::from_raw` function
-    /// producing a `Box`, or with the `ThinBoxedSlice::from_raw` function
-    /// producing a `ThinBoxedSlice`. This value can then be dropped which will
-    /// properly destroy `[T]` and release the allocated memory.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// # use thin_slice::ThinBoxedSlice;
-    /// fn main() {
-    ///     let x = ThinBoxedSlice::from(vec![1, 2, 3].into_boxed_slice());
-    ///     let static_ref = ThinBoxedSlice::leak(x);
-    ///     static_ref[0] = 4;
-    ///     assert_eq!(*static_ref, [4, 2, 3]);
-    /// }
-    /// ```
-    #[inline]
-    pub fn leak<'a>(b: ThinBoxedSlice<T>) -> &'a mut [T] where T: 'a {
-        Box::leak(b.data)
-    }
-
-    /// Returns a pointer to the heap allocation that stores the fat pointer
-    /// to the slice, if any. This is useful for systems that need to measure
-    /// memory allocation, but is otherwise an opaque pointer.
-    #[inline]
-    pub fn spilled_storage(&self) -> Option<*const ()> {
-        None
-    }
-}
-
-#[cfg(target_arch = "x86_64")]
-impl<T> Storage<T> {
-    #[inline]
-    fn from_data(data: NonNull<()>) -> Storage<T> {
-        let data = data.as_ptr() as usize;
-
-        let len = (data & TAG_MASK) >> TAG_SHIFT;
-        let mut ptr = data & PTR_MASK;
-
-        if (ptr & PTR_HIGH) == PTR_HIGH {
-            // Canonical linear addresses on x86_64 are sign extended from
-            // bit 48.
-            ptr |= TAG_MASK;
-        }
-
-        if len < TAG_LIMIT {
-            Storage::Inline(ptr as *mut T, len)
-        } else {
-            Storage::Spilled(ptr as *mut Box<[T]>)
-        }
-    }
-
-    #[inline]
-    fn into_data(self) -> NonNull<()> {
-        let data = match self {
-            Storage::Inline(ptr, len) => {
-                (len << TAG_SHIFT) | ((ptr as usize) & PTR_MASK)
-            }
-            Storage::Spilled(ptr) => {
-                TAG_MASK | ((ptr as usize) & PTR_MASK)
-            }
-        };
-        unsafe {
-            NonNull::new_unchecked(data as *mut _)
-        }
-    }
-}
-
-impl<T> From<Box<[T]>> for ThinBoxedSlice<T> {
-    fn from(value: Box<[T]>) -> ThinBoxedSlice<T> {
-        let ptr = Box::into_raw(value);
-        unsafe {
-            ThinBoxedSlice::from_raw(ptr)
-        }
-    }
-}
-
-impl<T> Into<Box<[T]>> for ThinBoxedSlice<T> {
-    fn into(self) -> Box<[T]> {
-        let ptr = ThinBoxedSlice::into_raw(self);
-        unsafe {
-            Box::from_raw(ptr)
-        }
-    }
-}
-
-unsafe impl<T: Send> Send for ThinBoxedSlice<T> {}
-unsafe impl<T: Sync> Sync for ThinBoxedSlice<T> {}
-
-#[cfg(target_arch = "x86_64")]
-impl<T> Drop for ThinBoxedSlice<T> {
-    fn drop(&mut self) {
-        let _ = Into::<Box<[T]>>::into(
-            ThinBoxedSlice {
-                data: self.data.clone(),
-                _phantom: PhantomData,
-            }
-        );
-    }
-}
-
-impl<T: Clone> Clone for ThinBoxedSlice<T> {
-    #[cfg(target_arch = "x86_64")]
-    fn clone(&self) -> Self {
-        unsafe {
-            match self.storage() {
-                Storage::Inline(ptr, len) => {
-                    slice::from_raw_parts_mut(ptr, len)
-                        .to_vec()
-                        .into_boxed_slice()
-                        .into()
-                }
-                Storage::Spilled(ptr) => {
-                    (*ptr).clone().into()
-                }
-            }
-        }
-    }
-
-    #[cfg(not(target_arch = "x86_64"))]
-    fn clone(&self) -> Self {
-        ThinBoxedSlice {
-            data: self.data.clone(),
-        }
-    }
-}
-
-impl<T> AsRef<[T]> for ThinBoxedSlice<T> {
-    fn as_ref(&self) -> &[T] {
-        &**self
-    }
-}
-
-impl<T> AsMut<[T]> for ThinBoxedSlice<T> {
-    fn as_mut(&mut self) -> &mut [T] {
-        &mut **self
-    }
-}
-
-impl<T> Deref for ThinBoxedSlice<T> {
-    type Target = [T];
-
-    #[cfg(target_arch = "x86_64")]
-    fn deref(&self) -> &[T] {
-        unsafe {
-            match self.storage() {
-                Storage::Inline(ptr, len) => {
-                    slice::from_raw_parts(ptr, len)
-                }
-                Storage::Spilled(ptr) => {
-                    &**ptr
-                }
-            }
-        }
-    }
-
-    #[cfg(not(target_arch = "x86_64"))]
-    fn deref(&self) -> &[T] {
-        &*self.data
-    }
-}
-
-impl<T> DerefMut for ThinBoxedSlice<T> {
-    #[cfg(target_arch = "x86_64")]
-    fn deref_mut(&mut self) -> &mut [T] {
-        unsafe {
-            match self.storage() {
-                Storage::Inline(ptr, len) => {
-                    slice::from_raw_parts_mut(ptr, len)
-                }
-                Storage::Spilled(ptr) => {
-                    &mut **ptr
-                }
-            }
-        }
-    }
-
-    #[cfg(not(target_arch = "x86_64"))]
-    fn deref_mut(&mut self) -> &mut [T] {
-        &mut *self.data
-    }
-}
-
-impl<T> Default for ThinBoxedSlice<T> {
-    fn default() -> Self {
-        Box::<[T]>::default().into()
-    }
-}
-
-impl<T: fmt::Debug> fmt::Debug for ThinBoxedSlice<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::Debug::fmt(&**self, f)
-    }
-}
-
-impl<T: Eq> Eq for ThinBoxedSlice<T> {}
-
-impl<T: Hash> Hash for ThinBoxedSlice<T> {
-    fn hash<H: Hasher>(&self, state: &mut H) {
-        (**self).hash(state);
-    }
-}
-
-impl<T: PartialEq> PartialEq for ThinBoxedSlice<T> {
-    #[inline]
-    fn eq(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialEq::eq(&**self, &**other)
-    }
-    #[inline]
-    fn ne(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialEq::ne(&**self, &**other)
-    }
-}
-
-impl<T: PartialOrd> PartialOrd for ThinBoxedSlice<T> {
-    #[inline]
-    fn partial_cmp(&self, other: &ThinBoxedSlice<T>) -> Option<Ordering> {
-        PartialOrd::partial_cmp(&**self, &**other)
-    }
-    #[inline]
-    fn lt(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialOrd::lt(&**self, &**other)
-    }
-    #[inline]
-    fn le(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialOrd::le(&**self, &**other)
-    }
-    #[inline]
-    fn ge(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialOrd::ge(&**self, &**other)
-    }
-    #[inline]
-    fn gt(&self, other: &ThinBoxedSlice<T>) -> bool {
-        PartialOrd::gt(&**self, &**other)
-    }
-}
-
-impl<T> fmt::Pointer for ThinBoxedSlice<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        let ptr = &**self;
-        fmt::Pointer::fmt(&ptr, f)
-    }
-}
-
-#[cfg(target_arch = "x86_64")]
-#[test]
-fn test_spilled_storage() {
-    let x = ThinBoxedSlice::from(vec![0; TAG_LIMIT - 1].into_boxed_slice());
-    assert!(x.spilled_storage().is_none());
-
-    let x = ThinBoxedSlice::from(vec![0; TAG_LIMIT].into_boxed_slice());
-    assert!(x.spilled_storage().is_some());
-}
-
-#[cfg(target_arch = "x86_64")]
-#[test]
-fn test_from_raw_large() {
-    let mut vec = vec![0; TAG_LIMIT];
-    vec[123] = 456;
-
-    let ptr = Box::into_raw(vec.into_boxed_slice());
-    let x = unsafe { ThinBoxedSlice::from_raw(ptr) };
-    assert_eq!(x[123], 456);
-}
-
-#[cfg(target_arch = "x86_64")]
-#[test]
-fn test_into_raw_large() {
-    let mut vec = vec![0; TAG_LIMIT];
-    vec[123] = 456;
-
-    let x = ThinBoxedSlice::from(vec.into_boxed_slice());
-    let ptr = ThinBoxedSlice::into_raw(x);
-    let y = unsafe { Box::from_raw(ptr) };
-    assert_eq!(y[123], 456);
-}
-
-#[cfg(target_arch = "x86_64")]
-#[test]
-fn test_leak_large() {
-    let mut vec = vec![0; TAG_LIMIT];
-    vec[123] = 456;
-
-    let x = ThinBoxedSlice::from(vec.into_boxed_slice());
-    let static_ref = ThinBoxedSlice::leak(x);
-    static_ref[123] *= 1000;
-    assert_eq!(static_ref[123], 456000);
-}