Backed out 7 changesets (bug 1231764) for apparently causing linux debug wpt bustage
authorWes Kocher <wkocher@mozilla.com>
Wed, 03 Aug 2016 16:27:06 -0700
changeset 308128 5d2cfad6ba812bf6c219a17a8817b218ea9406d8
parent 308127 477ce21512ea8fbadc91ab93a0fae1ea7eb2fe55
child 308129 9112f5b17a3fed28c539cadcd345501b74e22a95
push id30528
push usercbook@mozilla.com
push dateThu, 04 Aug 2016 13:58:28 +0000
treeherdermozilla-central@0ba72e8027cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1231764
milestone51.0a1
backs out4b71272c92cf52dfcb7dff8f6867136e05585a99
234d8a930afaf01a3cc4e3cd9da9e7b81630e3a3
f9b204c2f5a7c2375276b49253ff9188c9bc32d7
f933119e57e43696881327fd2b3c730388b301b5
e3af0b1d3473482b91a90f9cdccdbf62e60df7cb
643b03aae1dd2fec67f295fd56bcb5043288e3ae
a945dbf63410b72c7b63eafebfb08fd6f3567a00
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 7 changesets (bug 1231764) for apparently causing linux debug wpt bustage Backed out changeset 4b71272c92cf (bug 1231764) Backed out changeset 234d8a930afa (bug 1231764) Backed out changeset f9b204c2f5a7 (bug 1231764) Backed out changeset f933119e57e4 (bug 1231764) Backed out changeset e3af0b1d3473 (bug 1231764) Backed out changeset 643b03aae1dd (bug 1231764) Backed out changeset a945dbf63410 (bug 1231764)
build/moz.configure/rust.configure
build/templates.mozbuild
build/virtualenv_packages.txt
config/rules.mk
dom/media/gtest/Cargo.toml
dom/media/gtest/moz.build
media/libstagefright/binding/mp4parse-cargo.patch
media/libstagefright/binding/mp4parse/Cargo.toml
media/libstagefright/binding/update-rust.sh
media/libstagefright/moz.build
python/mozbuild/mozbuild/backend/common.py
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/frontend/data.py
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-absolute-path/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-absolute-path/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-nonexistent-path/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-nonexistent-path/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/ok/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-version-only/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-version-only/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-with-dict/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-with-dict/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-absolute-path/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-absolute-path/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-nonexistent-path/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-nonexistent-path/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/ok/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-version-only/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-version-only/moz.build
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-with-dict/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/crate-dependency-with-dict/moz.build
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-one/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-one/duplicate/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-two/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-two/duplicate/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/moz.build
python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build
python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build
python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build
python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build
python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
python/pytoml/PKG-INFO
python/pytoml/pytoml/__init__.py
python/pytoml/pytoml/core.py
python/pytoml/pytoml/parser.py
python/pytoml/pytoml/writer.py
python/pytoml/setup.cfg
python/pytoml/setup.py
python/pytoml/test/test.py
toolkit/library/gtest/moz.build
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/gtest/rust/Cargo.toml
toolkit/library/gtest/rust/lib.rs
toolkit/library/gtest/rust/moz.build
toolkit/library/moz.build
toolkit/library/rust/Cargo.lock
toolkit/library/rust/Cargo.toml
toolkit/library/rust/lib.rs
toolkit/library/rust/moz.build
toolkit/toolkit.mozbuild
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -6,48 +6,28 @@
 
 option('--enable-rust', help='Include Rust language sources')
 
 @depends('--enable-rust')
 def rust_compiler_names(value):
     if value:
         return ['rustc']
 
-@depends('--enable-rust')
-def cargo_binary_names(value):
-    if value:
-        return ['cargo']
-
 rustc = check_prog('RUSTC', rust_compiler_names, allow_missing=True)
-cargo = check_prog('CARGO', cargo_binary_names, allow_missing=True)
 
 @depends_if(rustc)
 @checking('rustc version', lambda info: info.version)
 def rustc_info(rustc):
         out = check_cmd_output(rustc, '--version', '--verbose').splitlines()
         info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
         return namespace(
             version=Version(info.get('release', '0')),
             commit=info.get('commit-hash', 'unknown'),
         )
 
-@depends_if(cargo)
-@checking('cargo support for --frozen')
-@imports('subprocess')
-def cargo_supports_frozen(cargo):
-    try:
-        lines = subprocess.check_output(
-            [cargo, 'help', 'build']
-        ).splitlines()
-        return any('    --frozen' in l for l in lines)
-    except subprocess.CalledProcessError as e:
-        die('Failed to call cargo: %s', e.message)
-
-set_config('MOZ_CARGO_SUPPORTS_FROZEN', cargo_supports_frozen)
-
 @depends('--enable-rust', rustc, rustc_info)
 @imports(_from='textwrap', _import='dedent')
 def rust_compiler(value, rustc, rustc_info):
     if value:
         if not rustc:
             die(dedent('''\
             Rust compiler not found.
             To compile rust language sources, you must have 'rustc' in your path.
@@ -114,17 +94,20 @@ def rust_target(rust_compiler, rustc, ta
             # Windows
             # XXX better detection of CXX needed here, to figure out whether
             # we need i686-pc-windows-gnu instead, since mingw32 builds work.
             ('x86', 'WINNT'): 'i686-pc-windows-msvc',
             ('x86_64', 'WINNT'): 'x86_64-pc-windows-msvc',
         }.get((target.cpu, os_or_kernel), None)
 
         if rustc_target is None:
-            die("Don't know how to translate {} for rustc".format(target.alias))
+            if cross_compiling:
+                die("Don't know how to translate {} for rustc".format(target.alias))
+            # Fall back to implicit (native) target when not cross-compiling
+            return None
 
         # Check to see whether our rustc has a reasonably functional stdlib
         # for our chosen target.
         target_arg = '--target=' + rustc_target
         in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs')
         out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
         os.close(out_fd)
         try:
@@ -147,16 +130,16 @@ def rust_target(rust_compiler, rustc, ta
                 die('Cannot compile for {} with {}'.format(target.alias, rustc))
             check_cmd_output(*cmd, onerror=failed)
             if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
                 failed()
         finally:
             os.remove(in_path)
             os.remove(out_path)
         # This target is usable.
-        return rustc_target
+        return target_arg
 
 set_config('RUST_TARGET', rust_target)
 
 # Until we remove all the other Rust checks in old-configure.
 add_old_configure_assignment('MOZ_RUST', rust_compiler)
 add_old_configure_assignment('RUSTC', rustc)
 add_old_configure_assignment('RUST_TARGET', rust_target)
--- a/build/templates.mozbuild
+++ b/build/templates.mozbuild
@@ -59,24 +59,16 @@ def CppUnitTests(names, ext='.cpp'):
 
 @template
 def Library(name):
     '''Template for libraries.'''
     LIBRARY_NAME = name
 
 
 @template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-@template
 def SharedLibrary(name):
     '''Template for shared libraries.'''
     Library(name)
 
     FORCE_SHARED_LIB = True
 
     Binary()
 
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -31,9 +31,8 @@ pyasn1_modules.pth:python/pyasn1-modules
 bitstring.pth:python/bitstring
 redo.pth:python/redo
 requests.pth:python/requests
 rsa.pth:python/rsa
 futures.pth:python/futures
 ecc.pth:python/PyECC
 xpcshell.pth:testing/xpcshell
 pyyaml.pth:python/pyyaml/lib
-pytoml.pth:python/pytoml
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -235,19 +235,20 @@ endif
 COBJS = $(notdir $(CSRCS:.c=.$(OBJ_SUFFIX)))
 SOBJS = $(notdir $(SSRCS:.S=.$(OBJ_SUFFIX)))
 # CPPSRCS can have different extensions (eg: .cpp, .cc)
 CPPOBJS = $(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(CPPSRCS))))
 CMOBJS = $(notdir $(CMSRCS:.m=.$(OBJ_SUFFIX)))
 CMMOBJS = $(notdir $(CMMSRCS:.mm=.$(OBJ_SUFFIX)))
 # ASFILES can have different extensions (.s, .asm)
 ASOBJS = $(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(ASFILES))))
+RSOBJS = $(addprefix lib,$(notdir $(RSSRCS:.rs=.rlib)))
 RS_STATICLIB_CRATE_OBJ = $(addprefix lib,$(notdir $(RS_STATICLIB_CRATE_SRC:.rs=.$(LIB_SUFFIX))))
 ifndef OBJS
-_OBJS = $(COBJS) $(SOBJS) $(CPPOBJS) $(CMOBJS) $(CMMOBJS) $(ASOBJS)
+_OBJS = $(COBJS) $(SOBJS) $(CPPOBJS) $(CMOBJS) $(CMMOBJS) $(ASOBJS) $(RSOBJS) $(RS_STATICLIB_CRATE_OBJ)
 OBJS = $(strip $(_OBJS))
 endif
 
 HOST_COBJS = $(addprefix host_,$(notdir $(HOST_CSRCS:.c=.$(OBJ_SUFFIX))))
 # HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
 HOST_CPPOBJS = $(addprefix host_,$(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(HOST_CPPSRCS)))))
 HOST_CMOBJS = $(addprefix host_,$(notdir $(HOST_CMSRCS:.m=.$(OBJ_SUFFIX))))
 HOST_CMMOBJS = $(addprefix host_,$(notdir $(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX))))
@@ -560,17 +561,17 @@ GLOBAL_DEPS += Makefile $(addprefix $(DE
 ##############################################
 ifdef COMPILE_ENVIRONMENT
 OBJ_TARGETS = $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS)
 
 compile:: host target
 
 host:: $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
 
-target:: $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(RUST_LIBRARY_FILE)
+target:: $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS)
 
 include $(MOZILLA_DIR)/config/makefiles/target_binaries.mk
 endif
 
 ##############################################
 ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
 ifdef MOZ_PROFILE_USE
 ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
@@ -909,42 +910,26 @@ ifdef ASFILES
 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
 # a '-c' flag.
 $(ASOBJS):
 	$(REPORT_BUILD_VERBOSE)
 	$(AS) $(ASOUTOPTION)$@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)
 endif
 
 ifdef MOZ_RUST
-ifdef CARGO_FILE
-
-ifdef MOZ_DEBUG
-cargo_build_flags =
-else
-cargo_build_flags = --release
-endif
-ifdef MOZ_CARGO_SUPPORTS_FROZEN
-cargo_build_flags += --frozen
-endif
+# Assume any system libraries rustc links against are already
+# in the target's LIBS.
+$(RSOBJS):
+	$(REPORT_BUILD)
+	$(RUSTC) $(RUST_TARGET) $(RUSTFLAGS) --crate-type rlib --emit dep-info=$(MDDEPDIR)/$(call mk_libname,$<).pp,link=$(call mk_libname,$<) $(_VPATH_SRCS)
 
-cargo_build_flags += --manifest-path $(CARGO_FILE)
-cargo_build_flags += --target=$(RUST_TARGET)
-
-# Assume any system libraries rustc links against are already in the target's LIBS.
-#
-# We need to run cargo unconditionally, because cargo is the only thing that
-# has full visibility into how changes in Rust sources might affect the final
-# build.
-force-cargo-build:
+$(RS_STATICLIB_CRATE_OBJ):
 	$(REPORT_BUILD)
-	env CARGO_TARGET_DIR=. RUSTC=$(RUSTC) $(CARGO) build $(cargo_build_flags) --
-
-$(RUST_LIBRARY_FILE): force-cargo-build
-endif # CARGO_FILE
-endif # MOZ_RUST
+	$(RUSTC) $(RUST_TARGET) $(RUSTFLAGS) --crate-type staticlib $(RLIB_EXTERN_CRATE_OPTIONS) --emit dep-info=$(MDDEPDIR)/$(call mk_global_crate_libname,$(RS_STATICLIB_CRATE_SRC)).pp,link=$@ $(RS_STATICLIB_CRATE_SRC)
+endif
 
 $(SOBJS):
 	$(REPORT_BUILD)
 	$(AS) -o $@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(LOCAL_INCLUDES) -c $<
 
 $(CPPOBJS):
 	$(REPORT_BUILD_VERBOSE)
 	$(call BUILDSTATUS,OBJECT_FILE $@)
deleted file mode 100644
--- a/dom/media/gtest/Cargo.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-[package]
-name = "mp4parse-gtest"
-version = "0.1.0"
-authors = ["nobody@mozilla.org"]
-
-[lib]
-path = "hello.rs"
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -32,16 +32,17 @@ if CONFIG['MOZ_EME']:
 
 if CONFIG['MOZ_WEBM_ENCODER']:
     UNIFIED_SOURCES += [
         'TestVideoTrackEncoder.cpp',
         'TestWebMWriter.cpp',
     ]
 
 if CONFIG['MOZ_RUST']:
+    SOURCES += ['hello.rs',]
     UNIFIED_SOURCES += ['TestRust.cpp',]
 
 
 TEST_HARNESS_FILES.gtest += [
     '../test/gizmo-frag.mp4',
     '../test/gizmo.mp4',
     '../test/vp9cake.webm',
     'dash_dashinit.mp4',
deleted file mode 100644
--- a/media/libstagefright/binding/mp4parse-cargo.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/media/libstagefright/binding/mp4parse/Cargo.toml
-+++ b/media/libstagefright/binding/mp4parse/Cargo.toml
-@@ -17,23 +17,6 @@ exclude = [
-   "*.mp4",
- ]
- 
--build = "build.rs"
--
--[dependencies]
--byteorder = "0.5.0"
--afl = { version = "0.1.1", optional = true }
--afl-plugin = { version = "0.1.1", optional = true }
--abort_on_panic = { version = "1.0.0", optional = true }
--
--[dev-dependencies]
--test-assembler = "0.1.2"
--
--[build-dependencies]
--rusty-cheddar = "0.3.2"
--
--[features]
--fuzz = ["afl", "afl-plugin", "abort_on_panic"]
--
- # Somewhat heavy-handed, but we want at least -Z force-overflow-checks=on.
- [profile.release]
- debug-assertions = true
--- a/media/libstagefright/binding/mp4parse/Cargo.toml
+++ b/media/libstagefright/binding/mp4parse/Cargo.toml
@@ -12,11 +12,28 @@ license = "MPL-2.0"
 repository = "https://github.com/mozilla/mp4parse-rust"
 
 # Cargo includes random files from the working directory
 # by default! Avoid bloating the package with test files.
 exclude = [
   "*.mp4",
 ]
 
+build = "build.rs"
+
+[dependencies]
+byteorder = "0.5.0"
+afl = { version = "0.1.1", optional = true }
+afl-plugin = { version = "0.1.1", optional = true }
+abort_on_panic = { version = "1.0.0", optional = true }
+
+[dev-dependencies]
+test-assembler = "0.1.2"
+
+[build-dependencies]
+rusty-cheddar = "0.3.2"
+
+[features]
+fuzz = ["afl", "afl-plugin", "abort_on_panic"]
+
 # Somewhat heavy-handed, but we want at least -Z force-overflow-checks=on.
 [profile.release]
 debug-assertions = true
--- a/media/libstagefright/binding/update-rust.sh
+++ b/media/libstagefright/binding/update-rust.sh
@@ -33,14 +33,13 @@ popd
 rm -rf mp4parse/src/byteorder
 mkdir mp4parse/src/byteorder
 cp _upstream/byteorder/src/lib.rs mp4parse/src/byteorder/mod.rs
 cp _upstream/byteorder/src/new.rs mp4parse/src/byteorder/new.rs
 
 echo "Applying patches..."
 patch -p4 < byteorder-mod.patch
 patch -p4 < mp4parse-mod.patch
-patch -p4 < mp4parse-cargo.patch
 
 echo "Cleaning up..."
 rm -rf _upstream
 
 echo "Updated to ${VER}."
--- a/media/libstagefright/moz.build
+++ b/media/libstagefright/moz.build
@@ -75,16 +75,19 @@ SOURCES += [
     'frameworks/av/media/libstagefright/MetaData.cpp',
     'system/core/libutils/RefBase.cpp',
     'system/core/libutils/String16.cpp',
     'system/core/libutils/String8.cpp',
     'system/core/libutils/VectorImpl.cpp',
 ]
 
 if CONFIG['MOZ_RUST']:
+    SOURCES += [
+        'binding/mp4parse/src/lib.rs',
+    ]
     EXPORTS += [
         'binding/include/mp4parse.h',
     ]
 
 UNIFIED_SOURCES += [
     'binding/Adts.cpp',
     'binding/AnnexB.cpp',
     'binding/Box.cpp',
--- a/python/mozbuild/mozbuild/backend/common.py
+++ b/python/mozbuild/mozbuild/backend/common.py
@@ -25,16 +25,17 @@ from mozbuild.frontend.data import (
     ExampleWebIDLInterface,
     IPDLFile,
     FinalTargetPreprocessedFiles,
     FinalTargetFiles,
     GeneratedEventWebIDLFile,
     GeneratedWebIDLFile,
     PreprocessedTestWebIDLFile,
     PreprocessedWebIDLFile,
+    RustRlibLibrary,
     SharedLibrary,
     TestManifest,
     TestWebIDLFile,
     UnifiedSources,
     XPIDLFile,
     WebIDLFile,
 )
 from mozbuild.jar import (
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -54,17 +54,17 @@ from ..frontend.data import (
     JARManifest,
     JavaJarData,
     Library,
     LocalInclude,
     ObjdirFiles,
     ObjdirPreprocessedFiles,
     PerSourceFlag,
     Program,
-    RustLibrary,
+    RustRlibLibrary,
     SharedLibrary,
     SimpleProgram,
     Sources,
     StaticLibrary,
     TestManifest,
     VariablePassthru,
     XPIDLFile,
 )
@@ -572,21 +572,19 @@ class RecursiveMakeBackend(CommonBackend
             # automated.
             if isinstance(obj.wrapped, JavaJarData):
                 self._process_java_jar_data(obj.wrapped, backend_file)
             elif isinstance(obj.wrapped, AndroidEclipseProjectData):
                 self._process_android_eclipse_project_data(obj.wrapped, backend_file)
             else:
                 return False
 
-        elif isinstance(obj, RustLibrary):
-            self.backend_input_files.add(obj.cargo_file)
-            self._process_rust_library(obj, backend_file)
-            # No need to call _process_linked_libraries, because Rust
-            # libraries are self-contained objects at this point.
+        elif isinstance(obj, RustRlibLibrary):
+            # Nothing to do because |Sources| has done the work for us.
+            pass
 
         elif isinstance(obj, SharedLibrary):
             self._process_shared_library(obj, backend_file)
             self._process_linked_libraries(obj, backend_file)
 
         elif isinstance(obj, StaticLibrary):
             self._process_static_library(obj, backend_file)
             self._process_linked_libraries(obj, backend_file)
@@ -1159,40 +1157,47 @@ class RecursiveMakeBackend(CommonBackend
             backend_file.write('IS_COMPONENT := 1\n')
         if libdef.soname:
             backend_file.write('DSO_SONAME := %s\n' % libdef.soname)
         if libdef.is_sdk:
             backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
         if libdef.symbols_file:
             backend_file.write('SYMBOLS_FILE := %s\n' % libdef.symbols_file)
 
+        rust_rlibs = [o for o in libdef.linked_libraries if isinstance(o, RustRlibLibrary)]
+        if rust_rlibs:
+            # write out Rust file with extern crate declarations.
+            extern_crate_file = mozpath.join(libdef.objdir, 'rul.rs')
+            with self._write_file(extern_crate_file) as f:
+                f.write('// AUTOMATICALLY GENERATED.  DO NOT EDIT.\n\n')
+                for rlib in rust_rlibs:
+                    f.write('extern crate %s;\n' % rlib.crate_name)
+
+            backend_file.write('RS_STATICLIB_CRATE_SRC := %s\n' % extern_crate_file)
+
     def _process_static_library(self, libdef, backend_file):
         backend_file.write_once('LIBRARY_NAME := %s\n' % libdef.basename)
         backend_file.write('FORCE_STATIC_LIB := 1\n')
         backend_file.write('REAL_LIBRARY := %s\n' % libdef.lib_name)
         if libdef.is_sdk:
             backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
         if libdef.no_expand_lib:
             backend_file.write('NO_EXPAND_LIBS := 1\n')
 
-    def _process_rust_library(self, libdef, backend_file):
-        backend_file.write_once('RUST_LIBRARY_FILE := %s\n' % libdef.import_name)
-        backend_file.write('CARGO_FILE := $(srcdir)/Cargo.toml')
-
     def _process_host_library(self, libdef, backend_file):
         backend_file.write('HOST_LIBRARY_NAME = %s\n' % libdef.basename)
 
     def _build_target_for_obj(self, obj):
         return '%s/%s' % (mozpath.relpath(obj.objdir,
             self.environment.topobjdir), obj.KIND)
 
     def _process_linked_libraries(self, obj, backend_file):
         def write_shared_and_system_libs(lib):
             for l in lib.linked_libraries:
-                if isinstance(l, (StaticLibrary, RustLibrary)):
+                if isinstance(l, StaticLibrary):
                     write_shared_and_system_libs(l)
                 else:
                     backend_file.write_once('SHARED_LIBS += %s/%s\n'
                         % (pretty_relpath(l), l.import_name))
             for l in lib.linked_system_libs:
                 backend_file.write_once('OS_LIBS += %s\n' % l)
 
         def pretty_relpath(lib):
@@ -1204,25 +1209,24 @@ class RecursiveMakeBackend(CommonBackend
         self._compile_graph[build_target]
 
         for lib in obj.linked_libraries:
             if not isinstance(lib, ExternalLibrary):
                 self._compile_graph[build_target].add(
                     self._build_target_for_obj(lib))
             relpath = pretty_relpath(lib)
             if isinstance(obj, Library):
-                if isinstance(lib, RustLibrary):
-                    # We don't need to do anything here; we will handle
-                    # linkage for any RustLibrary elsewhere.
-                    continue
-                elif isinstance(lib, StaticLibrary):
+                if isinstance(lib, StaticLibrary):
                     backend_file.write_once('STATIC_LIBS += %s/%s\n'
                                         % (relpath, lib.import_name))
                     if isinstance(obj, SharedLibrary):
                         write_shared_and_system_libs(lib)
+                elif isinstance(lib, RustRlibLibrary):
+                    backend_file.write_once('RLIB_EXTERN_CRATE_OPTIONS += --extern %s=%s/%s\n'
+                                            % (lib.crate_name, relpath, lib.rlib_filename))
                 elif isinstance(obj, SharedLibrary):
                     assert lib.variant != lib.COMPONENT
                     backend_file.write_once('SHARED_LIBS += %s/%s\n'
                                         % (relpath, lib.import_name))
             elif isinstance(obj, (Program, SimpleProgram)):
                 if isinstance(lib, StaticLibrary):
                     backend_file.write_once('STATIC_LIBS += %s/%s\n'
                                         % (relpath, lib.import_name))
@@ -1231,38 +1235,23 @@ class RecursiveMakeBackend(CommonBackend
                     assert lib.variant != lib.COMPONENT
                     backend_file.write_once('SHARED_LIBS += %s/%s\n'
                                         % (relpath, lib.import_name))
             elif isinstance(obj, (HostLibrary, HostProgram, HostSimpleProgram)):
                 assert isinstance(lib, HostLibrary)
                 backend_file.write_once('HOST_LIBS += %s/%s\n'
                                    % (relpath, lib.import_name))
 
-        # We have to link any Rust libraries after all intermediate static
-        # libraries have been listed to ensure that the Rust libraries are
+        # We have to link the Rust super-crate after all intermediate static
+        # libraries have been listed to ensure that the Rust objects are
         # searched after the C/C++ objects that might reference Rust symbols.
-        # Building Rust crates normally takes care of Rust->Rust linkage, but
-        # we have to be careful: a savvy user might have specified that there
-        # is a staticlib (that contains the Rust runtime) and several other
-        # rlibs (which are plain archive files) to be linked into a given
-        # library.  We need to ensure that the staticlib comes after the
-        # rlibs to ensure symbols are found correctly.
-        if isinstance(obj, SharedLibrary) and any(isinstance(o, RustLibrary)
+        # Building the Rust super-crate will take care of Rust->Rust linkage.
+        if isinstance(obj, SharedLibrary) and any(isinstance(o, RustRlibLibrary)
                                                   for o in obj.linked_libraries):
-            libs = [l for l in obj.linked_libraries if isinstance(l, RustLibrary)]
-            def name_cmp(l1, l2):
-                if l1.crate_type == 'staticlib':
-                    return 1
-                if l2.crate_type == 'staticlib':
-                    return -1
-                return cmp(l1.basename, l2.basename)
-            libs.sort(cmp=name_cmp)
-            for l in libs:
-                relpath = pretty_relpath(l)
-                backend_file.write('STATIC_LIBS += %s/%s\n' % (relpath, l.import_name))
+            backend_file.write('STATIC_LIBS += librul.$(LIB_SUFFIX)\n')
 
         for lib in obj.linked_system_libs:
             if obj.KIND == 'target':
                 backend_file.write_once('OS_LIBS += %s\n' % lib)
             else:
                 backend_file.write_once('HOST_EXTRA_LIBS += %s\n' % lib)
 
         # Process library-based defines
@@ -1445,16 +1434,17 @@ class RecursiveMakeBackend(CommonBackend
             self.backend_input_files.add(obj.input_path)
 
         self._makefile_out_count += 1
 
     def _handle_linked_rust_crates(self, obj, extern_crate_file):
         backend_file = self._get_backend_file_for(obj)
 
         backend_file.write('RS_STATICLIB_CRATE_SRC := %s\n' % extern_crate_file)
+        backend_file.write('STATIC_LIBS += librul.$(LIB_SUFFIX)\n')
 
     def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources,
                              unified_ipdl_cppsrcs_mapping):
         # Write out a master list of all IPDL source files.
         mk = Makefile()
 
         mk.add_statement('ALL_IPDLSRCS := %s' % ' '.join(sorted_ipdl_sources))
 
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -940,23 +940,16 @@ VARIABLES = {
         Accepts assembler, C, C++, Objective C/C++.
         """),
 
     'FILES_PER_UNIFIED_FILE': (int, int,
         """The number of source files to compile into each unified source file.
 
         """),
 
-    'IS_RUST_LIBRARY': (bool, bool,
-        """Whether the current library defined by this moz.build is built by Rust.
-
-        The library defined by this moz.build should have a build definition in
-        a Cargo.toml file that exists in this moz.build's directory.
-        """),
-
     'UNIFIED_SOURCES': (ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList), list,
         """Source code files that can be compiled together.
 
         This variable contains a list of source code files to compile,
         that can be concatenated all together and built as a single source
         file. This can help make the build faster and reduce the debug info
         size.
         """),
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -440,64 +440,40 @@ class Library(BaseLibrary):
     )
 
     def __init__(self, context, basename, real_name=None, is_sdk=False):
         BaseLibrary.__init__(self, context, real_name or basename)
         self.basename = basename
         self.is_sdk = is_sdk
 
 
+class RustRlibLibrary(Library):
+    """Context derived container object for a Rust rlib"""
+
+    def __init__(self, context, basename, crate_name, rlib_filename, link_into):
+        Library.__init__(self, context, basename)
+        self.crate_name = crate_name
+        self.rlib_filename = rlib_filename
+        self.link_into = link_into
+
+
 class StaticLibrary(Library):
     """Context derived container object for a static library"""
     __slots__ = (
         'link_into',
         'no_expand_lib',
     )
 
     def __init__(self, context, basename, real_name=None, is_sdk=False,
         link_into=None, no_expand_lib=False):
         Library.__init__(self, context, basename, real_name, is_sdk)
         self.link_into = link_into
         self.no_expand_lib = no_expand_lib
 
 
-class RustLibrary(StaticLibrary):
-    """Context derived container object for a static library"""
-    __slots__ = (
-        'cargo_file',
-        'crate_type',
-    )
-
-    def __init__(self, context, basename, cargo_file, crate_type, **args):
-        StaticLibrary.__init__(self, context, basename, **args)
-        self.cargo_file = cargo_file
-        self.crate_type = crate_type
-        # We need to adjust our naming here because cargo replaces '-' in
-        # package names defined in Cargo.toml with underscores in actual
-        # filenames. But we need to keep the basename consistent because
-        # many other things in the build system depend on that.
-        assert self.crate_type == 'staticlib'
-        self.lib_name = '%s%s%s' % (
-            context.config.lib_prefix,
-            basename.replace('-', '_'),
-            context.config.lib_suffix
-        )
-        # cargo creates several directories and places its build artifacts
-        # in those directories.  The directory structure depends not only
-        # on the target, but also what sort of build we are doing.
-        rust_build_kind = 'release'
-        if context.config.substs.get('MOZ_DEBUG'):
-            rust_build_kind = 'debug'
-        self.import_name = '%s/%s/%s' % (
-            context.config.substs['RUST_TARGET'],
-            rust_build_kind,
-            self.lib_name,
-        )
-
-
 class SharedLibrary(Library):
     """Context derived container object for a shared library"""
     __slots__ = (
         'soname',
         'variant',
         'symbols_file',
     )
 
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -15,17 +15,16 @@ from collections import defaultdict, Ord
 from mach.mixin.logging import LoggingMixin
 from mozbuild.util import (
     memoize,
     OrderedDefaultDict,
 )
 
 import mozpack.path as mozpath
 import mozinfo
-import pytoml
 
 from .data import (
     AndroidAssetsDirs,
     AndroidExtraPackages,
     AndroidExtraResDirs,
     AndroidResDirs,
     BaseSources,
     BrandingFiles,
@@ -56,17 +55,17 @@ from .data import (
     Linkable,
     LocalInclude,
     ObjdirFiles,
     ObjdirPreprocessedFiles,
     PerSourceFlag,
     PreprocessedTestWebIDLFile,
     PreprocessedWebIDLFile,
     Program,
-    RustLibrary,
+    RustRlibLibrary,
     SdkFiles,
     SharedLibrary,
     SimpleProgram,
     Sources,
     StaticLibrary,
     TestHarnessFiles,
     TestWebIDLFile,
     TestManifest,
@@ -124,18 +123,16 @@ class TreeMetadataEmitter(LoggingMixin):
             if isinstance(k, unicode):
                 k = k.encode('ascii')
             self.info[k] = v
 
         self._libs = OrderedDefaultDict(list)
         self._binaries = OrderedDict()
         self._linkage = []
         self._static_linking_shared = set()
-        self._crate_verified_local = set()
-        self._crate_directories = dict()
 
         # Keep track of external paths (third party build systems), starting
         # from what we run a subconfigure in. We'll eliminate some directories
         # as we traverse them with moz.build (e.g. js/src).
         subconfigures = os.path.join(self.config.topobjdir, 'subconfigures')
         paths = []
         if os.path.exists(subconfigures):
             paths = open(subconfigures).read().splitlines()
@@ -193,17 +190,17 @@ class TreeMetadataEmitter(LoggingMixin):
             objs = list(self._emit_libs_derived(contexts))
             self._emitter_time += time.time() - start
 
             for o in emit_objs(objs): yield o
 
     def _emit_libs_derived(self, contexts):
         # First do FINAL_LIBRARY linkage.
         for lib in (l for libs in self._libs.values() for l in libs):
-            if not isinstance(lib, (StaticLibrary, RustLibrary)) or not lib.link_into:
+            if not isinstance(lib, (StaticLibrary, RustRlibLibrary)) or not lib.link_into:
                 continue
             if lib.link_into not in self._libs:
                 raise SandboxValidationError(
                     'FINAL_LIBRARY ("%s") does not match any LIBRARY_NAME'
                     % lib.link_into, contexts[lib.objdir])
             candidates = self._libs[lib.link_into]
 
             # When there are multiple candidates, but all are in the same
@@ -371,134 +368,16 @@ class TreeMetadataEmitter(LoggingMixin):
         # context more or less truthful about where the external library is.
         context = Context(config=self.config)
         context.add_source(mozpath.join(self.config.topsrcdir, dir, 'dummy'))
         if force_static:
             return ExternalStaticLibrary(context, name)
         else:
             return ExternalSharedLibrary(context, name)
 
-    def _parse_cargo_file(self, toml_file):
-        """Parse toml_file and return a Python object representation of it."""
-        with open(toml_file, 'r') as f:
-            return pytoml.load(f)
-
-    def _verify_deps(self, context, crate_dir, crate_name, dependencies, description='Dependency'):
-        """Verify that a crate's dependencies all specify local paths."""
-        for dep_crate_name, values in dependencies.iteritems():
-            # A simple version number.
-            if isinstance(values, (str, unicode)):
-                raise SandboxValidationError(
-                    '%s %s of crate %s does not list a path' % (description, dep_crate_name, crate_name),
-                    context)
-
-            dep_path = values.get('path', None)
-            if not dep_path:
-                raise SandboxValidationError(
-                    '%s %s of crate %s does not list a path' % (description, dep_crate_name, crate_name),
-                    context)
-
-            # Try to catch the case where somebody listed a
-            # local path for development.
-            if os.path.isabs(dep_path):
-                raise SandboxValidationError(
-                    '%s %s of crate %s has a non-relative path' % (description, dep_crate_name, crate_name),
-                    context)
-
-            if not os.path.exists(mozpath.join(context.config.topsrcdir, crate_dir, dep_path)):
-                raise SandboxValidationError(
-                    '%s %s of crate %s refers to a non-existent path' % (description, dep_crate_name, crate_name),
-                    context)
-
-    def _verify_local_paths(self, context, crate_dir, config):
-        """Verify that a Cargo.toml config specifies local paths for all its dependencies."""
-        crate_name = config['package']['name']
-
-        # This is not exactly how cargo works (cargo would permit
-        # identically-named packages with different versions in the same
-        # library), but we want to try and avoid using multiple
-        # different versions of a single package for code size reasons.
-        if crate_name not in self._crate_directories:
-            self._crate_directories[crate_name] = crate_dir
-        else:
-            previous_dir = self._crate_directories[crate_name]
-            if crate_dir != previous_dir:
-                raise SandboxValidationError(
-                    'Crate %s found at multiple paths: %s, %s' % (crate_name, crate_dir, previous_dir),
-                    context)
-
-        # This check should ideally be positioned when we're recursing through
-        # dependencies, but then we would never get the chance to run the
-        # duplicated names check above.
-        if crate_name in self._crate_verified_local:
-            return
-
-        crate_deps = config.get('dependencies', {})
-        if crate_deps:
-            self._verify_deps(context, crate_dir, crate_name, crate_deps)
-
-        has_custom_build = 'build' in config['package']
-        build_deps = config.get('build-dependencies', {})
-        if has_custom_build and build_deps:
-            self._verify_deps(context, crate_dir, crate_name, build_deps,
-                              description='Build dependency')
-
-        # We have now verified that all the declared dependencies of
-        # this crate have local paths.  Now verify recursively.
-        self._crate_verified_local.add(crate_name)
-
-        if crate_deps:
-            for dep_crate_name, values in crate_deps.iteritems():
-                rel_dep_dir = mozpath.normpath(mozpath.join(crate_dir, values['path']))
-                dep_toml = mozpath.join(context.config.topsrcdir, rel_dep_dir, 'Cargo.toml')
-                self._verify_local_paths(context, rel_dep_dir, self._parse_cargo_file(dep_toml))
-
-        if has_custom_build and build_deps:
-            for dep_crate_name, values in build_deps.iteritems():
-                rel_dep_dir = mozpath.normpath(mozpath.join(crate_dir, values['path']))
-                dep_toml = mozpath.join(context.config.topsrcdir, rel_dep_dir, 'Cargo.toml')
-                self._verify_local_paths(context, rel_dep_dir, self._parse_cargo_file(dep_toml))
-
-    def _rust_library(self, context, libname, static_args):
-        # We need to note any Rust library for linking purposes.
-        cargo_file = mozpath.join(context.srcdir, 'Cargo.toml')
-        if not os.path.exists(cargo_file):
-            raise SandboxValidationError(
-                'No Cargo.toml file found in %s' % cargo_file, context)
-
-        config = self._parse_cargo_file(cargo_file)
-        crate_name = config['package']['name']
-
-        if crate_name != libname:
-            raise SandboxValidationError(
-                'library %s does not match Cargo.toml-defined package %s' % (libname, crate_name),
-                context)
-
-        lib_section = config.get('lib', None)
-        if not lib_section:
-            raise SandboxValidationError(
-                'Cargo.toml for %s has no [lib] section' % libname,
-                context)
-
-        crate_type = lib_section.get('crate-type', None)
-        if not crate_type:
-            raise SandboxValidationError(
-                'Can\'t determine a crate-type for %s from Cargo.toml' % libname,
-                context)
-
-        crate_type = crate_type[0]
-        if crate_type != 'staticlib':
-            raise SandboxValidationError(
-                'crate-type %s is not permitted for %s' % (crate_type, libname),
-                context)
-
-        self._verify_local_paths(context, context.relsrcdir, config)
-
-        return RustLibrary(context, libname, cargo_file, crate_type, **static_args)
-
     def _handle_linkables(self, context, passthru, generated_files):
         has_linkables = False
 
         for kind, cls in [('PROGRAM', Program), ('HOST_PROGRAM', HostProgram)]:
             program = context.get(kind)
             if program:
                 if program in self._binaries:
                     raise SandboxValidationError(
@@ -696,49 +575,34 @@ class TreeMetadataEmitter(LoggingMixin):
                         'action', 'generate_symbols_file.py')
                     defines = ()
                     if lib.defines:
                         defines = lib.defines.get_defines()
                     yield GeneratedFile(context, script,
                         'generate_symbols_file', lib.symbols_file,
                         [symbols_file], defines)
             if static_lib:
-                is_rust_library = context.get('IS_RUST_LIBRARY')
-                if is_rust_library:
-                    lib = self._rust_library(context, libname, static_args)
-                else:
-                    lib = StaticLibrary(context, libname, **static_args)
+                lib = StaticLibrary(context, libname, **static_args)
                 self._libs[libname].append(lib)
                 self._linkage.append((context, lib, 'USE_LIBS'))
-
-                # Multiple staticlibs for a library means multiple copies
-                # of the Rust runtime, which will result in linking errors
-                # later on.
-                if is_rust_library:
-                    staticlibs = [l for l in self._libs[libname]
-                                  if isinstance(l, RustLibrary) and l.crate_type == 'staticlib']
-                    if len(staticlibs) > 1:
-                        raise SandboxValidationError(
-                            'Cannot have multiple Rust staticlibs in %s: %s' % (libname, ', '.join(l.basename for l in staticlibs)),
-                            context)
-
                 has_linkables = True
 
             if lib_defines:
                 if not libname:
                     raise SandboxValidationError('LIBRARY_DEFINES needs a '
                         'LIBRARY_NAME to take effect', context)
                 lib.lib_defines.update(lib_defines)
 
         # Only emit sources if we have linkables defined in the same context.
         # Note the linkables are not emitted in this function, but much later,
         # after aggregation (because of e.g. USE_LIBS processing).
         if not has_linkables:
             return
 
+        rust_sources = []
         sources = defaultdict(list)
         gen_sources = defaultdict(list)
         all_flags = {}
         for symbol in ('SOURCES', 'HOST_SOURCES', 'UNIFIED_SOURCES'):
             srcs = sources[symbol]
             gen_srcs = gen_sources[symbol]
             context_srcs = context.get(symbol, [])
             for f in context_srcs:
@@ -780,16 +644,17 @@ class TreeMetadataEmitter(LoggingMixin):
         # in the definition; we'll add it in programmatically after defining
         # things.
         suffix_map = {
             '.s': set(['.asm']),
             '.c': set(),
             '.m': set(),
             '.mm': set(),
             '.cpp': set(['.cc', '.cxx']),
+            '.rs': set(),
             '.S': set(),
         }
 
         # The inverse of the above, mapping suffixes to their canonical suffix.
         canonicalized_suffix_map = {}
         for suffix, alternatives in suffix_map.iteritems():
             alternatives.add(suffix)
             for a in alternatives:
@@ -824,18 +689,51 @@ class TreeMetadataEmitter(LoggingMixin):
                 sorted_files = sorted(srcs, key=canonical_suffix_for_file)
                 for canonical_suffix, files in itertools.groupby(
                         sorted_files, canonical_suffix_for_file):
                     arglist = [context, list(files), canonical_suffix]
                     if (variable.startswith('UNIFIED_') and
                             'FILES_PER_UNIFIED_FILE' in context):
                         arglist.append(context['FILES_PER_UNIFIED_FILE'])
                     obj = cls(*arglist)
+
+                    # Rust is special.  Each Rust file that we compile
+                    # is a separate crate and gets compiled into its own
+                    # rlib file (Rust's equivalent of a .a file).  When
+                    # we go to link Rust sources into a library or
+                    # executable, we have a separate, single crate that
+                    # gets compiled as a staticlib (like a rlib, but
+                    # includes the actual Rust runtime).
+                    if canonical_suffix == '.rs':
+                        if not final_lib:
+                            raise SandboxValidationError(
+                                'Rust sources must be destined for a FINAL_LIBRARY')
+                        # If we're building a shared library, we're going to
+                        # auto-generate a module that includes all of the rlib
+                        # files.  This means we can't permit Rust files as
+                        # immediate inputs of the shared library.
+                        if libname and shared_lib:
+                            raise SandboxValidationError(
+                                'No Rust sources permitted as an immediate input of %s: %s' % (shlib, files))
+                        rust_sources.append(obj)
                     yield obj
 
+        # Rust sources get translated into rlibs, which are essentially static
+        # libraries.  We need to note all of them for linking, too.
+        if libname and static_lib:
+            for s in rust_sources:
+                for f in s.files:
+                    (base, _) = mozpath.splitext(mozpath.basename(f))
+                    crate_name = context.relsrcdir.replace('/', '_') + '_' + base
+                    rlib_filename = 'lib' + base + '.rlib'
+                    lib = RustRlibLibrary(context, libname, crate_name,
+                                          rlib_filename, final_lib)
+                    self._libs[libname].append(lib)
+                    self._linkage.append((context, lib, 'USE_LIBS'))
+
         for f, flags in all_flags.iteritems():
             if flags.flags:
                 ext = mozpath.splitext(f)[1]
                 yield PerSourceFlag(context, f, flags.flags)
 
 
     def emit_from_context(self, context):
         """Convert a Context to tree metadata objects.
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-absolute-path/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-build = "build.rs"
-
-[lib]
-crate-type = ["staticlib"]
-
-[build-dependencies]
-bogus = { version = "0.1.0", path = "/path/to/somewhere" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-absolute-path/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-nonexistent-path/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-build = "build.rs"
-
-[lib]
-crate-type = ["staticlib"]
-
-[build-dependencies]
-bogus = { version = "0.1.0", path = "../bogus" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-nonexistent-path/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-ok = { version = "0.1.0", path = "ok" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-recursive/ok/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "ok"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-build = "build.rs"
-
-[build-dependencies]
-bogus = { version = "0.1.0" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-version-only/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-build = "build.rs"
-
-[lib]
-crate-type = ["staticlib"]
-
-[build-dependencies]
-bogus = "0.1.0"
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-version-only/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-with-dict/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-build = "build.rs"
-
-[lib]
-crate-type = ["staticlib"]
-
-[build-dependencies]
-bogus = { version = "0.1.0" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-build-dependency-with-dict/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-absolute-path/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-bogus = { version = "0.1.0", path = "/path/to/somewhere" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-absolute-path/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-nonexistent-path/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-bogus = { version = "0.1.0", path = "../bogus" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-nonexistent-path/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-deep-crate = { version = "0.1.0", path = "the/depths" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "shallow-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "deep-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[dependencies]
-shallow-crate = { path = "../../shallow" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-ok = { version = "0.1.0", path = "ok" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-recursive/ok/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "ok"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[dependencies]
-bogus = { version = "0.1.0" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-version-only/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-bogus = "0.1.0"
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-version-only/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-with-dict/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-bogus = { version = "0.1.0" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-with-dict/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/Cargo.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-crate-one = { path = "crate-one" }
-crate-two = { path = "crate-two" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-one/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "crate-one"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[dependencies]
-duplicate = { path = "duplicate" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-one/duplicate/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "duplicate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-two/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "crate-two"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[dependencies]
-duplicate = { path = "duplicate" }
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/crate-two/duplicate/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "duplicate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/duplicated-crate-names/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["dylib"]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "deterministic-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
-  "Nobody <nobody@mozilla.org>",
-]
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
-    '''Template for libraries.'''
-    LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
-    '''Template for Rust libraries.'''
-    Library(name)
-
-    IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -25,17 +25,16 @@ from mozbuild.frontend.data import (
     GeneratedFile,
     GeneratedSources,
     HostDefines,
     HostSources,
     IPDLFile,
     JARManifest,
     LocalInclude,
     Program,
-    RustLibrary,
     SdkFiles,
     SharedLibrary,
     SimpleProgram,
     Sources,
     StaticLibrary,
     TestHarnessFiles,
     TestManifest,
     UnifiedSources,
@@ -988,141 +987,16 @@ class TestEmitterBasic(unittest.TestCase
 
     def test_final_target_pp_files_non_srcdir(self):
         '''Test that non-srcdir paths in FINAL_TARGET_PP_FILES throws errors.'''
         reader = self.reader('final-target-pp-files-non-srcdir')
         with self.assertRaisesRegexp(SandboxValidationError,
              'Only source directory paths allowed in FINAL_TARGET_PP_FILES:'):
             self.read_topsrcdir(reader)
 
-    def test_crate_dependency_version_only(self):
-        '''Test that including a crate with a version-only dependency fails.'''
-        reader = self.reader('crate-dependency-version-only')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_dependency_with_dict(self):
-        '''Test that including a crate with a dict-using version-only dependency fails.'''
-        reader = self.reader('crate-dependency-with-dict')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_dependency_absolute_path(self):
-        '''Test that including a crate with an absolute-path dependency fails.'''
-        reader = self.reader('crate-dependency-absolute-path')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Dependency.*of crate.*has a non-relative path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_dependency_nonexistent_path(self):
-        '''Test that including a crate with a non-existent dependency fails.'''
-        reader = self.reader('crate-dependency-nonexistent-path')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Dependency.*of crate.*refers to a non-existent path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_build_dependency_version_only(self):
-        '''Test that including a crate with a version-only dependency fails.'''
-        reader = self.reader('crate-build-dependency-version-only')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Build dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_build_dependency_with_dict(self):
-        '''Test that including a crate with a dict-using version-only dependency fails.'''
-        reader = self.reader('crate-build-dependency-with-dict')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Build dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_build_dependency_absolute_path(self):
-        '''Test that including a crate with an absolute-path dependency fails.'''
-        reader = self.reader('crate-build-dependency-absolute-path')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Build dependency.*of crate.*has a non-relative path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_build_dependency_nonexistent_path(self):
-        '''Test that including a crate with a non-existent dependency fails.'''
-        reader = self.reader('crate-build-dependency-nonexistent-path')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Build dependency.*of crate.*refers to a non-existent path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_dependency_recursive(self):
-        reader = self.reader('crate-dependency-recursive')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_crate_build_dependency_recursive(self):
-        reader = self.reader('crate-build-dependency-recursive')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Build dependency.*of crate.*does not list a path'):
-            self.read_topsrcdir(reader)
-
-    def test_rust_library_no_cargo_toml(self):
-        '''Test that defining a RustLibrary without a Cargo.toml fails.'''
-        reader = self.reader('rust-library-no-cargo-toml')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'No Cargo.toml file found'):
-            self.read_topsrcdir(reader)
-
-    def test_rust_library_name_mismatch(self):
-        '''Test that defining a RustLibrary that doesn't match Cargo.toml fails.'''
-        reader = self.reader('rust-library-name-mismatch')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'library.*does not match Cargo.toml-defined package'):
-            self.read_topsrcdir(reader)
-
-    def test_rust_library_no_lib_section(self):
-        '''Test that a RustLibrary Cargo.toml with no [lib] section fails.'''
-        reader = self.reader('rust-library-no-lib-section')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Cargo.toml for.* has no \\[lib\\] section'):
-            self.read_topsrcdir(reader)
-
-    def test_rust_library_invalid_crate_type(self):
-        '''Test that a RustLibrary Cargo.toml has a permitted crate-type.'''
-        reader = self.reader('rust-library-invalid-crate-type')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'crate-type.* is not permitted'):
-            self.read_topsrcdir(reader)
-
-    def test_rust_library_dash_folding(self):
-        '''Test that on-disk names of RustLibrary objects convert dashes to underscores.'''
-        reader = self.reader('rust-library-dash-folding',
-                             extra_substs=dict(RUST_TARGET='i686-pc-windows-msvc'))
-        objs = self.read_topsrcdir(reader)
-
-        self.assertEqual(len(objs), 1)
-        lib = objs[0]
-        self.assertIsInstance(lib, RustLibrary)
-        self.assertRegexpMatches(lib.lib_name, "random_crate")
-        self.assertRegexpMatches(lib.import_name, "random_crate")
-        self.assertRegexpMatches(lib.basename, "random-crate")
-
-    def test_crate_dependency_path_resolution(self):
-        '''Test recursive dependencies resolve with the correct paths.'''
-        reader = self.reader('crate-dependency-path-resolution',
-                             extra_substs=dict(RUST_TARGET='i686-pc-windows-msvc'))
-        objs = self.read_topsrcdir(reader)
-
-        self.assertEqual(len(objs), 1)
-        self.assertIsInstance(objs[0], RustLibrary)
-
-    def test_duplicate_crate_names(self):
-        '''Test that crates are not duplicated in the tree.'''
-        reader = self.reader('duplicated-crate-names')
-        with self.assertRaisesRegexp(SandboxValidationError,
-             'Crate.*found at multiple paths'):
-            self.read_topsrcdir(reader)
-
     def test_android_res_dirs(self):
         """Test that ANDROID_RES_DIRS works properly."""
         reader = self.reader('android-res-dirs')
         objs = self.read_topsrcdir(reader)
 
         self.assertEqual(len(objs), 1)
         self.assertIsInstance(objs[0], AndroidResDirs)
 
deleted file mode 100644
--- a/python/pytoml/PKG-INFO
+++ /dev/null
@@ -1,10 +0,0 @@
-Metadata-Version: 1.0
-Name: pytoml
-Version: 0.1.10
-Summary: A parser for TOML-0.4.0
-Home-page: https://github.com/avakar/pytoml
-Author: Martin Vejnár
-Author-email: avakar@ratatanek.cz
-License: MIT
-Description: UNKNOWN
-Platform: UNKNOWN
deleted file mode 100644
--- a/python/pytoml/pytoml/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .core import TomlError
-from .parser import load, loads
-from .writer import dump, dumps
deleted file mode 100644
--- a/python/pytoml/pytoml/core.py
+++ /dev/null
@@ -1,13 +0,0 @@
-class TomlError(RuntimeError):
-    def __init__(self, message, line, col, filename):
-        RuntimeError.__init__(self, message, line, col, filename)
-        self.message = message
-        self.line = line
-        self.col = col
-        self.filename = filename
-
-    def __str__(self):
-        return '{}({}, {}): {}'.format(self.filename, self.line, self.col, self.message)
-
-    def __repr__(self):
-        return 'TomlError({!r}, {!r}, {!r}, {!r})'.format(self.message, self.line, self.col, self.filename)
deleted file mode 100644
--- a/python/pytoml/pytoml/parser.py
+++ /dev/null
@@ -1,366 +0,0 @@
-import string, re, sys, datetime
-from .core import TomlError
-
-if sys.version_info[0] == 2:
-    _chr = unichr
-else:
-    _chr = chr
-
-def load(fin, translate=lambda t, x, v: v):
-    return loads(fin.read(), translate=translate, filename=fin.name)
-
-def loads(s, filename='<string>', translate=lambda t, x, v: v):
-    if isinstance(s, bytes):
-        s = s.decode('utf-8')
-
-    s = s.replace('\r\n', '\n')
-
-    root = {}
-    tables = {}
-    scope = root
-
-    src = _Source(s, filename=filename)
-    ast = _p_toml(src)
-
-    def error(msg):
-        raise TomlError(msg, pos[0], pos[1], filename)
-
-    def process_value(v):
-        kind, text, value, pos = v
-        if kind == 'str' and value.startswith('\n'):
-            value = value[1:]
-        if kind == 'array':
-            if value and any(k != value[0][0] for k, t, v, p in value[1:]):
-                error('array-type-mismatch')
-            value = [process_value(item) for item in value]
-        elif kind == 'table':
-            value = dict([(k, process_value(value[k])) for k in value])
-        return translate(kind, text, value)
-
-    for kind, value, pos in ast:
-        if kind == 'kv':
-            k, v = value
-            if k in scope:
-                error('duplicate_keys. Key "{0}" was used more than once.'.format(k))
-            scope[k] = process_value(v)
-        else:
-            is_table_array = (kind == 'table_array')
-            cur = tables
-            for name in value[:-1]:
-                if isinstance(cur.get(name), list):
-                    d, cur = cur[name][-1]
-                else:
-                    d, cur = cur.setdefault(name, (None, {}))
-
-            scope = {}
-            name = value[-1]
-            if name not in cur:
-                if is_table_array:
-                    cur[name] = [(scope, {})]
-                else:
-                    cur[name] = (scope, {})
-            elif isinstance(cur[name], list):
-                if not is_table_array:
-                    error('table_type_mismatch')
-                cur[name].append((scope, {}))
-            else:
-                if is_table_array:
-                    error('table_type_mismatch')
-                old_scope, next_table = cur[name]
-                if old_scope is not None:
-                    error('duplicate_tables')
-                cur[name] = (scope, next_table)
-
-    def merge_tables(scope, tables):
-        if scope is None:
-            scope = {}
-        for k in tables:
-            if k in scope:
-                error('key_table_conflict')
-            v = tables[k]
-            if isinstance(v, list):
-                scope[k] = [merge_tables(sc, tbl) for sc, tbl in v]
-            else:
-                scope[k] = merge_tables(v[0], v[1])
-        return scope
-
-    return merge_tables(root, tables)
-
-class _Source:
-    def __init__(self, s, filename=None):
-        self.s = s
-        self._pos = (1, 1)
-        self._last = None
-        self._filename = filename
-        self.backtrack_stack = []
-
-    def last(self):
-        return self._last
-
-    def pos(self):
-        return self._pos
-
-    def fail(self):
-        return self._expect(None)
-
-    def consume_dot(self):
-        if self.s:
-            self._last = self.s[0]
-            self.s = self[1:]
-            self._advance(self._last)
-            return self._last
-        return None
-
-    def expect_dot(self):
-        return self._expect(self.consume_dot())
-
-    def consume_eof(self):
-        if not self.s:
-            self._last = ''
-            return True
-        return False
-
-    def expect_eof(self):
-        return self._expect(self.consume_eof())
-
-    def consume(self, s):
-        if self.s.startswith(s):
-            self.s = self.s[len(s):]
-            self._last = s
-            self._advance(s)
-            return True
-        return False
-
-    def expect(self, s):
-        return self._expect(self.consume(s))
-
-    def consume_re(self, re):
-        m = re.match(self.s)
-        if m:
-            self.s = self.s[len(m.group(0)):]
-            self._last = m
-            self._advance(m.group(0))
-            return m
-        return None
-
-    def expect_re(self, re):
-        return self._expect(self.consume_re(re))
-
-    def __enter__(self):
-        self.backtrack_stack.append((self.s, self._pos))
-
-    def __exit__(self, type, value, traceback):
-        if type is None:
-            self.backtrack_stack.pop()
-        else:
-            self.s, self._pos = self.backtrack_stack.pop()
-        return type == TomlError
-
-    def commit(self):
-        self.backtrack_stack[-1] = (self.s, self._pos)
-
-    def _expect(self, r):
-        if not r:
-            raise TomlError('msg', self._pos[0], self._pos[1], self._filename)
-        return r
-
-    def _advance(self, s):
-        suffix_pos = s.rfind('\n')
-        if suffix_pos == -1:
-            self._pos = (self._pos[0], self._pos[1] + len(s))
-        else:
-            self._pos = (self._pos[0] + s.count('\n'), len(s) - suffix_pos)
-
-_ews_re = re.compile(r'(?:[ \t]|#[^\n]*\n|#[^\n]*\Z|\n)*')
-def _p_ews(s):
-    s.expect_re(_ews_re)
-
-_ws_re = re.compile(r'[ \t]*')
-def _p_ws(s):
-    s.expect_re(_ws_re)
-
-_escapes = { 'b': '\b', 'n': '\n', 'r': '\r', 't': '\t', '"': '"', '\'': '\'',
-    '\\': '\\', '/': '/', 'f': '\f' }
-
-_basicstr_re = re.compile(r'[^"\\\000-\037]*')
-_short_uni_re = re.compile(r'u([0-9a-fA-F]{4})')
-_long_uni_re = re.compile(r'U([0-9a-fA-F]{8})')
-_escapes_re = re.compile('[bnrt"\'\\\\/f]')
-_newline_esc_re = re.compile('\n[ \t\n]*')
-def _p_basicstr_content(s, content=_basicstr_re):
-    res = []
-    while True:
-        res.append(s.expect_re(content).group(0))
-        if not s.consume('\\'):
-            break
-        if s.consume_re(_newline_esc_re):
-            pass
-        elif s.consume_re(_short_uni_re) or s.consume_re(_long_uni_re):
-            res.append(_chr(int(s.last().group(1), 16)))
-        else:
-            s.expect_re(_escapes_re)
-            res.append(_escapes[s.last().group(0)])
-    return ''.join(res)
-
-_key_re = re.compile(r'[0-9a-zA-Z-_]+')
-def _p_key(s):
-    with s:
-        s.expect('"')
-        r = _p_basicstr_content(s, _basicstr_re)
-        s.expect('"')
-        return r
-    return s.expect_re(_key_re).group(0)
-
-_float_re = re.compile(r'[+-]?(?:0|[1-9](?:_?\d)*)(?:\.\d(?:_?\d)*)?(?:[eE][+-]?(?:\d(?:_?\d)*))?')
-_datetime_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
-
-_basicstr_ml_re = re.compile(r'(?:(?:|"|"")[^"\\\000-\011\013-\037])*')
-_litstr_re = re.compile(r"[^'\000-\037]*")
-_litstr_ml_re = re.compile(r"(?:(?:|'|'')(?:[^'\000-\011\013-\037]))*")
-def _p_value(s):
-    pos = s.pos()
-
-    if s.consume('true'):
-        return 'bool', s.last(), True, pos
-    if s.consume('false'):
-        return 'bool', s.last(), False, pos
-
-    if s.consume('"'):
-        if s.consume('""'):
-            r = _p_basicstr_content(s, _basicstr_ml_re)
-            s.expect('"""')
-        else:
-            r = _p_basicstr_content(s, _basicstr_re)
-            s.expect('"')
-        return 'str', r, r, pos
-
-    if s.consume('\''):
-        if s.consume('\'\''):
-            r = s.expect_re(_litstr_ml_re).group(0)
-            s.expect('\'\'\'')
-        else:
-            r = s.expect_re(_litstr_re).group(0)
-            s.expect('\'')
-        return 'str', r, r, pos
-
-    if s.consume_re(_datetime_re):
-        m = s.last()
-        s0 = m.group(0)
-        r = map(int, m.groups()[:6])
-        if m.group(7):
-            micro = float(m.group(7))
-        else:
-            micro = 0
-
-        if m.group(8):
-            g = int(m.group(8), 10) * 60 + int(m.group(9), 10)
-            tz = _TimeZone(datetime.timedelta(0, g * 60))
-        else:
-            tz = _TimeZone(datetime.timedelta(0, 0))
-
-        y, m, d, H, M, S = r
-        dt = datetime.datetime(y, m, d, H, M, S, int(micro * 1000000), tz)
-        return 'datetime', s0, dt, pos
-
-    if s.consume_re(_float_re):
-        m = s.last().group(0)
-        r = m.replace('_','')
-        if '.' in m or 'e' in m or 'E' in m:
-            return 'float', m, float(r), pos
-        else:
-            return 'int', m, int(r, 10), pos
-
-    if s.consume('['):
-        items = []
-        with s:
-            while True:
-                _p_ews(s)
-                items.append(_p_value(s))
-                s.commit()
-                _p_ews(s)
-                s.expect(',')
-                s.commit()
-        _p_ews(s)
-        s.expect(']')
-        return 'array', None, items, pos
-
-    if s.consume('{'):
-        _p_ws(s)
-        items = {}
-        if not s.consume('}'):
-            k = _p_key(s)
-            _p_ws(s)
-            s.expect('=')
-            _p_ws(s)
-            items[k] = _p_value(s)
-            _p_ws(s)
-            while s.consume(','):
-                _p_ws(s)
-                k = _p_key(s)
-                _p_ws(s)
-                s.expect('=')
-                _p_ws(s)
-                items[k] = _p_value(s)
-                _p_ws(s)
-            s.expect('}')
-        return 'table', None, items, pos
-
-    s.fail()
-
-def _p_stmt(s):
-    pos = s.pos()
-    if s.consume(   '['):
-        is_array = s.consume('[')
-        _p_ws(s)
-        keys = [_p_key(s)]
-        _p_ws(s)
-        while s.consume('.'):
-            _p_ws(s)
-            keys.append(_p_key(s))
-            _p_ws(s)
-        s.expect(']')
-        if is_array:
-            s.expect(']')
-        return 'table_array' if is_array else 'table', keys, pos
-
-    key = _p_key(s)
-    _p_ws(s)
-    s.expect('=')
-    _p_ws(s)
-    value = _p_value(s)
-    return 'kv', (key, value), pos
-
-_stmtsep_re = re.compile(r'(?:[ \t]*(?:#[^\n]*)?\n)+[ \t]*')
-def _p_toml(s):
-    stmts = []
-    _p_ews(s)
-    with s:
-        stmts.append(_p_stmt(s))
-        while True:
-            s.commit()
-            s.expect_re(_stmtsep_re)
-            stmts.append(_p_stmt(s))
-    _p_ews(s)
-    s.expect_eof()
-    return stmts
-
-class _TimeZone(datetime.tzinfo):
-    def __init__(self, offset):
-        self._offset = offset
-
-    def utcoffset(self, dt):
-        return self._offset
-
-    def dst(self, dt):
-        return None
-
-    def tzname(self, dt):
-        m = self._offset.total_seconds() // 60
-        if m < 0:
-            res = '-'
-            m = -m
-        else:
-            res = '+'
-        h = m // 60
-        m = m - h * 60
-        return '{}{:.02}{:.02}'.format(res, h, m)
deleted file mode 100644
--- a/python/pytoml/pytoml/writer.py
+++ /dev/null
@@ -1,120 +0,0 @@
-from __future__ import unicode_literals
-import io, datetime, sys
-
-if sys.version_info[0] == 3:
-    long = int
-    unicode = str
-
-
-def dumps(obj, sort_keys=False):
-    fout = io.StringIO()
-    dump(fout, obj, sort_keys=sort_keys)
-    return fout.getvalue()
-
-
-_escapes = {'\n': 'n', '\r': 'r', '\\': '\\', '\t': 't', '\b': 'b', '\f': 'f', '"': '"'}
-
-
-def _escape_string(s):
-    res = []
-    start = 0
-
-    def flush():
-        if start != i:
-            res.append(s[start:i])
-        return i + 1
-
-    i = 0
-    while i < len(s):
-        c = s[i]
-        if c in '"\\\n\r\t\b\f':
-            start = flush()
-            res.append('\\' + _escapes[c])
-        elif ord(c) < 0x20:
-            start = flush()
-            res.append('\\u%04x' % ord(c))
-        i += 1
-
-    flush()
-    return '"' + ''.join(res) + '"'
-
-
-def _escape_id(s):
-    if any(not c.isalnum() and c not in '-_' for c in s):
-        return _escape_string(s)
-    return s
-
-
-def _format_list(v):
-    return '[{0}]'.format(', '.join(_format_value(obj) for obj in v))
-
-# Formula from:
-#   https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds
-# Once support for py26 is dropped, this can be replaced by td.total_seconds()
-def _total_seconds(td):
-    return ((td.microseconds
-             + (td.seconds + td.days * 24 * 3600) * 10**6) / 10.0**6)
-
-def _format_value(v):
-    if isinstance(v, bool):
-        return 'true' if v else 'false'
-    if isinstance(v, int) or isinstance(v, long):
-        return unicode(v)
-    if isinstance(v, float):
-        return '{0:.17f}'.format(v)
-    elif isinstance(v, unicode) or isinstance(v, bytes):
-        return _escape_string(v)
-    elif isinstance(v, datetime.datetime):
-        offs = v.utcoffset()
-        offs = _total_seconds(offs) // 60 if offs is not None else 0
-
-        if offs == 0:
-            suffix = 'Z'
-        else:
-            if offs > 0:
-                suffix = '+'
-            else:
-                suffix = '-'
-                offs = -offs
-            suffix = '{0}{1:.02}{2:.02}'.format(suffix, offs // 60, offs % 60)
-
-        if v.microsecond:
-            return v.strftime('%Y-%m-%dT%H:%M:%S.%f') + suffix
-        else:
-            return v.strftime('%Y-%m-%dT%H:%M:%S') + suffix
-    elif isinstance(v, list):
-        return _format_list(v)
-    else:
-        raise RuntimeError(v)
-
-
-def dump(fout, obj, sort_keys=False):
-    tables = [((), obj, False)]
-
-    while tables:
-        if sort_keys:
-            tables.sort(key=lambda tup: tup[0], reverse=True)
-        name, table, is_array = tables.pop()
-        if name:
-            section_name = '.'.join(_escape_id(c) for c in name)
-            if is_array:
-                fout.write('[[{0}]]\n'.format(section_name))
-            else:
-                fout.write('[{0}]\n'.format(section_name))
-
-        table_keys = sorted(table.keys()) if sort_keys else table.keys()
-        for k in table_keys:
-            v = table[k]
-            if isinstance(v, dict):
-                tables.append((name + (k,), v, False))
-            elif isinstance(v, list) and v and all(isinstance(o, dict) for o in v):
-                tables.extend((name + (k,), d, True) for d in reversed(v))
-            elif v is None:
-                # based on mojombo's comment: https://github.com/toml-lang/toml/issues/146#issuecomment-25019344
-                fout.write(
-                    '#{} = null  # To use: uncomment and replace null with value\n'.format(_escape_id(k)))
-            else:
-                fout.write('{0} = {1}\n'.format(_escape_id(k), _format_value(v)))
-
-        if tables:
-            fout.write('\n')
deleted file mode 100644
--- a/python/pytoml/setup.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-[egg_info]
-tag_build = 
-tag_date = 0
-tag_svn_revision = 0
-
deleted file mode 100644
--- a/python/pytoml/setup.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-# coding: utf-8
-
-from setuptools import setup
-
-setup(
-    name='pytoml',
-    version='0.1.10',
-
-    description='A parser for TOML-0.4.0',
-    author='Martin Vejnár',
-    author_email='avakar@ratatanek.cz',
-    url='https://github.com/avakar/pytoml',
-    license='MIT',
-
-    packages=['pytoml'],
-    )
deleted file mode 100644
--- a/python/pytoml/test/test.py
+++ /dev/null
@@ -1,100 +0,0 @@
-import os, json, sys, io, traceback, argparse
-import pytoml as toml
-
-# Formula from:
-#   https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds
-# Once support for py26 is dropped, this can be replaced by td.total_seconds()
-def _total_seconds(td):
-    return ((td.microseconds
-             + (td.seconds + td.days * 24 * 3600) * 10**6) / 10.0**6)
-
-def _testbench_literal(type, text, value):
-    if type == 'table':
-        return value
-    if type == 'array':
-        return { 'type': 'array', 'value': value }
-    if type == 'datetime':
-        offs = _total_seconds(value.tzinfo.utcoffset(value)) // 60
-        offs = 'Z' if offs == 0 else '{}{}:{}'.format('-' if offs < 0 else '-', abs(offs) // 60, abs(offs) % 60)
-        v = '{0:04}-{1:02}-{2:02}T{3:02}:{4:02}:{5:02}{6}'.format(value.year, value.month, value.day, value.hour, value.minute, value.second, offs)
-        return { 'type': 'datetime', 'value': v }
-    if type == 'bool':
-        return { 'type': 'bool', 'value': 'true' if value else 'false' }
-    if type == 'float':
-        return { 'type': 'float', 'value': value }
-    if type == 'str':
-        return { 'type': 'string', 'value': value }
-    if type == 'int':
-        return { 'type': 'integer', 'value': str(value) }
-
-def adjust_bench(v):
-    if isinstance(v, dict):
-        if v.get('type') == 'float':
-            v['value'] = float(v['value'])
-            return v
-        return dict([(k, adjust_bench(v[k])) for k in v])
-    if isinstance(v, list):
-        return [adjust_bench(v) for v in v]
-    return v
-
-def _main():
-    ap = argparse.ArgumentParser()
-    ap.add_argument('-d', '--dir', action='append')
-    ap.add_argument('testcase', nargs='*')
-    args = ap.parse_args()
-
-    if not args.dir:
-        args.dir = [os.path.join(os.path.split(__file__)[0], 'toml-test/tests')]
-
-    succeeded = []
-    failed = []
-
-    for path in args.dir:
-        if not os.path.isdir(path):
-            print('error: not a dir: {0}'.format(path))
-            return 2
-        for top, dirnames, fnames in os.walk(path):
-            for fname in fnames:
-                if not fname.endswith('.toml'):
-                    continue
-
-                if args.testcase and not any(arg in fname for arg in args.testcase):
-                    continue
-
-                parse_error = None
-                try:
-                    with open(os.path.join(top, fname), 'rb') as fin:
-                        parsed = toml.load(fin)
-                except toml.TomlError:
-                    parsed = None
-                    parse_error = sys.exc_info()
-                else:
-                    dumped = toml.dumps(parsed)
-                    parsed2 = toml.loads(dumped)
-                    if parsed != parsed2:
-                        failed.append((fname, None))
-                        continue
-
-                    with open(os.path.join(top, fname), 'rb') as fin:
-                        parsed = toml.load(fin, translate=_testbench_literal)
-
-                try:
-                    with io.open(os.path.join(top, fname[:-5] + '.json'), 'rt', encoding='utf-8') as fin:
-                        bench = json.load(fin)
-                except IOError:
-                    bench = None
-
-                if parsed != adjust_bench(bench):
-                    failed.append((fname, parsed, bench, parse_error))
-                else:
-                    succeeded.append(fname)
-
-    for f, parsed, bench, e in failed:
-        print('failed: {}\n{}\n{}'.format(f, json.dumps(parsed, indent=4), json.dumps(bench, indent=4)))
-        if e:
-            traceback.print_exception(*e)
-    print('succeeded: {0}'.format(len(succeeded)))
-    return 1 if failed or not succeeded else 0
-
-if __name__ == '__main__':
-    sys.exit(_main())
--- a/toolkit/library/gtest/moz.build
+++ b/toolkit/library/gtest/moz.build
@@ -6,13 +6,8 @@
 
 Libxul('xul-gtest')
 
 FINAL_TARGET = 'dist/bin/gtest'
 
 USE_LIBS += [
     'static:xul',
 ]
-
-if CONFIG['MOZ_RUST']:
-    USE_LIBS += [
-        'gkrust-gtest',
-    ]
deleted file mode 100644
--- a/toolkit/library/gtest/rust/Cargo.lock
+++ /dev/null
@@ -1,11 +0,0 @@
-[root]
-name = "gkrust-gtest"
-version = "0.1.0"
-dependencies = [
- "mp4parse-gtest 0.1.0",
-]
-
-[[package]]
-name = "mp4parse-gtest"
-version = "0.1.0"
-
deleted file mode 100644
--- a/toolkit/library/gtest/rust/Cargo.toml
+++ /dev/null
@@ -1,36 +0,0 @@
-[package]
-name = "gkrust-gtest"
-version = "0.1.0"
-authors = ["nobody@mozilla.org"]
-license = "MPL-2.0"
-description = "Testing code for libgkrust"
-
-[dependencies]
-mp4parse-gtest = { path = "../../../../dom/media/gtest" }
-
-[lib]
-path = "lib.rs"
-crate-type = ["staticlib"]
-test = false
-doctest = false
-bench = false
-doc = false
-plugin = false
-harness = false
-
-# Explicitly specify what our profiles use.
-[profile.dev]
-opt-level = 0
-debug = true
-rpath = false
-lto = false
-debug-assertions = true
-codegen-units = 1
-
-[profile.release]
-opt-level = 2
-debug = true
-rpath = false
-lto = false
-debug-assertions = false
-codegen-units = 1
deleted file mode 100644
--- a/toolkit/library/gtest/rust/lib.rs
+++ /dev/null
@@ -1,5 +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/.
-
-extern crate mp4parse_gtest;
deleted file mode 100644
--- a/toolkit/library/gtest/rust/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; 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/.
-
-RustLibrary('gkrust-gtest')
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -379,16 +379,10 @@ if CONFIG['COMPILE_ENVIRONMENT']:
         )
     GENERATED_FILES += ['dependentlibs.list']
     GENERATED_FILES['dependentlibs.list'].script = 'dependentlibs.py:gen_list'
     GENERATED_FILES['dependentlibs.list'].inputs = [
         '!%s' % full_libname,
     ]
     FINAL_TARGET_FILES += ['!dependentlibs.list']
 
-# This library needs to be last to make XPCOM module registration work.
+# This needs to be last
 USE_LIBS += ['StaticXULComponentsEnd']
-
-# The above library needs to be last for C++ purposes.  This library,
-# however, is entirely composed of Rust code, and needs to come after
-# all the C++ code so any possible C++ -> Rust calls can be resolved.
-if CONFIG['MOZ_RUST']:
-    USE_LIBS += ['gkrust']
deleted file mode 100644
--- a/toolkit/library/rust/Cargo.lock
+++ /dev/null
@@ -1,11 +0,0 @@
-[root]
-name = "gkrust"
-version = "0.1.0"
-dependencies = [
- "mp4parse 0.4.0",
-]
-
-[[package]]
-name = "mp4parse"
-version = "0.4.0"
-
deleted file mode 100644
--- a/toolkit/library/rust/Cargo.toml
+++ /dev/null
@@ -1,36 +0,0 @@
-[package]
-name = "gkrust"
-version = "0.1.0"
-authors = ["nobody@mozilla.org"]
-license = "MPL-2.0"
-description = "Rust code for libxul"
-
-[dependencies]
-mp4parse = { path = "../../../media/libstagefright/binding/mp4parse" }
-
-[lib]
-path = "lib.rs"
-crate-type = ["staticlib"]
-test = false
-doctest = false
-bench = false
-doc = false
-plugin = false
-harness = false
-
-# Explicitly specify what our profiles use.
-[profile.dev]
-opt-level = 0
-debug = true
-rpath = false
-lto = false
-debug-assertions = true
-codegen-units = 1
-
-[profile.release]
-opt-level = 2
-debug = true
-rpath = false
-lto = false
-debug-assertions = false
-codegen-units = 1
deleted file mode 100644
--- a/toolkit/library/rust/lib.rs
+++ /dev/null
@@ -1,5 +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/.
-
-extern crate mp4parse;
deleted file mode 100644
--- a/toolkit/library/rust/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; 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/.
-
-RustLibrary('gkrust')
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -1,9 +1,8 @@
-# -*- Mode: python; c-basic-offset: 4; 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/.
 
 if CONFIG['MOZ_SANDBOX']:
     DIRS += ['/security/sandbox']
 
@@ -138,22 +137,16 @@ DIRS += [
     '/startupcache',
     '/js/ductwork/debugger',
     '/other-licenses/snappy',
 ]
 
 if CONFIG['MOZ_GIO_COMPONENT']:
     DIRS += ['/extensions/gio']
 
-if CONFIG['MOZ_RUST']:
-    DIRS += [
-        '/toolkit/library/gtest/rust',
-        '/toolkit/library/rust',
-    ]
-
 DIRS += [
     '/toolkit/library/StaticXULComponentsEnd',
     '/toolkit/library',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     DIRS += ['/toolkit/system/gnome']