Backed out changeset 74c58b336d30 (bug 1403213) for referencing non-existing xpcom/rust/gtest/moz.build in xpcom/moz.build. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 20 Oct 2017 21:30:36 +0200
changeset 387418 becff95c9e4cc38aec6cd731396d946e3c79a806
parent 387417 75fc6292ea459d1baa3ba8b229fb996b83c53ec7
child 387419 69998f1363be6b359dc68339892973687b4e834a
push id32717
push userarchaeopteryx@coole-files.de
push dateFri, 20 Oct 2017 22:01:38 +0000
treeherdermozilla-central@69998f1363be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1403213
milestone58.0a1
backs out74c58b336d30628e14b8ed735ae2d6dbe6cf6bbd
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 changeset 74c58b336d30 (bug 1403213) for referencing non-existing xpcom/rust/gtest/moz.build in xpcom/moz.build. r=backout on a CLOSED TREE
intl/encoding_glue/Cargo.toml
netwerk/base/rust-url-capi/Cargo.toml
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/gtest/rust/Cargo.toml
toolkit/library/rust/Cargo.lock
toolkit/library/rust/shared/Cargo.toml
xpcom/moz.build
xpcom/rust/nserror/Cargo.toml
xpcom/rust/nsstring/Cargo.toml
xpcom/rust/nsstring/gtest/Cargo.toml
xpcom/rust/nsstring/gtest/moz.build
xpcom/rust/nsstring/src/lib.rs
--- a/intl/encoding_glue/Cargo.toml
+++ b/intl/encoding_glue/Cargo.toml
@@ -7,10 +7,10 @@ license = "MIT/Apache-2.0"
 
 [features]
 simd-accel = ["encoding_rs/simd-accel"]
 no-static-ideograph-encoder-tables = ["encoding_rs/no-static-ideograph-encoder-tables"]
 parallel-utf8 = ["encoding_rs/parallel-utf8"]
 
 [dependencies]
 encoding_rs = "0.7.0"
-nsstring = { path = "../../servo/support/gecko/nsstring" }
+nsstring = { path = "../../xpcom/rust/nsstring" }
 nserror = { path = "../../xpcom/rust/nserror" }
--- a/netwerk/base/rust-url-capi/Cargo.toml
+++ b/netwerk/base/rust-url-capi/Cargo.toml
@@ -4,10 +4,10 @@ version = "0.0.1"
 authors = ["Valentin Gosu <valentin.gosu@gmail.com>"]
 
 [lib]
 name = "rust_url_capi"
 
 [dependencies]
 libc = "0.2.0"
 url = "1.5.1"
-nsstring = { path = "../../../servo/support/gecko/nsstring" }
+nsstring = { path = "../../../xpcom/rust/nsstring" }
 nserror = { path = "../../../xpcom/rust/nserror" }
--- a/toolkit/library/gtest/rust/Cargo.lock
+++ b/toolkit/library/gtest/rust/Cargo.lock
@@ -534,17 +534,17 @@ name = "geckoservo"
 version = "0.0.1"
 dependencies = [
  "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of 0.0.1",
- "nsstring 0.1.0",
+ "nsstring_vendor 0.1.0",
  "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.19.0",
  "servo_arc 0.0.1",
  "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "style 0.0.1",
  "style_traits 0.0.1",
 ]
 
@@ -879,16 +879,23 @@ dependencies = [
 [[package]]
 name = "nsstring-gtest"
 version = "0.1.0"
 dependencies = [
  "nsstring 0.1.0",
 ]
 
 [[package]]
+name = "nsstring_vendor"
+version = "0.1.0"
+dependencies = [
+ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "num-integer"
 version = "0.1.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1264,17 +1271,17 @@ dependencies = [
  "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "lru_cache 0.0.1",
  "malloc_size_of 0.0.1",
  "malloc_size_of_derive 0.0.1",
  "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "nsstring 0.1.0",
+ "nsstring_vendor 0.1.0",
  "num-integer 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
--- a/toolkit/library/gtest/rust/Cargo.toml
+++ b/toolkit/library/gtest/rust/Cargo.toml
@@ -12,17 +12,17 @@ quantum_render = ["gkrust-shared/quantum
 cubeb-remoting = ["gkrust-shared/cubeb-remoting"]
 cubeb_pulse_rust = ["gkrust-shared/cubeb_pulse_rust"]
 gecko_debug = ["gkrust-shared/gecko_debug"]
 simd-accel = ["gkrust-shared/simd-accel"]
 no-static-ideograph-encoder-tables = ["gkrust-shared/no-static-ideograph-encoder-tables"]
 
 [dependencies]
 mp4parse-gtest = { path = "../../../../dom/media/gtest" }
-nsstring-gtest = { path = "../../../../xpcom/rust/gtest/nsstring" }
+nsstring-gtest = { path = "../../../../xpcom/rust/nsstring/gtest" }
 gkrust-shared = { path = "../../rust/shared" }
 
 [lib]
 path = "lib.rs"
 crate-type = ["staticlib"]
 test = false
 doctest = false
 bench = false
--- a/toolkit/library/rust/Cargo.lock
+++ b/toolkit/library/rust/Cargo.lock
@@ -533,17 +533,17 @@ name = "geckoservo"
 version = "0.0.1"
 dependencies = [
  "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of 0.0.1",
- "nsstring 0.1.0",
+ "nsstring_vendor 0.1.0",
  "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.19.0",
  "servo_arc 0.0.1",
  "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "style 0.0.1",
  "style_traits 0.0.1",
 ]
 
@@ -867,16 +867,23 @@ dependencies = [
 [[package]]
 name = "nsstring"
 version = "0.1.0"
 dependencies = [
  "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "nsstring_vendor"
+version = "0.1.0"
+dependencies = [
+ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "num-integer"
 version = "0.1.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1256,17 +1263,17 @@ dependencies = [
  "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "lru_cache 0.0.1",
  "malloc_size_of 0.0.1",
  "malloc_size_of_derive 0.0.1",
  "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "nsstring 0.1.0",
+ "nsstring_vendor 0.1.0",
  "num-integer 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
--- a/toolkit/library/rust/shared/Cargo.toml
+++ b/toolkit/library/rust/shared/Cargo.toml
@@ -3,17 +3,17 @@ name = "gkrust-shared"
 version = "0.1.0"
 authors = ["nobody@mozilla.org"]
 license = "MPL-2.0"
 description = "Shared Rust code for libxul"
 
 [dependencies]
 geckoservo = { path = "../../../../servo/ports/geckolib", optional = true }
 mp4parse_capi = { path = "../../../../media/libstagefright/binding/mp4parse_capi" }
-nsstring = { path = "../../../../servo/support/gecko/nsstring" }
+nsstring = { path = "../../../../xpcom/rust/nsstring" }
 nserror = { path = "../../../../xpcom/rust/nserror" }
 rust_url_capi = { path = "../../../../netwerk/base/rust-url-capi" }
 webrender_bindings = { path = "../../../../gfx/webrender_bindings", optional = true }
 cubeb-pulse = { path = "../../../../media/libcubeb/cubeb-pulse-rs", optional = true, features=["pulse-dlopen"] }
 cubeb-core = { path = "../../../../media/cubeb-rs/cubeb-core", optional = true }
 cubeb = { path = "../../../../media/cubeb-rs/cubeb-api", optional = true }
 cubeb-backend = { path = "../../../../media/cubeb-rs/cubeb-backend", optional = true }
 encoding_c = "0.8.0"
@@ -27,17 +27,17 @@ syn = { version = "0.11", features = ["f
 
 [features]
 default = []
 bindgen = ["geckoservo/bindgen"]
 servo = ["geckoservo"]
 quantum_render = ["webrender_bindings"]
 cubeb-remoting = ["cubeb-core", "cubeb", "cubeb-backend", "audioipc-client", "audioipc-server"]
 cubeb_pulse_rust = ["cubeb-pulse"]
-gecko_debug = ["geckoservo/gecko_debug", "nsstring/gecko_debug"]
+gecko_debug = ["geckoservo/gecko_debug"]
 simd-accel = ["encoding_c/simd-accel", "encoding_glue/simd-accel"]
 no-static-ideograph-encoder-tables = ["encoding_c/no-static-ideograph-encoder-tables", "encoding_glue/no-static-ideograph-encoder-tables"]
 
 [lib]
 path = "lib.rs"
 test = false
 doctest = false
 bench = false
--- a/xpcom/moz.build
+++ b/xpcom/moz.build
@@ -25,18 +25,18 @@ DIRS += [
     '../chrome',
     'build',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_DEBUG']:
     DIRS += ['windbgdlg']
 
 TEST_DIRS += [
-    'rust/gtest',
     'tests',
+    'rust/nsstring/gtest',
 ]
 
 #  Can't build internal xptcall tests that use symbols which are not exported.
 #TEST_DIRS += [
 #    'reflect/xptinfo/tests',
 #    'reflect/xptcall/tests,
 #]
 
--- a/xpcom/rust/nserror/Cargo.toml
+++ b/xpcom/rust/nserror/Cargo.toml
@@ -1,9 +1,9 @@
 [package]
 name = "nserror"
 version = "0.1.0"
 authors = ["Michael Layzell <michael@thelayzells.com>"]
 license = "MPL-2.0"
 description = "Rust bindings to xpcom nsresult and NS_ERROR_ values"
 
 [dependencies]
-nsstring = { path = "../../../servo/support/gecko/nsstring" }
+nsstring = { path = "../nsstring" }
--- a/xpcom/rust/nsstring/Cargo.toml
+++ b/xpcom/rust/nsstring/Cargo.toml
@@ -1,12 +1,9 @@
 [package]
 name = "nsstring"
 version = "0.1.0"
 authors = ["nobody@mozilla.com"]
 license = "MPL-2.0"
 description = "Rust bindings to xpcom string types"
 
-[features]
-gecko_debug = []
-
 [dependencies]
 bitflags = "0.8"
--- a/xpcom/rust/nsstring/gtest/Cargo.toml
+++ b/xpcom/rust/nsstring/gtest/Cargo.toml
@@ -1,12 +1,12 @@
 [package]
 name = "nsstring-gtest"
 version = "0.1.0"
 authors = ["nobody@mozilla.com"]
 license = "MPL-2.0"
 description = "Tests for rust bindings to xpcom string types"
 
 [dependencies]
-nsstring = { path = "../../../../servo/support/gecko/nsstring" }
+nsstring = { path = "../" }
 
 [lib]
 path = "test.rs"
--- a/xpcom/rust/nsstring/gtest/moz.build
+++ b/xpcom/rust/nsstring/gtest/moz.build
@@ -1,11 +1,11 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 UNIFIED_SOURCES += [
-    'nsstring/Test.cpp',
+    'Test.cpp'
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
--- a/xpcom/rust/nsstring/src/lib.rs
+++ b/xpcom/rust/nsstring/src/lib.rs
@@ -1,12 +1,8 @@
-/* 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/. */
-
 //! This module provides rust bindings for the XPCOM string types.
 //!
 //! # TL;DR (what types should I use)
 //!
 //! Use `&{mut,} nsA[C]String` for functions in rust which wish to take or
 //! mutate XPCOM strings. The other string types `Deref` to this type.
 //!
 //! Use `ns[C]String` (`ns[C]String` in C++) for string struct members, and as
@@ -113,61 +109,61 @@
 //! which invoke their member's destructors through C++ code.
 
 #![allow(non_camel_case_types)]
 #![deny(warnings)]
 
 #[macro_use]
 extern crate bitflags;
 
-use std::borrow;
-use std::cmp;
-use std::fmt;
+use std::ops::{Deref, DerefMut};
 use std::marker::PhantomData;
+use std::borrow;
+use std::slice;
 use std::mem;
-use std::ops::{Deref, DerefMut};
-use std::os::raw::c_void;
-use std::slice;
+use std::fmt;
+use std::cmp;
 use std::str;
 use std::u32;
+use std::os::raw::c_void;
 
 ///////////////////////////////////
 // Internal Implementation Flags //
 ///////////////////////////////////
 
 mod data_flags {
     bitflags! {
         // While this has the same layout as u16, it cannot be passed
         // over FFI safely as a u16.
         #[repr(C)]
-        pub flags DataFlags: u16 {
+        pub flags DataFlags : u16 {
             const TERMINATED = 1 << 0, // IsTerminated returns true
             const VOIDED = 1 << 1, // IsVoid returns true
             const SHARED = 1 << 2, // mData points to a heap-allocated, shared buffer
             const OWNED = 1 << 3, // mData points to a heap-allocated, raw buffer
             const INLINE = 1 << 4, // mData points to a writable, inline buffer
             const LITERAL = 1 << 5, // mData points to a string literal; TERMINATED will also be set
         }
     }
 }
 
 mod class_flags {
     bitflags! {
         // While this has the same layout as u16, it cannot be passed
         // over FFI safely as a u16.
         #[repr(C)]
-        pub flags ClassFlags: u16 {
+        pub flags ClassFlags : u16 {
             const INLINE = 1 << 0, // |this|'s buffer is inline
             const NULL_TERMINATED = 1 << 1, // |this| requires its buffer is null-terminated
         }
     }
 }
 
+use data_flags::DataFlags;
 use class_flags::ClassFlags;
-use data_flags::DataFlags;
 
 ////////////////////////////////////
 // Generic String Bindings Macros //
 ////////////////////////////////////
 
 macro_rules! define_string_types {
     {
         char_t = $char_t: ty;
@@ -1003,22 +999,22 @@ impl fmt::Debug for nsAString {
 }
 
 impl cmp::PartialEq<str> for nsAString {
     fn eq(&self, other: &str) -> bool {
         other.encode_utf16().eq(self.iter().cloned())
     }
 }
 
-#[cfg(not(feature = "gecko_debug"))]
+#[cfg(not(debug_assertions))]
 #[allow(non_snake_case)]
 unsafe fn Gecko_IncrementStringAdoptCount(_: *mut c_void) {}
 
 extern "C" {
-    #[cfg(feature = "gecko_debug")]
+    #[cfg(debug_assertions)]
     fn Gecko_IncrementStringAdoptCount(data: *mut c_void);
 
     // Gecko implementation in nsSubstring.cpp
     fn Gecko_FinalizeCString(this: *mut nsACString);
 
     fn Gecko_AssignCString(this: *mut nsACString, other: *const nsACString);
     fn Gecko_TakeFromCString(this: *mut nsACString, other: *mut nsACString);
     fn Gecko_AppendCString(this: *mut nsACString, other: *const nsACString);
@@ -1056,20 +1052,27 @@ extern "C" {
 
 pub mod test_helpers {
     //! This module only exists to help with ensuring that the layout of the
     //! structs inside of rust and C++ are identical.
     //!
     //! It is public to ensure that these testing functions are avaliable to
     //! gtest code.
 
+    use super::{
+        nsCString,
+        nsString,
+        nsCStr,
+        nsStr,
+        nsCStringRepr,
+        nsStringRepr,
+        data_flags,
+        class_flags,
+    };
     use std::mem;
-    use super::{class_flags, data_flags};
-    use super::{nsCStr, nsCString, nsCStringRepr};
-    use super::{nsStr, nsString, nsStringRepr};
 
     /// Generates an #[no_mangle] extern "C" function which returns the size and
     /// alignment of the given type with the given name.
     macro_rules! size_align_check {
         ($T:ty, $fname:ident) => {
             #[no_mangle]
             #[allow(non_snake_case)]
             pub extern fn $fname(size: *mut usize, align: *mut usize) {