Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
authorarthur.iakab <aiakab@mozilla.com>
Sun, 03 Jun 2018 19:25:41 +0300
changeset 421108 cd74e3f9f61e1e48f872f1b365400668256c28aa
parent 421107 7c8905b6b2264e7c20e6ab3f3def7d818c007f5b
child 421109 790ca8d7f10524574ccfee75ce7e74b501319a5b
push id34088
push userdluca@mozilla.com
push dateMon, 04 Jun 2018 17:56:32 +0000
treeherdermozilla-central@5b15326286d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1465060
milestone62.0a1
backs out7c8905b6b2264e7c20e6ab3f3def7d818c007f5b
10446073eca89bc3099523a5f3795ea7aa45cf2f
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp Backed out changeset 7c8905b6b226 (bug 1465060) Backed out changeset 10446073eca8 (bug 1465060)
accessible/ipc/other/ProxyAccessible.cpp
build/moz.configure/warnings.configure
devtools/shared/heapsnapshot/DeserializedNode.cpp
docshell/base/nsDocShell.cpp
docshell/base/timeline/AutoRestyleTimelineMarker.cpp
docshell/base/timeline/TimelineConsumers.cpp
dom/animation/EffectSet.h
dom/base/CustomElementRegistry.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsDocument.cpp
dom/base/nsGlobalWindowInner.cpp
dom/canvas/ImageBitmap.cpp
dom/canvas/WebGLFormats.cpp
dom/canvas/WebGLTextureUpload.cpp
dom/clients/manager/ClientHandle.cpp
dom/clients/manager/ClientInfo.cpp
dom/clients/manager/ClientManager.cpp
dom/clients/manager/ClientManagerService.cpp
dom/console/Console.cpp
dom/events/EventListenerManager.cpp
dom/file/uri/BlobURLProtocolHandler.cpp
dom/geolocation/nsGeolocation.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentProcessManager.cpp
dom/media/MediaStreamGraph.cpp
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/gmp/ChromiumCDMParent.cpp
dom/media/gmp/GMPParent.cpp
dom/media/gmp/GMPServiceParent.cpp
dom/media/gmp/GMPStorageChild.cpp
dom/media/ipc/VideoDecoderManagerParent.cpp
dom/media/platforms/apple/AppleVTDecoder.cpp
dom/media/platforms/omx/OmxPlatformLayer.cpp
dom/serviceworkers/ServiceWorkerDescriptor.cpp
dom/serviceworkers/ServiceWorkerManager.cpp
dom/serviceworkers/ServiceWorkerRegistrar.cpp
dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp
dom/u2f/U2F.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerScope.cpp
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditorObjectResizer.cpp
extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp
gfx/2d/SFNTData.cpp
gfx/gl/GLScreenBuffer.cpp
gfx/gl/MozFramebuffer.cpp
gfx/gl/SharedSurface.cpp
gfx/gl/SharedSurfaceEGL.cpp
gfx/gl/SharedSurfaceGL.cpp
gfx/gl/SharedSurfaceIO.cpp
gfx/layers/AnimationHelper.cpp
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/ipc/CompositorVsyncScheduler.cpp
gfx/layers/ipc/UiCompositorControllerParent.cpp
gfx/layers/wr/WebRenderCommandBuilder.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatformMac.cpp
image/decoders/nsICODecoder.cpp
image/test/gtest/TestADAM7InterpolatingFilter.cpp
image/test/gtest/TestAnimationFrameBuffer.cpp
image/test/gtest/TestSourceBuffer.cpp
image/test/gtest/TestSurfacePipeIntegration.cpp
js/src/builtin/TestingFunctions.cpp
js/src/ctypes/CTypes.cpp
js/src/ds/LifoAlloc.cpp
js/src/ds/LifoAlloc.h
js/src/vm/CodeCoverage.cpp
js/src/vm/UbiNode.cpp
js/src/vm/UbiNodeShortestPaths.cpp
js/src/wasm/WasmValidate.cpp
js/xpconnect/loader/URLPreloader.cpp
layout/base/PresShell.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/RetainedDisplayListBuilder.cpp
layout/painting/nsDisplayList.cpp
layout/style/StyleSheet.cpp
layout/style/nsTransitionManager.cpp
media/webrtc/signaling/gtest/sdp_unittests.cpp
mfbt/tests/TestUniquePtr.cpp
security/certverifier/tests/gtest/CTSerializationTest.cpp
security/manager/ssl/nsPKCS12Blob.cpp
toolkit/components/extensions/webrequest/WebRequestService.cpp
toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
tools/profiler/core/platform.cpp
widget/android/nsAppShell.h
xpcom/tests/gtest/TestPLDHash.cpp
xpcom/tests/gtest/TestTArray.cpp
--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ b/accessible/ipc/other/ProxyAccessible.cpp
@@ -73,17 +73,17 @@ ProxyAccessible::RelationByType(Relation
                                      &targetIDs);
 
   size_t targetCount = targetIDs.Length();
   nsTArray<ProxyAccessible*> targets(targetCount);
   for (size_t i = 0; i < targetCount; i++)
     if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
       targets.AppendElement(proxy);
 
-  return targets;
+  return std::move(targets);
 }
 
 void
 ProxyAccessible::Relations(nsTArray<RelationType>* aTypes,
                            nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets)
   const
 {
   nsTArray<RelationTargets> ipcRelations;
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -81,16 +81,22 @@ check_and_add_gcc_warning('-Wstring-conv
 
 # we inline 'new' and 'delete' in mozalloc
 check_and_add_gcc_warning('-Wno-inline-new-delete', cxx_compiler)
 
 # Prevent the following GCC warnings from being treated as errors:
 # too many false positives
 check_and_add_gcc_warning('-Wno-error=maybe-uninitialized')
 
+# Turned on by -Wall, but needs changes to be turned into an error
+# (bug 1465060).
+check_and_add_gcc_warning('-Wno-error=pessimizing-move')
+# This one is probably easier, it's only triggered by tests.
+check_and_add_gcc_warning('-Wno-error=self-move')
+
 # we don't want our builds held hostage when a platform-specific API
 # becomes deprecated.
 check_and_add_gcc_warning('-Wno-error=deprecated-declarations')
 
 # false positives depending on optimization
 check_and_add_gcc_warning('-Wno-error=array-bounds')
 
 # can't get rid of those PGO warnings
--- a/devtools/shared/heapsnapshot/DeserializedNode.cpp
+++ b/devtools/shared/heapsnapshot/DeserializedNode.cpp
@@ -82,18 +82,18 @@ class DeserializedEdgeRange : public Edg
   void settle() {
     if (i >= node->edges.length()) {
       front_ = nullptr;
       return;
     }
 
     auto& edge = node->edges[i];
     auto referent = node->getEdgeReferent(edge);
-    currentEdge = Edge(edge.name
-                ? NS_strdup(edge.name) : nullptr, referent);
+    currentEdge = std::move(Edge(edge.name ? NS_strdup(edge.name) : nullptr,
+                                     referent));
     front_ = &currentEdge;
   }
 
 public:
   explicit DeserializedEdgeRange(DeserializedNode& node)
     : node(&node)
     , i(0)
   {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2860,17 +2860,17 @@ nsDocShell::MaybeCreateInitialClientSour
 }
 
 Maybe<ClientInfo>
 nsDocShell::GetInitialClientInfo() const
 {
   if (mInitialClientSource) {
     Maybe<ClientInfo> result;
     result.emplace(mInitialClientSource->Info());
-    return result;
+    return std::move(result);
   }
 
   nsGlobalWindowInner* innerWindow =
     mScriptGlobal ? mScriptGlobal->GetCurrentInnerWindowInternal() : nullptr;
   nsIDocument* doc = innerWindow ? innerWindow->GetExtantDoc() : nullptr;
 
   if (!doc || !doc->IsInitialDocument()) {
     return Maybe<ClientInfo>();
@@ -14062,20 +14062,20 @@ nsDocShell::NotifyJSRunToCompletionStart
                                          const uint32_t aLineNumber,
                                          JS::Handle<JS::Value> aAsyncStack,
                                          const char* aAsyncCause)
 {
   // If first start, mark interval start.
   if (mJSRunToCompletionDepth == 0) {
     RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
     if (timelines && timelines->HasConsumer(this)) {
-      timelines->AddMarkerForDocShell(this,
+      timelines->AddMarkerForDocShell(this, std::move(
         mozilla::MakeUnique<JavascriptTimelineMarker>(
           aReason, aFunctionName, aFilename, aLineNumber, MarkerTracingType::START,
-          aAsyncStack, aAsyncCause));
+          aAsyncStack, aAsyncCause)));
     }
   }
 
   mJSRunToCompletionDepth++;
 }
 
 void
 nsDocShell::NotifyJSRunToCompletionStop()
--- a/docshell/base/timeline/AutoRestyleTimelineMarker.cpp
+++ b/docshell/base/timeline/AutoRestyleTimelineMarker.cpp
@@ -27,34 +27,34 @@ AutoRestyleTimelineMarker::AutoRestyleTi
   }
 
   RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
   if (!timelines || !timelines->HasConsumer(aDocShell)) {
     return;
   }
 
   mDocShell = aDocShell;
-  timelines->AddMarkerForDocShell(mDocShell,
+  timelines->AddMarkerForDocShell(mDocShell, std::move(
     MakeUnique<RestyleTimelineMarker>(
       mIsAnimationOnly,
-      MarkerTracingType::START));
+      MarkerTracingType::START)));
 }
 
 AutoRestyleTimelineMarker::~AutoRestyleTimelineMarker()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mDocShell) {
     return;
   }
 
   RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
   if (!timelines || !timelines->HasConsumer(mDocShell)) {
     return;
   }
 
-  timelines->AddMarkerForDocShell(mDocShell,
+  timelines->AddMarkerForDocShell(mDocShell, std::move(
     MakeUnique<RestyleTimelineMarker>(
       mIsAnimationOnly,
-      MarkerTracingType::END));
+      MarkerTracingType::END)));
 }
 
 } // namespace mozilla
--- a/docshell/base/timeline/TimelineConsumers.cpp
+++ b/docshell/base/timeline/TimelineConsumers.cpp
@@ -180,30 +180,30 @@ TimelineConsumers::IsEmpty()
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         const char* aName,
                                         MarkerTracingType aTracingType,
                                         MarkerStackRequest aStackRequest)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (HasConsumer(aDocShell)) {
-    aDocShell->mObserved->AddMarker(MakeUnique<TimelineMarker>(aName, aTracingType, aStackRequest));
+    aDocShell->mObserved->AddMarker(std::move(MakeUnique<TimelineMarker>(aName, aTracingType, aStackRequest)));
   }
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         const char* aName,
                                         const TimeStamp& aTime,
                                         MarkerTracingType aTracingType,
                                         MarkerStackRequest aStackRequest)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (HasConsumer(aDocShell)) {
-    aDocShell->mObserved->AddMarker(MakeUnique<TimelineMarker>(aName, aTime, aTracingType, aStackRequest));
+    aDocShell->mObserved->AddMarker(std::move(MakeUnique<TimelineMarker>(aName, aTime, aTracingType, aStackRequest)));
   }
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         UniquePtr<AbstractTimelineMarker>&& aMarker)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/animation/EffectSet.h
+++ b/dom/animation/EffectSet.h
@@ -85,17 +85,17 @@ public:
   // This allows us to avoid exposing mEffects directly and saves the
   // caller from having to dereference hashtable iterators using
   // the rather complicated: iter.Get()->GetKey().
   class Iterator
   {
   public:
     explicit Iterator(EffectSet& aEffectSet)
       : mEffectSet(aEffectSet)
-      , mHashIterator(aEffectSet.mEffects.Iter())
+      , mHashIterator(std::move(aEffectSet.mEffects.Iter()))
       , mIsEndIterator(false)
     {
 #ifdef DEBUG
       mEffectSet.mActiveIterators++;
 #endif
     }
 
     Iterator(Iterator&& aOther)
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -488,17 +488,17 @@ CustomElementRegistry::CreateCustomEleme
 
   if (aArgs) {
     callback->SetArgs(*aArgs);
   }
 
   if (aAdoptedCallbackArgs) {
     callback->SetAdoptedCallbackArgs(*aAdoptedCallbackArgs);
   }
-  return callback;
+  return std::move(callback);
 }
 
 /* static */ void
 CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
                                                 Element* aCustomElement,
                                                 LifecycleCallbackArgs* aArgs,
                                                 LifecycleAdoptedCallbackArgs* aAdoptedCallbackArgs,
                                                 CustomElementDefinition* aDefinition)
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -427,17 +427,17 @@ nsContentPermissionUtils::GetContentPerm
 {
   nsTArray<PContentPermissionRequestParent*> parentArray;
   for (auto& it : ContentPermissionRequestParentMap()) {
     if (it.second == aTabId) {
       parentArray.AppendElement(it.first);
     }
   }
 
-  return parentArray;
+  return std::move(parentArray);
 }
 
 /* static */ void
 nsContentPermissionUtils::NotifyRemoveContentPermissionRequestParent(
   PContentPermissionRequestParent* aParent)
 {
   auto it = ContentPermissionRequestParentMap().find(aParent);
   MOZ_ASSERT(it != ContentPermissionRequestParentMap().end());
@@ -450,17 +450,17 @@ nsContentPermissionUtils::GetContentPerm
 {
   nsTArray<PContentPermissionRequestChild*> childArray;
   for (auto& it : ContentPermissionRequestChildMap()) {
     if (it.second == aTabId) {
       childArray.AppendElement(it.first);
     }
   }
 
-  return childArray;
+  return std::move(childArray);
 }
 
 /* static */ void
 nsContentPermissionUtils::NotifyRemoveContentPermissionRequestChild(
   PContentPermissionRequestChild* aChild)
 {
   auto it = ContentPermissionRequestChildMap().find(aChild);
   MOZ_ASSERT(it != ContentPermissionRequestChildMap().end());
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -5560,39 +5560,39 @@ nsIDocument::GetAnonRootIfInAnonymousCon
   return nullptr;
 }
 
 Maybe<ClientInfo>
 nsIDocument::GetClientInfo() const
 {
   nsPIDOMWindowInner* inner = GetInnerWindow();
   if (inner) {
-    return inner->GetClientInfo();
-  }
-  return Maybe<ClientInfo>();
+    return std::move(inner->GetClientInfo());
+  }
+  return std::move(Maybe<ClientInfo>());
 }
 
 Maybe<ClientState>
 nsIDocument::GetClientState() const
 {
   nsPIDOMWindowInner* inner = GetInnerWindow();
   if (inner) {
-    return inner->GetClientState();
-  }
-  return Maybe<ClientState>();
+    return std::move(inner->GetClientState());
+  }
+  return std::move(Maybe<ClientState>());
 }
 
 Maybe<ServiceWorkerDescriptor>
 nsIDocument::GetController() const
 {
   nsPIDOMWindowInner* inner = GetInnerWindow();
   if (inner) {
-    return inner->GetController();
-  }
-  return Maybe<ServiceWorkerDescriptor>();
+    return std::move(inner->GetController());
+  }
+  return std::move(Maybe<ServiceWorkerDescriptor>());
 }
 
 //
 // nsIDocument interface
 //
 DocumentType*
 nsIDocument::GetDoctype() const
 {
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -2315,35 +2315,35 @@ void
 nsPIDOMWindowInner::SyncStateFromParentWindow()
 {
   nsGlobalWindowInner::Cast(this)->SyncStateFromParentWindow();
 }
 
 Maybe<ClientInfo>
 nsPIDOMWindowInner::GetClientInfo() const
 {
-  return nsGlobalWindowInner::Cast(this)->GetClientInfo();
+  return std::move(nsGlobalWindowInner::Cast(this)->GetClientInfo());
 }
 
 Maybe<ClientState>
 nsPIDOMWindowInner::GetClientState() const
 {
-  return nsGlobalWindowInner::Cast(this)->GetClientState();
+  return std::move(nsGlobalWindowInner::Cast(this)->GetClientState());
 }
 
 Maybe<ServiceWorkerDescriptor>
 nsPIDOMWindowInner::GetController() const
 {
-  return nsGlobalWindowInner::Cast(this)->GetController();
+  return std::move(nsGlobalWindowInner::Cast(this)->GetController());
 }
 
 RefPtr<mozilla::dom::ServiceWorker>
 nsPIDOMWindowInner::GetOrCreateServiceWorker(const mozilla::dom::ServiceWorkerDescriptor& aDescriptor)
 {
-  return nsGlobalWindowInner::Cast(this)->GetOrCreateServiceWorker(aDescriptor);
+  return std::move(nsGlobalWindowInner::Cast(this)->GetOrCreateServiceWorker(aDescriptor));
 }
 
 void
 nsPIDOMWindowInner::NoteCalledRegisterForServiceWorkerScope(const nsACString& aScope)
 {
   nsGlobalWindowInner::Cast(this)->NoteCalledRegisterForServiceWorkerScope(aScope);
 }
 
@@ -5493,17 +5493,17 @@ nsGlobalWindowInner::ShowSlowScriptDialo
   auto getString = [&] (const char* name,
                         nsContentUtils::PropertiesFile propFile = nsContentUtils::eDOM_PROPERTIES) {
     nsAutoString result;
     nsresult rv = nsContentUtils::GetLocalizedString(
       propFile, name, result);
 
     // GetStringFromName can return NS_OK and still give nullptr string
     failed = failed || NS_FAILED(rv) || result.IsEmpty();
-    return result;
+    return std::move(result);
   };
 
   bool isAddonScript = !aAddonId.IsEmpty();
   bool showDebugButton = debugCallback && !isAddonScript;
 
   // Get localizable strings
 
   nsAutoString title, checkboxMsg, debugButton, msg;
@@ -6324,43 +6324,43 @@ nsGlobalWindowInner::CallOnChildren(Meth
 Maybe<ClientInfo>
 nsGlobalWindowInner::GetClientInfo() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   Maybe<ClientInfo> clientInfo;
   if (mClientSource) {
     clientInfo.emplace(mClientSource->Info());
   }
-  return clientInfo;
+  return std::move(clientInfo);
 }
 
 Maybe<ClientState>
 nsGlobalWindowInner::GetClientState() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   Maybe<ClientState> clientState;
   if (mClientSource) {
     ClientState state;
     nsresult rv = mClientSource->SnapshotState(&state);
     if (NS_SUCCEEDED(rv)) {
       clientState.emplace(state);
     }
   }
-  return clientState;
+  return std::move(clientState);
 }
 
 Maybe<ServiceWorkerDescriptor>
 nsGlobalWindowInner::GetController() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   Maybe<ServiceWorkerDescriptor> controller;
   if (mClientSource) {
     controller = mClientSource->GetController();
   }
-  return controller;
+  return std::move(controller);
 }
 
 RefPtr<ServiceWorker>
 nsGlobalWindowInner::GetOrCreateServiceWorker(const ServiceWorkerDescriptor& aDescriptor)
 {
   MOZ_ASSERT(NS_IsMainThread());
   RefPtr<ServiceWorker> ref;
   ForEachEventTargetObject([&] (DOMEventTargetHelper* aTarget, bool* aDoneOut) {
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -799,17 +799,17 @@ ImageBitmap::ToCloneData() const
   UniquePtr<ImageBitmapCloneData> result(new ImageBitmapCloneData());
   result->mPictureRect = mPictureRect;
   result->mAlphaType = mAlphaType;
   result->mIsCroppingAreaOutSideOfSourceImage = mIsCroppingAreaOutSideOfSourceImage;
   RefPtr<SourceSurface> surface = mData->GetAsSourceSurface();
   result->mSurface = surface->GetDataSurface();
   MOZ_ASSERT(result->mSurface);
 
-  return result;
+  return std::move(result);
 }
 
 /* static */ already_AddRefed<ImageBitmap>
 ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal,
                                  ImageBitmapCloneData* aData)
 {
   RefPtr<layers::Image> data = CreateImageFromSurface(aData->mSurface);
 
--- a/dom/canvas/WebGLFormats.cpp
+++ b/dom/canvas/WebGLFormats.cpp
@@ -822,17 +822,17 @@ FormatUsageAuthority::CreateForWebGL1(gl
     ptr->AllowRBFormat(LOCAL_GL_DEPTH_STENCIL,
                        ptr->GetUsage(EffectiveFormat::DEPTH24_STENCIL8));
 
     ////////////////////////////////////////////////////////////////////////////
 
     if (!AddUnsizedFormats(ptr, gl))
         return nullptr;
 
-    return ret;
+    return std::move(ret);
 }
 
 UniquePtr<FormatUsageAuthority>
 FormatUsageAuthority::CreateForWebGL2(gl::GLContext* gl)
 {
     UniquePtr<FormatUsageAuthority> ret(new FormatUsageAuthority);
     const auto ptr = ret.get();
 
@@ -1057,17 +1057,17 @@ FormatUsageAuthority::CreateForWebGL2(gl
         AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_FLOAT, EffectiveFormat::RGB32F );
 
         AddSimpleUnsized(ptr, LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGBA16F);
         AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGB16F );
     }
 
     ////////////////////////////////////
 
-    return ret;
+    return std::move(ret);
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
 void
 FormatUsageAuthority::AddTexUnpack(FormatUsageInfo* usage, const PackingInfo& pi,
                                    const DriverUnpackInfo& dui)
 {
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -222,17 +222,17 @@ FromPboOffset(WebGLContext* webgl, const
                                              isClientData, ptr, availBufferBytes);
 }
 
 static UniquePtr<webgl::TexUnpackBlob>
 FromImageBitmap(WebGLContext* webgl, const char* funcName, TexImageTarget target,
                 uint32_t width, uint32_t height, uint32_t depth,
                 const dom::ImageBitmap& imageBitmap)
 {
-    UniquePtr<dom::ImageBitmapCloneData> cloneData = imageBitmap.ToCloneData();
+    UniquePtr<dom::ImageBitmapCloneData> cloneData = std::move(imageBitmap.ToCloneData());
     if (!cloneData) {
       return nullptr;
     }
 
     const RefPtr<gfx::DataSourceSurface> surf = cloneData->mSurface;
 
     if (!width) {
         width = surf->GetSize().width;
@@ -455,17 +455,17 @@ ValidateTexOrSubImage(WebGLContext* webg
     if (!ValidateViewType(webgl, funcName, pi.type, src))
         return nullptr;
 
     auto blob = webgl->From(funcName, target, rawWidth, rawHeight, rawDepth, border, src,
                             scopedArr);
     if (!blob || !blob->Validate(webgl, funcName, pi))
         return nullptr;
 
-    return blob;
+    return std::move(blob);
 }
 
 void
 WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level,
                        GLenum internalFormat, GLsizei width, GLsizei height,
                        GLsizei depth, GLint border, const webgl::PackingInfo& pi,
                        const TexImageSource& src)
 {
--- a/dom/clients/manager/ClientHandle.cpp
+++ b/dom/clients/manager/ClientHandle.cpp
@@ -198,13 +198,13 @@ ClientHandle::OnDetach()
   if (!mDetachPromise) {
     mDetachPromise = new GenericPromise::Private(__func__);
     if (IsShutdown()) {
       mDetachPromise->Resolve(true, __func__);
     }
   }
 
   RefPtr<GenericPromise> ref(mDetachPromise);
-  return ref;
+  return std::move(ref);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/clients/manager/ClientInfo.cpp
+++ b/dom/clients/manager/ClientInfo.cpp
@@ -140,13 +140,13 @@ ClientInfo::IsPrivateBrowsing() const
   }
 }
 
 nsCOMPtr<nsIPrincipal>
 ClientInfo::GetPrincipal() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(PrincipalInfo());
-  return ref;
+  return std::move(ref);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/clients/manager/ClientManager.cpp
+++ b/dom/clients/manager/ClientManager.cpp
@@ -131,30 +131,30 @@ ClientManager::CreateSourceInternal(Clie
   if (NS_WARN_IF(NS_FAILED(rv))) {
     // If we can't even get a UUID, at least make sure not to use a garbage
     // value.  Instead return a shutdown ClientSource with a zero'd id.
     // This should be exceptionally rare, if it happens at all.
     id.Clear();
     ClientSourceConstructorArgs args(id, aType, aPrincipal, TimeStamp::Now());
     UniquePtr<ClientSource> source(new ClientSource(this, aEventTarget, args));
     source->Shutdown();
-    return source;
+    return std::move(source);
   }
 
   ClientSourceConstructorArgs args(id, aType, aPrincipal, TimeStamp::Now());
   UniquePtr<ClientSource> source(new ClientSource(this, aEventTarget, args));
 
   if (IsShutdown()) {
     source->Shutdown();
-    return source;
+    return std::move(source);
   }
 
   source->Activate(GetActor());
 
-  return source;
+  return std::move(source);
 }
 
 already_AddRefed<ClientHandle>
 ClientManager::CreateHandleInternal(const ClientInfo& aClientInfo,
                                     nsISerialEventTarget* aSerialEventTarget)
 {
   NS_ASSERT_OWNINGTHREAD(ClientManager);
   MOZ_DIAGNOSTIC_ASSERT(aSerialEventTarget);
--- a/dom/clients/manager/ClientManagerService.cpp
+++ b/dom/clients/manager/ClientManagerService.cpp
@@ -433,18 +433,18 @@ ClientManagerService::MatchAll(const Cli
 
       if(controller.ref().Id() != swd.Id() ||
          controller.ref().Scope() != swd.Scope()) {
         continue;
       }
     }
 
     promiseList->AddPromise(
-      source->StartOp(ClientGetInfoAndStateArgs(source->Info().Id(),
-                                                source->Info().PrincipalInfo())));
+      source->StartOp(std::move(ClientGetInfoAndStateArgs(source->Info().Id(),
+                                                     source->Info().PrincipalInfo()))));
   }
 
   // Maybe finish the promise now in case we didn't find any matching clients.
   promiseList->MaybeFinish();
 
   return promiseList->GetResultPromise();
 }
 
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -2882,36 +2882,36 @@ Console::MonotonicTimer(JSContext* aCx, 
         return false;
       }
 
       nsAutoJSString key;
       if (!key.init(aCx, jsString)) {
         return false;
       }
 
-      timelines->AddMarkerForDocShell(docShell,
-        MakeUnique<TimestampTimelineMarker>(key));
+      timelines->AddMarkerForDocShell(docShell, std::move(
+        MakeUnique<TimestampTimelineMarker>(key)));
     }
     // For `console.time(foo)` and `console.timeEnd(foo)`.
     else if (isTimelineRecording && aData.Length() == 1) {
       JS::Rooted<JS::Value> value(aCx, aData[0]);
       JS::Rooted<JSString*> jsString(aCx, JS::ToString(aCx, value));
       if (!jsString) {
         return false;
       }
 
       nsAutoJSString key;
       if (!key.init(aCx, jsString)) {
         return false;
       }
 
-      timelines->AddMarkerForDocShell(docShell,
+      timelines->AddMarkerForDocShell(docShell, std::move(
         MakeUnique<ConsoleTimelineMarker>(
           key, aMethodName == MethodTime ? MarkerTracingType::START
-                                         : MarkerTracingType::END));
+                                         : MarkerTracingType::END)));
     }
 
     return true;
   }
 
   if (NS_IsMainThread()) {
     *aTimeStamp = (TimeStamp::Now() - mCreationTimeStamp).ToMilliseconds();
     return true;
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1240,19 +1240,19 @@ EventListenerManager::HandleEventInterna
                 listener->mListenerType != Listener::eNativeListener) {
               docShell = nsContentUtils::GetDocShellForEventTarget(mTarget);
               if (docShell) {
                 if (timelines && timelines->HasConsumer(docShell)) {
                   needsEndEventMarker = true;
                   nsAutoString typeStr;
                   (*aDOMEvent)->GetType(typeStr);
                   uint16_t phase = (*aDOMEvent)->EventPhase();
-                  timelines->AddMarkerForDocShell(docShell,
+                  timelines->AddMarkerForDocShell(docShell, std::move(
                     MakeUnique<EventTimelineMarker>(
-                      typeStr, phase, MarkerTracingType::START));
+                      typeStr, phase, MarkerTracingType::START)));
                 }
               }
             }
 
             aEvent->mFlags.mInPassiveListener = listener->mFlags.mPassive;
             Maybe<Listener> listenerHolder;
             if (listener->mFlags.mOnce) {
               // Move the listener to the stack before handling the event.
--- a/dom/file/uri/BlobURLProtocolHandler.cpp
+++ b/dom/file/uri/BlobURLProtocolHandler.cpp
@@ -541,17 +541,17 @@ private:
   {
     nsCOMPtr<nsIAsyncShutdownService> svc = services::GetAsyncShutdown();
     NS_ENSURE_TRUE(!!svc, nullptr);
 
     nsCOMPtr<nsIAsyncShutdownClient> phase;
     nsresult rv = svc->GetXpcomWillShutdown(getter_AddRefs(phase));
     NS_ENSURE_SUCCESS(rv, nullptr);
 
-    return phase;
+    return std::move(phase);
   }
 
   nsCString mURI;
   bool mBroadcastToOtherProcesses;
 
   nsCOMPtr<nsITimer> mTimer;
 };
 
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -1159,17 +1159,17 @@ void
 Geolocation::GetCurrentPosition(PositionCallback& aCallback,
                                 PositionErrorCallback* aErrorCallback,
                                 const PositionOptions& aOptions,
                                 CallerType aCallerType,
                                 ErrorResult& aRv)
 {
   nsresult rv = GetCurrentPosition(GeoPositionCallback(&aCallback),
                                    GeoPositionErrorCallback(aErrorCallback),
-                                   CreatePositionOptionsCopy(aOptions),
+                                   std::move(CreatePositionOptionsCopy(aOptions)),
                                    aCallerType);
 
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 }
 
 static nsIEventTarget* MainThreadTarget(Geolocation* geo)
@@ -1237,17 +1237,17 @@ Geolocation::WatchPosition(PositionCallb
                            PositionErrorCallback* aErrorCallback,
                            const PositionOptions& aOptions,
                            CallerType aCallerType,
                            ErrorResult& aRv)
 {
   int32_t ret = 0;
   nsresult rv = WatchPosition(GeoPositionCallback(&aCallback),
                               GeoPositionErrorCallback(aErrorCallback),
-                              CreatePositionOptionsCopy(aOptions),
+                              std::move(CreatePositionOptionsCopy(aOptions)),
                               aCallerType,
                               &ret);
 
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 
   return ret;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -4464,18 +4464,18 @@ ContentParent::RecvNotifyTabDestroying(c
 {
   NotifyTabDestroying(aTabId, aCpId);
   return IPC_OK();
 }
 
 nsTArray<TabContext>
 ContentParent::GetManagedTabContext()
 {
-  return ContentProcessManager::GetSingleton()->
-    GetTabContextByContentProcess(this->ChildID());
+  return std::move(ContentProcessManager::GetSingleton()->
+          GetTabContextByContentProcess(this->ChildID()));
 }
 
 mozilla::docshell::POfflineCacheUpdateParent*
 ContentParent::AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
                                               const URIParams& aDocumentURI,
                                               const PrincipalInfo& aLoadingPrincipalInfo,
                                               const bool& aStickDocument)
 {
--- a/dom/ipc/ContentProcessManager.cpp
+++ b/dom/ipc/ContentProcessManager.cpp
@@ -120,26 +120,26 @@ nsTArray<ContentParentId>
 ContentProcessManager::GetAllChildProcessById(const ContentParentId& aParentCpId)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsTArray<ContentParentId> cpIdArray;
   auto iter = mContentParentMap.find(aParentCpId);
   if (NS_WARN_IF(iter == mContentParentMap.end())) {
     ASSERT_UNLESS_FUZZING();
-    return cpIdArray;
+    return std::move(cpIdArray);
   }
 
   for (auto cpIter = iter->second.mChildrenCpId.begin();
        cpIter != iter->second.mChildrenCpId.end();
        ++cpIter) {
     cpIdArray.AppendElement(*cpIter);
   }
 
-  return cpIdArray;
+  return std::move(cpIdArray);
 }
 
 bool
 ContentProcessManager::RegisterRemoteFrame(const TabId& aTabId,
                                            const ContentParentId& aOpenerCpId,
                                            const TabId& aOpenerTabId,
                                            const IPCTabContext& aContext,
                                            const ContentParentId& aChildCpId)
@@ -231,26 +231,26 @@ nsTArray<TabContext>
 ContentProcessManager::GetTabContextByContentProcess(const ContentParentId& aChildCpId)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsTArray<TabContext> tabContextArray;
   auto iter = mContentParentMap.find(aChildCpId);
   if (NS_WARN_IF(iter == mContentParentMap.end())) {
     ASSERT_UNLESS_FUZZING();
-    return tabContextArray;
+    return std::move(tabContextArray);
   }
 
   for (auto remoteFrameIter = iter->second.mRemoteFrames.begin();
        remoteFrameIter != iter->second.mRemoteFrames.end();
        ++remoteFrameIter) {
     tabContextArray.AppendElement(remoteFrameIter->second.mContext);
   }
 
-  return tabContextArray;
+  return std::move(tabContextArray);
 }
 
 bool
 ContentProcessManager::GetRemoteFrameOpenerTabId(const ContentParentId& aChildCpId,
                                                  const TabId& aChildTabId,
                                                  /*out*/ContentParentId* aOpenerCpId,
                                                  /*out*/TabId* aOpenerTabId)
 {
@@ -332,26 +332,26 @@ nsTArray<TabId>
 ContentProcessManager::GetTabParentsByProcessId(const ContentParentId& aChildCpId)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsTArray<TabId> tabIdList;
   auto iter = mContentParentMap.find(aChildCpId);
   if (NS_WARN_IF(iter == mContentParentMap.end())) {
     ASSERT_UNLESS_FUZZING();
-    return tabIdList;
+    return std::move(tabIdList);
   }
 
   for (auto remoteFrameIter = iter->second.mRemoteFrames.begin();
       remoteFrameIter != iter->second.mRemoteFrames.end();
       ++remoteFrameIter) {
     tabIdList.AppendElement(remoteFrameIter->first);
   }
 
-  return tabIdList;
+  return std::move(tabIdList);
 }
 
 uint32_t
 ContentProcessManager::GetTabParentCountByProcessId(const ContentParentId& aChildCpId)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   auto iter = mContentParentMap.find(aChildCpId);
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -2587,17 +2587,17 @@ MediaStream::SetTrackEnabledImpl(TrackID
     }
   } else {
     for (const DisabledTrack& t : mDisabledTracks) {
       if (aTrackID == t.mTrackID) {
         NS_ERROR("Changing disabled track mode for a track is not allowed");
         return;
       }
     }
-    mDisabledTracks.AppendElement(DisabledTrack(aTrackID, aMode));
+    mDisabledTracks.AppendElement(std::move(DisabledTrack(aTrackID, aMode)));
   }
 }
 
 DisabledTrackMode
 MediaStream::GetDisabledTrackMode(TrackID aTrackID)
 {
   for (const DisabledTrack& t : mDisabledTracks) {
     if (t.mTrackID == aTrackID) {
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -759,17 +759,17 @@ GetSupportedCapabilities(
     if (!supportedCapabilities.AppendElement(capabilities, mozilla::fallible)) {
       NS_WARNING("GetSupportedCapabilities: Malloc failure");
       return Sequence<MediaKeySystemMediaCapability>();
     }
 
     // Note: omitting steps 3.13.2, our robustness is not sophisticated enough
     // to require considering all requirements together.
   }
-  return supportedCapabilities;
+  return std::move(supportedCapabilities);
 }
 
 // "Get Supported Configuration and Consent" algorithm, steps 4-7 for
 // distinctive identifier, and steps 8-11 for persistent state. The steps
 // are the same for both requirements/features, so we factor them out into
 // a single function.
 static bool
 CheckRequirement(const MediaKeysRequirement aRequirement,
--- a/dom/media/gmp/ChromiumCDMParent.cpp
+++ b/dom/media/gmp/ChromiumCDMParent.cpp
@@ -1073,17 +1073,17 @@ ChromiumCDMParent::RecvDrainComplete()
 {
   if (mIsShutdown) {
     MOZ_ASSERT(mDecodePromise.IsEmpty());
     return IPC_OK();
   }
 
   MediaDataDecoder::DecodedData samples;
   while (!mReorderQueue.IsEmpty()) {
-    samples.AppendElement(mReorderQueue.Pop());
+    samples.AppendElement(std::move(mReorderQueue.Pop()));
   }
 
   mDecodePromise.ResolveIfExists(std::move(samples), __func__);
   return IPC_OK();
 }
 RefPtr<ShutdownPromise>
 ChromiumCDMParent::ShutdownVideoDecoder()
 {
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -941,17 +941,17 @@ GMPParent::GetGMPContentParent(UniquePtr
     }
   }
 }
 
 already_AddRefed<GMPContentParent>
 GMPParent::ForgetGMPContentParent()
 {
   MOZ_ASSERT(mGetContentParentPromises.IsEmpty());
-  return mGMPContentParent.forget();
+  return std::move(mGMPContentParent.forget());
 }
 
 bool
 GMPParent::EnsureProcessLoaded(base::ProcessId* aID)
 {
   if (!EnsureProcessLoaded()) {
     return false;
   }
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -1880,17 +1880,17 @@ GMPServiceParent::ActorDestroy(ActorDest
   // Make sure the IPC channel is closed before destroying mToDelete.
   MonitorAutoLock lock(monitor);
   RefPtr<Runnable> task = NewNonOwningRunnableMethod<Monitor*, bool*>(
     "gmp::GMPServiceParent::CloseTransport",
     this,
     &GMPServiceParent::CloseTransport,
     &monitor,
     &completed);
-  XRE_GetIOMessageLoop()->PostTask(task.forget());
+  XRE_GetIOMessageLoop()->PostTask(std::move(task.forget()));
 
   while (!completed) {
     lock.Wait();
   }
 
   // Dispatch a task to the current thread to ensure we don't delete the
   // GMPServiceParent until the current calling context is finished with
   // the object.
--- a/dom/media/gmp/GMPStorageChild.cpp
+++ b/dom/media/gmp/GMPStorageChild.cpp
@@ -21,17 +21,17 @@
     } \
   } while(false)
 
 static nsTArray<uint8_t>
 ToArray(const uint8_t* aData, uint32_t aDataSize)
 {
   nsTArray<uint8_t> data;
   data.AppendElements(aData, aDataSize);
-  return data;
+  return std::move(data);
 }
 
 namespace mozilla {
 namespace gmp {
 
 GMPRecordImpl::GMPRecordImpl(GMPStorageChild* aOwner,
                              const nsCString& aName,
                              GMPRecordClient* aClient)
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -39,17 +39,17 @@ using namespace gfx;
 SurfaceDescriptorGPUVideo
 VideoDecoderManagerParent::StoreImage(Image* aImage, TextureClient* aTexture)
 {
   SurfaceDescriptorGPUVideo ret;
   aTexture->GPUVideoDesc(&ret);
 
   mImageMap[ret.handle()] = aImage;
   mTextureMap[ret.handle()] = aTexture;
-  return ret;
+  return std::move(ret);
 }
 
 StaticRefPtr<nsIThread> sVideoDecoderManagerThread;
 StaticRefPtr<TaskQueue> sManagerTaskQueue;
 
 class VideoDecoderManagerThreadHolder
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderManagerThreadHolder)
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -252,17 +252,17 @@ AppleVTDecoder::ProcessDrain()
   AssertOnTaskQueueThread();
   nsresult rv = WaitForAsynchronousFrames();
   if (NS_FAILED(rv)) {
     LOG("AppleVTDecoder::Drain failed waiting for platform decoder");
   }
   MonitorAutoLock mon(mMonitor);
   DecodedData samples;
   while (!mReorderQueue.IsEmpty()) {
-    samples.AppendElement(mReorderQueue.Pop());
+    samples.AppendElement(std::move(mReorderQueue.Pop()));
   }
   return DecodePromise::CreateAndResolve(std::move(samples), __func__);
 }
 
 AppleVTDecoder::AppleFrameRef*
 AppleVTDecoder::CreateAppleFrameRef(const MediaRawData* aSample)
 {
   MOZ_ASSERT(aSample);
--- a/dom/media/platforms/omx/OmxPlatformLayer.cpp
+++ b/dom/media/platforms/omx/OmxPlatformLayer.cpp
@@ -168,17 +168,17 @@ ConfigForMime(const nsACString& aMimeTyp
                 aMimeType.EqualsLiteral("audio/mpeg")) {
       conf.reset(new OmxMp3Config());
     } else if (aMimeType.EqualsLiteral("audio/3gpp")) {
       conf.reset(new OmxAmrConfig<OmxAmrSampleRate::kNarrowBand>());
     } else if (aMimeType.EqualsLiteral("audio/amr-wb")) {
       conf.reset(new OmxAmrConfig<OmxAmrSampleRate::kWideBand>());
     }
   }
-  return conf;
+  return std::move(conf);
 }
 
 // There should be a better way to calculate it.
 #define MIN_VIDEO_INPUT_BUFFER_SIZE 64 * 1024
 
 class OmxCommonVideoConfig : public OmxVideoConfig
 {
 public:
@@ -226,17 +226,17 @@ template<>
 UniquePtr<OmxVideoConfig>
 ConfigForMime(const nsACString& aMimeType)
 {
   UniquePtr<OmxVideoConfig> conf;
 
   if (OmxPlatformLayer::SupportsMimeType(aMimeType)) {
     conf.reset(new OmxCommonVideoConfig());
   }
-  return conf;
+  return std::move(conf);
 }
 
 OMX_ERRORTYPE
 OmxPlatformLayer::Config()
 {
   MOZ_ASSERT(mInfo);
 
   OMX_PORT_PARAM_TYPE portParam;
--- a/dom/serviceworkers/ServiceWorkerDescriptor.cpp
+++ b/dom/serviceworkers/ServiceWorkerDescriptor.cpp
@@ -98,17 +98,17 @@ ServiceWorkerDescriptor::PrincipalInfo()
   return mData->principalInfo();
 }
 
 nsCOMPtr<nsIPrincipal>
 ServiceWorkerDescriptor::GetPrincipal() const
 {
   AssertIsOnMainThread();
   nsCOMPtr<nsIPrincipal> ref =  PrincipalInfoToPrincipal(mData->principalInfo());
-  return ref;
+  return std::move(ref);
 }
 
 const nsCString&
 ServiceWorkerDescriptor::Scope() const
 {
   return mData->scope();
 }
 
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -319,51 +319,51 @@ ServiceWorkerManager::StartControllingCl
   const ServiceWorkerDescriptor& active =
     aRegistrationInfo->GetActive()->Descriptor();
 
   auto entry = mControlledClients.LookupForAdd(aClientInfo.Id());
   if (entry) {
     RefPtr<ServiceWorkerRegistrationInfo> old =
       entry.Data()->mRegistrationInfo.forget();
 
-    ref = entry.Data()->mClientHandle->Control(active);
+    ref = std::move(entry.Data()->mClientHandle->Control(active));
     entry.Data()->mRegistrationInfo = aRegistrationInfo;
 
     if (old != aRegistrationInfo) {
       StopControllingRegistration(old);
       aRegistrationInfo->StartControllingClient();
     }
 
     Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
 
-    return ref;
+    return std::move(ref);
   }
 
   RefPtr<ClientHandle> clientHandle =
     ClientManager::CreateHandle(aClientInfo,
                                 SystemGroup::EventTargetFor(TaskCategory::Other));
 
-  ref = clientHandle->Control(active);
+  ref = std::move(clientHandle->Control(active));
 
   aRegistrationInfo->StartControllingClient();
 
   entry.OrInsert([&] {
     return new ControlledClientData(clientHandle, aRegistrationInfo);
   });
 
   RefPtr<ServiceWorkerManager> self(this);
   clientHandle->OnDetach()->Then(
     SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
     [self = std::move(self), aClientInfo] {
       self->StopControllingClient(aClientInfo);
     });
 
   Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
 
-  return ref;
+  return std::move(ref);
 }
 
 void
 ServiceWorkerManager::StopControllingClient(const ClientInfo& aClientInfo)
 {
   auto entry = mControlledClients.Lookup(aClientInfo.Id());
   if (!entry) {
     return;
--- a/dom/serviceworkers/ServiceWorkerRegistrar.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrar.cpp
@@ -1276,17 +1276,17 @@ ServiceWorkerRegistrar::GetShutdownPhase
   // memory), and there's no point in continuing startup. Include as much
   // information as possible in the crash report.
   RELEASE_ASSERT_SUCCEEDED(rv, "async shutdown service");
 
 
   nsCOMPtr<nsIAsyncShutdownClient> client;
   rv = svc->GetProfileBeforeChange(getter_AddRefs(client));
   RELEASE_ASSERT_SUCCEEDED(rv, "profileBeforeChange shutdown blocker");
-  return client;
+  return std::move(client);
 }
 
 #undef RELEASE_ASSERT_SUCCEEDED
 
 void
 ServiceWorkerRegistrar::Shutdown()
 {
   AssertIsOnBackgroundThread();
--- a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp
@@ -22,17 +22,17 @@ ServiceWorkerRegistrationDescriptor::New
   Maybe<IPCServiceWorkerDescriptor> result;
   if (mData->installing().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(mData->installing().get_IPCServiceWorkerDescriptor());
   } else if (mData->waiting().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(mData->waiting().get_IPCServiceWorkerDescriptor());
   } else if (mData->active().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(mData->active().get_IPCServiceWorkerDescriptor());
   }
-  return result;
+  return std::move(result);
 }
 
 ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor(
                                     uint64_t aId,
                                     nsIPrincipal* aPrincipal,
                                     const nsACString& aScope,
                                     ServiceWorkerUpdateViaCache aUpdateViaCache)
   : mData(MakeUnique<IPCServiceWorkerRegistrationDescriptor>())
@@ -133,17 +133,17 @@ ServiceWorkerRegistrationDescriptor::Pri
   return mData->principalInfo();
 }
 
 nsCOMPtr<nsIPrincipal>
 ServiceWorkerRegistrationDescriptor::GetPrincipal() const
 {
   AssertIsOnMainThread();
   nsCOMPtr<nsIPrincipal> ref =  PrincipalInfoToPrincipal(mData->principalInfo());
-  return ref;
+  return std::move(ref);
 }
 
 const nsCString&
 ServiceWorkerRegistrationDescriptor::Scope() const
 {
   return mData->scope();
 }
 
@@ -152,54 +152,54 @@ ServiceWorkerRegistrationDescriptor::Get
 {
   Maybe<ServiceWorkerDescriptor> result;
 
   if (mData->installing().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(ServiceWorkerDescriptor(
       mData->installing().get_IPCServiceWorkerDescriptor()));
   }
 
-  return result;
+  return std::move(result);
 }
 
 Maybe<ServiceWorkerDescriptor>
 ServiceWorkerRegistrationDescriptor::GetWaiting() const
 {
   Maybe<ServiceWorkerDescriptor> result;
 
   if (mData->waiting().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(ServiceWorkerDescriptor(
       mData->waiting().get_IPCServiceWorkerDescriptor()));
   }
 
-  return result;
+  return std::move(result);
 }
 
 Maybe<ServiceWorkerDescriptor>
 ServiceWorkerRegistrationDescriptor::GetActive() const
 {
   Maybe<ServiceWorkerDescriptor> result;
 
   if (mData->active().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
     result.emplace(ServiceWorkerDescriptor(
       mData->active().get_IPCServiceWorkerDescriptor()));
   }
 
-  return result;
+  return std::move(result);
 }
 
 Maybe<ServiceWorkerDescriptor>
 ServiceWorkerRegistrationDescriptor::Newest() const
 {
   Maybe<ServiceWorkerDescriptor> result;
   Maybe<IPCServiceWorkerDescriptor> newest(NewestInternal());
   if (newest.isSome()) {
     result.emplace(ServiceWorkerDescriptor(newest.ref()));
   }
-  return result;
+  return std::move(result);
 }
 
 namespace {
 
 bool
 IsValidWorker(const OptionalIPCServiceWorkerDescriptor& aWorker,
               const nsACString& aScope,
               const mozilla::ipc::ContentPrincipalInfo& aContentPrincipal)
--- a/dom/u2f/U2F.cpp
+++ b/dom/u2f/U2F.cpp
@@ -272,17 +272,17 @@ U2F::Register(const nsAString& aAppId,
                                   adjustedAppId,
                                   challenge,
                                   clientData,
                                   adjustedTimeoutMillis,
                                   excludeList,
                                   null_t() /* no extra info for U2F */);
 
   MOZ_ASSERT(mTransaction.isNothing());
-  mTransaction = Some(U2FTransaction(AsVariant(callback)));
+  mTransaction = Some(U2FTransaction(std::move(AsVariant(callback))));
   mChild->SendRequestRegister(mTransaction.ref().mId, info);
 }
 
 void
 U2F::FinishMakeCredential(const uint64_t& aTransactionId,
                           const WebAuthnMakeCredentialResult& aResult)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -418,17 +418,17 @@ U2F::Sign(const nsAString& aAppId,
                                 adjustedAppId,
                                 challenge,
                                 clientData,
                                 adjustedTimeoutMillis,
                                 permittedList,
                                 null_t() /* no extra info for U2F */);
 
   MOZ_ASSERT(mTransaction.isNothing());
-  mTransaction = Some(U2FTransaction(AsVariant(callback)));
+  mTransaction = Some(U2FTransaction(std::move(AsVariant(callback))));
   mChild->SendRequestSign(mTransaction.ref().mId, info);
 }
 
 void
 U2F::FinishGetAssertion(const uint64_t& aTransactionId,
                         const WebAuthnGetAssertionResult& aResult)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3492,30 +3492,30 @@ WorkerPrivate::EnsurePerformanceStorage(
 
 Maybe<ClientInfo>
 WorkerPrivate::GetClientInfo() const
 {
   AssertIsOnWorkerThread();
   Maybe<ClientInfo> clientInfo;
   if (!mClientSource) {
     MOZ_DIAGNOSTIC_ASSERT(mStatus >= Terminating);
-    return clientInfo;
+    return std::move(clientInfo);
   }
   clientInfo.emplace(mClientSource->Info());
-  return clientInfo;
+  return std::move(clientInfo);
 }
 
 const ClientState
 WorkerPrivate::GetClientState() const
 {
   AssertIsOnWorkerThread();
   MOZ_DIAGNOSTIC_ASSERT(mClientSource);
   ClientState state;
   mClientSource->SnapshotState(&state);
-  return state;
+  return std::move(state);
 }
 
 const Maybe<ServiceWorkerDescriptor>
 WorkerPrivate::GetController()
 {
   AssertIsOnWorkerThread();
   {
     MutexAutoLock lock(mMutex);
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -543,17 +543,17 @@ WorkerGlobalScope::GetClientInfo() const
   return mWorkerPrivate->GetClientInfo();
 }
 
 Maybe<ClientState>
 WorkerGlobalScope::GetClientState() const
 {
   Maybe<ClientState> state;
   state.emplace(mWorkerPrivate->GetClientState());
-  return state;
+  return std::move(state);
 }
 
 Maybe<ServiceWorkerDescriptor>
 WorkerGlobalScope::GetController() const
 {
   return mWorkerPrivate->GetController();
 }
 
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -225,17 +225,17 @@ HTMLEditor::CreateAnonymousElement(nsAto
   // sort of ok.
   newContent->SetProperty(nsGkAtoms::restylableAnonymousNode,
 			  reinterpret_cast<void*>(true));
 #endif // DEBUG
 
   // display the element
   ps->PostRecreateFramesFor(newContent);
 
-  return newContent;
+  return std::move(newContent);
 }
 
 // Removes event listener and calls DeleteRefToAnonymousNode.
 void
 HTMLEditor::RemoveListenerAndDeleteRef(const nsAString& aEvent,
                                        nsIDOMEventListener* aListener,
                                        bool aUseCapture,
                                        ManualNACPtr aElement,
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -6016,17 +6016,18 @@ HTMLEditRules::CreateStyleForInsertText(
   int32_t offset = firstRange->StartOffset();
 
   RefPtr<Element> rootElement = aDocument.GetRootElement();
   if (NS_WARN_IF(!rootElement)) {
     return NS_ERROR_FAILURE;
   }
 
   // process clearing any styles first
-  UniquePtr<PropItem> item = HTMLEditorRef().mTypeInState->TakeClearProperty();
+  UniquePtr<PropItem> item =
+    std::move(HTMLEditorRef().mTypeInState->TakeClearProperty());
 
   {
     // Transactions may set selection, but we will set selection if necessary.
     AutoTransactionsConserveSelection dontChangeMySelection(&HTMLEditorRef());
 
     while (item && node != rootElement) {
       // XXX If we redesign ClearStyle(), we can use EditorDOMPoint in this
       //     method.
@@ -6034,24 +6035,24 @@ HTMLEditRules::CreateStyleForInsertText(
         HTMLEditorRef().ClearStyle(address_of(node), &offset,
                                    item->tag, item->attr);
       if (NS_WARN_IF(!CanHandleEditAction())) {
         return NS_ERROR_EDITOR_DESTROYED;
       }
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      item = HTMLEditorRef().mTypeInState->TakeClearProperty();
+      item = std::move(HTMLEditorRef().mTypeInState->TakeClearProperty());
       weDidSomething = true;
     }
   }
 
   // then process setting any styles
   int32_t relFontSize = HTMLEditorRef().mTypeInState->TakeRelativeFontSize();
-  item = HTMLEditorRef().mTypeInState->TakeSetProperty();
+  item = std::move(HTMLEditorRef().mTypeInState->TakeSetProperty());
 
   if (item || relFontSize) {
     // we have at least one style to add; make a new text node to insert style
     // nodes above.
     if (RefPtr<Text> text = node->GetAsText()) {
       // if we are in a text node, split it
       SplitNodeResult splitTextNodeResult =
         HTMLEditorRef().SplitNodeDeepWithTransaction(
--- a/editor/libeditor/HTMLEditorObjectResizer.cpp
+++ b/editor/libeditor/HTMLEditorObjectResizer.cpp
@@ -140,17 +140,17 @@ HTMLEditor::CreateResizer(int16_t aLocat
     case nsIHTMLObjectResizer::eBottomRight:
       locationStr = kBottomRight;
       break;
   }
 
   nsresult rv =
     ret->SetAttr(kNameSpaceID_None, nsGkAtoms::anonlocation, locationStr, true);
   NS_ENSURE_SUCCESS(rv, nullptr);
-  return ret;
+  return std::move(ret);
 }
 
 ManualNACPtr
 HTMLEditor::CreateShadow(nsIContent& aParentContent,
                          Element& aOriginalObject)
 {
   // let's create an image through the element factory
   RefPtr<nsAtom> name;
--- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp
+++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp
@@ -34,17 +34,17 @@ RemoteSpellcheckEngineChild::SetCurrentD
   if (!SendSetDictionaryFromList(
          aList,
          reinterpret_cast<intptr_t>(promiseHolder.get()))) {
     return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
   }
   RefPtr<GenericPromise> result = promiseHolder->Ensure(__func__);
   // promiseHolder will removed by receive message
   mResponsePromises.AppendElement(std::move(promiseHolder));
-  return result;
+  return std::move(result);
 }
 
 mozilla::ipc::IPCResult
 RemoteSpellcheckEngineChild::RecvNotifyOfCurrentDictionary(
                                const nsString& aDictionary,
                                const intptr_t& aId)
 {
   MozPromiseHolder<GenericPromise>* promiseHolder =
--- a/gfx/2d/SFNTData.cpp
+++ b/gfx/2d/SFNTData.cpp
@@ -134,25 +134,25 @@ SFNTData::Create(const uint8_t *aFontDat
     const BigEndianUint32* endOfOffsets = offset + numFonts;
     while (offset != endOfOffsets) {
       if (!sfntData->AddFont(aFontData, aDataLength, *offset)) {
         return nullptr;
       }
       ++offset;
     }
 
-    return sfntData;
+    return std::move(sfntData);
   }
 
   UniquePtr<SFNTData> sfntData(new SFNTData);
   if (!sfntData->AddFont(aFontData, aDataLength, 0)) {
     return nullptr;
   }
 
-  return sfntData;
+  return std::move(sfntData);
 }
 
 /* static */
 uint64_t
 SFNTData::GetUniqueKey(const uint8_t *aFontData, uint32_t aDataLength,
                        uint32_t aVarDataSize, const void* aVarData)
 {
   uint64_t hash;
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -43,28 +43,28 @@ UniquePtr<GLScreenBuffer>
 GLScreenBuffer::Create(GLContext* gl,
                        const gfx::IntSize& size,
                        const SurfaceCaps& caps)
 {
     UniquePtr<GLScreenBuffer> ret;
     if (caps.antialias &&
         !gl->IsSupported(GLFeature::framebuffer_multisample))
     {
-        return ret;
+        return std::move(ret);
     }
 
     layers::TextureFlags flags = layers::TextureFlags::ORIGIN_BOTTOM_LEFT;
     if (!caps.premultAlpha) {
         flags |= layers::TextureFlags::NON_PREMULTIPLIED;
     }
 
     UniquePtr<SurfaceFactory> factory = MakeUnique<SurfaceFactory_Basic>(gl, caps, flags);
 
     ret.reset( new GLScreenBuffer(gl, caps, std::move(factory)) );
-    return ret;
+    return std::move(ret);
 }
 
 /* static */ UniquePtr<SurfaceFactory>
 GLScreenBuffer::CreateFactory(GLContext* gl,
                               const SurfaceCaps& caps,
                               KnowsCompositor* compositorConnection,
                               const layers::TextureFlags& flags)
 {
@@ -948,17 +948,17 @@ ReadBuffer::Create(GLContext* gl,
     const bool isComplete = gl->IsFramebufferComplete(fb);
     if (needsAcquire) {
         surf->ProducerReadRelease();
     }
 
     if (!isComplete)
         return nullptr;
 
-    return ret;
+    return std::move(ret);
 }
 
 ReadBuffer::~ReadBuffer()
 {
     if (!mGL->MakeCurrent())
         return;
 
     GLuint fb = mFB;
--- a/gfx/gl/MozFramebuffer.cpp
+++ b/gfx/gl/MozFramebuffer.cpp
@@ -129,17 +129,17 @@ MozFramebuffer::CreateWith(GLContext* co
     }
 
     const auto status = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
     if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
         MOZ_ASSERT(false);
         return nullptr;
     }
 
-    return mozFB;
+    return std::move(mozFB);
 }
 
 ////////////////////
 
 MozFramebuffer::MozFramebuffer(GLContext* const gl, const gfx::IntSize& size,
                                const uint32_t samples, const bool depthStencil,
                                const GLenum colorTarget, const GLuint colorName)
     : mWeakGL(gl)
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -327,17 +327,17 @@ SurfaceFactory::NewTexClient(const gfx::
         if (cur->Surf()->mSize == size) {
             cur->Surf()->WaitForBufferOwnership();
             return cur.forget();
         }
 
         StopRecycling(cur);
     }
 
-    UniquePtr<SharedSurface> surf = CreateShared(size);
+    UniquePtr<SharedSurface> surf = std::move(CreateShared(size));
     if (!surf)
         return nullptr;
 
     RefPtr<layers::SharedSurfaceTextureClient> ret;
     ret = layers::SharedSurfaceTextureClient::Create(std::move(surf), this, mAllocator, mFlags);
 
     StartRecycling(ret);
 
--- a/gfx/gl/SharedSurfaceEGL.cpp
+++ b/gfx/gl/SharedSurfaceEGL.cpp
@@ -25,37 +25,37 @@ SharedSurface_EGLImage::Create(GLContext
 {
     GLLibraryEGL* egl = &sEGLLibrary;
     MOZ_ASSERT(egl);
     MOZ_ASSERT(context);
 
     UniquePtr<SharedSurface_EGLImage> ret;
 
     if (!HasExtensions(egl, prodGL)) {
-        return ret;
+        return std::move(ret);
     }
 
     MOZ_ALWAYS_TRUE(prodGL->MakeCurrent());
     GLuint prodTex = CreateTextureForOffscreen(prodGL, formats, size);
     if (!prodTex) {
-        return ret;
+        return std::move(ret);
     }
 
     EGLClientBuffer buffer = reinterpret_cast<EGLClientBuffer>(uintptr_t(prodTex));
     EGLImage image = egl->fCreateImage(egl->Display(), context,
                                        LOCAL_EGL_GL_TEXTURE_2D, buffer,
                                        nullptr);
     if (!image) {
         prodGL->fDeleteTextures(1, &prodTex);
-        return ret;
+        return std::move(ret);
     }
 
     ret.reset( new SharedSurface_EGLImage(prodGL, egl, size, hasAlpha,
                                           formats, prodTex, image) );
-    return ret;
+    return std::move(ret);
 }
 
 bool
 SharedSurface_EGLImage::HasExtensions(GLLibraryEGL* egl, GLContext* gl)
 {
     return egl->HasKHRImageBase() &&
            egl->IsExtensionSupported(GLLibraryEGL::KHR_gl_texture_2D_image) &&
            (gl->IsExtensionSupported(GLContext::OES_EGL_image_external) ||
@@ -172,17 +172,17 @@ SurfaceFactory_EGLImage::Create(GLContex
     typedef SurfaceFactory_EGLImage ptrT;
     UniquePtr<ptrT> ret;
 
     GLLibraryEGL* egl = &sEGLLibrary;
     if (SharedSurface_EGLImage::HasExtensions(egl, prodGL)) {
         ret.reset( new ptrT(prodGL, caps, allocator, flags, context) );
     }
 
-    return ret;
+    return std::move(ret);
 }
 
 ////////////////////////////////////////////////////////////////////////
 
 #ifdef MOZ_WIDGET_ANDROID
 
 /*static*/ UniquePtr<SharedSurface_SurfaceTexture>
 SharedSurface_SurfaceTexture::Create(GLContext* prodGL,
@@ -195,22 +195,22 @@ SharedSurface_SurfaceTexture::Create(GLC
 
     UniquePtr<SharedSurface_SurfaceTexture> ret;
 
     AndroidNativeWindow window(surface);
     GLContextEGL* egl = GLContextEGL::Cast(prodGL);
     MOZ_ASSERT(egl);
     EGLSurface eglSurface = egl->CreateCompatibleSurface(window.NativeWindow());
     if (!eglSurface) {
-        return ret;
+        return std::move(ret);
     }
 
     ret.reset(new SharedSurface_SurfaceTexture(prodGL, size, hasAlpha,
                                                formats, surface, eglSurface));
-    return ret;
+    return std::move(ret);
 }
 
 SharedSurface_SurfaceTexture::SharedSurface_SurfaceTexture(GLContext* gl,
                                                            const gfx::IntSize& size,
                                                            bool hasAlpha,
                                                            const GLFormats& formats,
                                                            java::GeckoSurface::Param surface,
                                                            EGLSurface eglSurface)
@@ -287,17 +287,17 @@ SharedSurface_SurfaceTexture::ToSurfaceD
 
 /*static*/ UniquePtr<SurfaceFactory_SurfaceTexture>
 SurfaceFactory_SurfaceTexture::Create(GLContext* prodGL, const SurfaceCaps& caps,
                                       const RefPtr<layers::LayersIPCChannel>& allocator,
                                       const layers::TextureFlags& flags)
 {
     UniquePtr<SurfaceFactory_SurfaceTexture> ret(
         new SurfaceFactory_SurfaceTexture(prodGL, caps, allocator, flags));
-    return ret;
+    return std::move(ret);
 }
 
 UniquePtr<SharedSurface>
 SurfaceFactory_SurfaceTexture::CreateShared(const gfx::IntSize& size)
 {
     bool hasAlpha = mReadCaps.alpha;
 
     jni::Object::LocalRef surface = java::SurfaceAllocator::AcquireSurface(size.width, size.height, true);
--- a/gfx/gl/SharedSurfaceGL.cpp
+++ b/gfx/gl/SharedSurfaceGL.cpp
@@ -28,35 +28,35 @@ SharedSurface_Basic::Create(GLContext* g
 
     GLContext::LocalErrorScope localError(*gl);
     GLuint tex = CreateTextureForOffscreen(gl, formats, size);
 
     GLenum err = localError.GetError();
     MOZ_ASSERT_IF(err != LOCAL_GL_NO_ERROR, err == LOCAL_GL_OUT_OF_MEMORY);
     if (err) {
         gl->fDeleteTextures(1, &tex);
-        return ret;
+        return std::move(ret);
     }
 
     bool ownsTex = true;
     ret.reset( new SharedSurface_Basic(gl, size, hasAlpha, tex, ownsTex) );
-    return ret;
+    return std::move(ret);
 }
 
 
 /*static*/ UniquePtr<SharedSurface_Basic>
 SharedSurface_Basic::Wrap(GLContext* gl,
                           const IntSize& size,
                           bool hasAlpha,
                           GLuint tex)
 {
     bool ownsTex = false;
     UniquePtr<SharedSurface_Basic> ret( new SharedSurface_Basic(gl, size, hasAlpha, tex,
                                                                 ownsTex) );
-    return ret;
+    return std::move(ret);
 }
 
 SharedSurface_Basic::SharedSurface_Basic(GLContext* gl,
                                          const IntSize& size,
                                          bool hasAlpha,
                                          GLuint tex,
                                          bool ownsTex)
     : SharedSurface(SharedSurfaceType::Basic,
@@ -121,22 +121,22 @@ SharedSurface_GLTexture::Create(GLContex
     GLContext::LocalErrorScope localError(*prodGL);
 
     GLuint tex = CreateTextureForOffscreen(prodGL, formats, size);
 
     GLenum err = localError.GetError();
     MOZ_ASSERT_IF(err, err == LOCAL_GL_OUT_OF_MEMORY);
     if (err) {
         prodGL->fDeleteTextures(1, &tex);
-        return ret;
+        return std::move(ret);
     }
 
     ret.reset(new SharedSurface_GLTexture(prodGL, size,
                                           hasAlpha, tex));
-    return ret;
+    return std::move(ret);
 }
 
 SharedSurface_GLTexture::~SharedSurface_GLTexture()
 {
     if (!mGL->MakeCurrent())
         return;
 
     if (mTex) {
--- a/gfx/gl/SharedSurfaceIO.cpp
+++ b/gfx/gl/SharedSurfaceIO.cpp
@@ -21,17 +21,17 @@ SharedSurface_IOSurface::Create(const Re
 {
     MOZ_ASSERT(ioSurf);
     MOZ_ASSERT(gl);
 
     auto size = gfx::IntSize::Truncate(ioSurf->GetWidth(), ioSurf->GetHeight());
 
     typedef SharedSurface_IOSurface ptrT;
     UniquePtr<ptrT> ret( new ptrT(ioSurf, gl, size, hasAlpha) );
-    return ret;
+    return std::move(ret);
 }
 
 void
 SharedSurface_IOSurface::ProducerReleaseImpl()
 {
     mGL->MakeCurrent();
     mGL->fFlush();
 }
@@ -214,17 +214,17 @@ SurfaceFactory_IOSurface::Create(GLConte
                                  const RefPtr<layers::LayersIPCChannel>& allocator,
                                  const layers::TextureFlags& flags)
 {
     auto maxDims = gfx::IntSize::Truncate(MacIOSurface::GetMaxWidth(),
                                           MacIOSurface::GetMaxHeight());
 
     typedef SurfaceFactory_IOSurface ptrT;
     UniquePtr<ptrT> ret( new ptrT(gl, caps, allocator, flags, maxDims) );
-    return ret;
+    return std::move(ret);
 }
 
 UniquePtr<SharedSurface>
 SurfaceFactory_IOSurface::CreateShared(const gfx::IntSize& size)
 {
     if (size.width > mMaxDims.width ||
         size.height > mMaxDims.height)
     {
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -108,17 +108,17 @@ CompositorAnimationStorage::SetAnimatedV
 void
 CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
                                              gfx::Matrix4x4&& aTransformInDevSpace)
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   const TransformData dontCare = {};
   SetAnimatedValue(aId,
                    std::move(aTransformInDevSpace),
-                   gfx::Matrix4x4(),
+                   std::move(gfx::Matrix4x4()),
                    dontCare);
 }
 
 void
 CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
                                              const float& aOpacity)
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
@@ -576,18 +576,18 @@ AnimationHelper::SetAnimations(
     data->mTiming = TimingParams {
       animation.duration(),
       animation.delay(),
       animation.endDelay(),
       animation.iterations(),
       animation.iterationStart(),
       static_cast<dom::PlaybackDirection>(animation.direction()),
       static_cast<dom::FillMode>(animation.fillMode()),
-      AnimationUtils::TimingFunctionToComputedTimingFunction(
-           animation.easingFunction())
+      std::move(AnimationUtils::TimingFunctionToComputedTimingFunction(
+           animation.easingFunction()))
     };
     InfallibleTArray<Maybe<ComputedTimingFunction>>& functions =
       data->mFunctions;
     InfallibleTArray<RefPtr<RawServoAnimationValue>>& startValues =
       data->mStartValues;
     InfallibleTArray<RefPtr<RawServoAnimationValue>>& endValues =
       data->mEndValues;
 
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -341,17 +341,17 @@ struct ContainerLayerProperties : public
 {
   explicit ContainerLayerProperties(ContainerLayer* aLayer)
     : LayerPropertiesBase(aLayer)
     , mPreXScale(aLayer->GetPreXScale())
     , mPreYScale(aLayer->GetPreYScale())
   {
     for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) {
       child->CheckCanary();
-      mChildren.AppendElement(CloneLayerTreePropertiesInternal(child));
+      mChildren.AppendElement(std::move(CloneLayerTreePropertiesInternal(child)));
     }
   }
 
 protected:
   ContainerLayerProperties(const ContainerLayerProperties& a) = delete;
   ContainerLayerProperties& operator=(const ContainerLayerProperties& a) = delete;
 
 public:
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -139,17 +139,17 @@ CompositorVsyncScheduler::PostVRTask(Tim
   MonitorAutoLock lockVR(mCurrentVRListenerTaskMonitor);
   if (mCurrentVRListenerTask == nullptr && VRListenerThreadHolder::Loop()) {
     RefPtr<Runnable> task = NewRunnableMethod<TimeStamp>(
       "layers::CompositorVsyncScheduler::DispatchVREvents",
       this,
       &CompositorVsyncScheduler::DispatchVREvents,
       aTimestamp);
     mCurrentVRListenerTask = task;
-    VRListenerThreadHolder::Loop()->PostDelayedTask(task.forget(), 0);
+    VRListenerThreadHolder::Loop()->PostDelayedTask(std::move(task.forget()), 0);
   }
 }
 
 void
 CompositorVsyncScheduler::ScheduleComposition()
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   if (!mVsyncObserver) {
--- a/gfx/layers/ipc/UiCompositorControllerParent.cpp
+++ b/gfx/layers/ipc/UiCompositorControllerParent.cpp
@@ -24,17 +24,17 @@ typedef CompositorBridgeParent::LayerTre
 /* static */ RefPtr<UiCompositorControllerParent>
 UiCompositorControllerParent::GetFromRootLayerTreeId(const LayersId& aRootLayerTreeId)
 {
   RefPtr<UiCompositorControllerParent> controller;
   CompositorBridgeParent::CallWithIndirectShadowTree(aRootLayerTreeId,
     [&](LayerTreeState& aState) -> void {
       controller = aState.mUiControllerParent;
     });
-  return controller;
+  return std::move(controller);
 }
 
 /* static */ RefPtr<UiCompositorControllerParent>
 UiCompositorControllerParent::Start(const LayersId& aRootLayerTreeId, Endpoint<PUiCompositorControllerParent>&& aEndpoint)
 {
   RefPtr<UiCompositorControllerParent> parent = new UiCompositorControllerParent(aRootLayerTreeId);
 
   RefPtr<Runnable> task =
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -1538,17 +1538,17 @@ PaintByLayer(nsDisplayItem* aItem,
              nsDisplayListBuilder* aDisplayListBuilder,
              const RefPtr<BasicLayerManager>& aManager,
              gfxContext* aContext,
              const gfx::Size& aScale,
              const std::function<void()>& aPaintFunc)
 {
   UniquePtr<LayerProperties> props;
   if (aManager->GetRoot()) {
-    props = LayerProperties::CloneFrom(aManager->GetRoot());
+    props = std::move(LayerProperties::CloneFrom(aManager->GetRoot()));
   }
   FrameLayerBuilder* layerBuilder = new FrameLayerBuilder();
   layerBuilder->Init(aDisplayListBuilder, aManager, nullptr, true);
   layerBuilder->DidBeginRetainedLayerTransaction(aManager);
 
   aManager->SetDefaultTarget(aContext);
   aManager->BeginTransactionWithTarget(aContext);
   bool isInvalidated = false;
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2549,17 +2549,17 @@ gfxFont::Measure(const gfxTextRun *aText
 {
     // If aBoundingBoxType is TIGHT_HINTED_OUTLINE_EXTENTS
     // and the underlying cairo font may be antialiased,
     // we need to create a copy in order to avoid getting cached extents.
     // This is only used by MathML layout at present.
     if (aBoundingBoxType == TIGHT_HINTED_OUTLINE_EXTENTS &&
         mAntialiasOption != kAntialiasNone) {
         if (!mNonAAFont) {
-            mNonAAFont = CopyWithAntialiasOption(kAntialiasNone);
+            mNonAAFont = std::move(CopyWithAntialiasOption(kAntialiasNone));
         }
         // if font subclass doesn't implement CopyWithAntialiasOption(),
         // it will return null and we'll proceed to use the existing font
         if (mNonAAFont) {
             return mNonAAFont->Measure(aTextRun, aStart, aEnd,
                                        TIGHT_HINTED_OUTLINE_EXTENTS,
                                        aRefDrawTarget, aSpacing, aOrientation);
         }
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1829,17 +1829,17 @@ gfxPlatform::GetBackendPrefs() const
   data.mContentBitmask = BackendTypeBit(BackendType::CAIRO);
 #ifdef USE_SKIA
   data.mCanvasBitmask |= BackendTypeBit(BackendType::SKIA);
   data.mContentBitmask |= BackendTypeBit(BackendType::SKIA);
 #endif
   data.mCanvasDefault = BackendType::CAIRO;
   data.mContentDefault = BackendType::CAIRO;
 
-  return data;
+  return std::move(data);
 }
 
 void
 gfxPlatform::InitBackendPrefs(BackendPrefsData&& aPrefsData)
 {
     mPreferredCanvasBackend = GetCanvasBackendPref(aPrefsData.mCanvasBitmask);
     if (mPreferredCanvasBackend == BackendType::NONE) {
         mPreferredCanvasBackend = aPrefsData.mCanvasDefault;
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -98,17 +98,17 @@ gfxPlatformMac::GetBackendPrefs() const
 {
   BackendPrefsData data;
 
   data.mCanvasBitmask = BackendTypeBit(BackendType::SKIA);
   data.mContentBitmask = BackendTypeBit(BackendType::SKIA);
   data.mCanvasDefault = BackendType::SKIA;
   data.mContentDefault = BackendType::SKIA;
 
-  return data;
+  return std::move(data);
 }
 
 bool
 gfxPlatformMac::UsesTiling() const
 {
     // The non-tiling ContentClient requires CrossProcessSemaphore which
     // isn't implemented for OSX.
     return true;
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -198,17 +198,17 @@ LexerTransition<ICOState>
 nsICODecoder::IterateUnsizedDirEntry()
 {
   MOZ_ASSERT(!mUnsizedDirEntries.IsEmpty());
 
   if (!mDirEntry) {
     // The first time we are here, there is no entry selected. We must prepare a
     // new iterator for the contained decoder to advance as it wills. Cloning at
     // this point ensures it will begin at the end of the dir entries.
-    mReturnIterator = mLexer.Clone(*mIterator, SIZE_MAX);
+    mReturnIterator = std::move(mLexer.Clone(*mIterator, SIZE_MAX));
     if (mReturnIterator.isNothing()) {
       // If we cannot read further than this point, then there is no resource
       // data to read.
       return Transition::TerminateFailure();
     }
   } else {
     // We have already selected an entry which means a metadata decoder has
     // finished. Verify the size is valid and if so, add to the discovered
@@ -218,17 +218,17 @@ nsICODecoder::IterateUnsizedDirEntry()
     }
 
     // Remove the entry from the unsized list either way.
     mDirEntry = nullptr;
     mUnsizedDirEntries.RemoveElementAt(0);
 
     // Our iterator is at an unknown point, so reset it to the point that we
     // saved.
-    mIterator = mLexer.Clone(*mReturnIterator, SIZE_MAX);
+    mIterator = std::move(mLexer.Clone(*mReturnIterator, SIZE_MAX));
     if (mIterator.isNothing()) {
       MOZ_ASSERT_UNREACHABLE("Cannot re-clone return iterator");
       return Transition::TerminateFailure();
     }
   }
 
   // There are no more unsized entries, so we can finally decide which entry to
   // select for decoding.
--- a/image/test/gtest/TestADAM7InterpolatingFilter.cpp
+++ b/image/test/gtest/TestADAM7InterpolatingFilter.cpp
@@ -236,18 +236,18 @@ WriteUninterpolatedPixels(SurfaceFilter*
                           uint8_t aPass,
                           const vector<BGRAColor>& aColors)
 {
   WriteState result = WriteState::NEED_MORE_DATA;
 
   for (int32_t row = 0; row < aSize.height; ++row) {
     // Compute uninterpolated pixels for this row.
     vector<BGRAColor> pixels =
-      ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
-                                       ShouldInterpolate::eNo, aColors);
+      std::move(ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
+                                            ShouldInterpolate::eNo, aColors));
 
     // Write them to the surface.
     auto pixelIterator = pixels.cbegin();
     result = aFilter->WritePixelsToRow<uint32_t>([&]{
       return AsVariant((*pixelIterator++).AsPixel());
     });
 
     if (result != WriteState::NEED_MORE_DATA) {
@@ -270,18 +270,18 @@ CheckHorizontallyInterpolatedImage(Decod
   for (int32_t row = 0; row < aSize.height; ++row) {
     if (!IsImportantRow(row, aPass)) {
       continue;  // Don't check rows which aren't important on this pass.
     }
 
     // Compute the expected pixels, *with* interpolation to match what the
     // filter should have done.
     vector<BGRAColor> expectedPixels =
-      ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
-                                       ShouldInterpolate::eYes, aColors);
+      std::move(ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
+                                            ShouldInterpolate::eYes, aColors));
 
     if (!RowHasPixels(surface, row, expectedPixels)) {
       return false;
     }
   }
 
   return true;
 }
--- a/image/test/gtest/TestAnimationFrameBuffer.cpp
+++ b/image/test/gtest/TestAnimationFrameBuffer.cpp
@@ -23,17 +23,17 @@ CreateEmptyFrame()
 }
 
 static bool
 Fill(AnimationFrameBuffer& buffer, size_t aLength)
 {
   bool keepDecoding = false;
   for (size_t i = 0; i < aLength; ++i) {
     RawAccessFrameRef frame = CreateEmptyFrame();
-    keepDecoding = buffer.Insert(frame->RawAccessRef());
+    keepDecoding = buffer.Insert(std::move(frame->RawAccessRef()));
   }
   return keepDecoding;
 }
 
 static void
 CheckFrames(const AnimationFrameBuffer& buffer, size_t aStart, size_t aEnd, bool aExpected)
 {
   for (size_t i = aStart; i < aEnd; ++i) {
@@ -128,17 +128,17 @@ TEST_F(ImageAnimationFrameBuffer, Finish
   buffer.Initialize(kThreshold, kBatch, 0);
   const auto& frames = buffer.Frames();
 
   EXPECT_EQ(kBatch * 2, buffer.PendingDecode());
 
   RawAccessFrameRef firstFrame;
   for (size_t i = 0; i < 5; ++i) {
     RawAccessFrameRef frame = CreateEmptyFrame();
-    bool keepDecoding = buffer.Insert(frame->RawAccessRef());
+    bool keepDecoding = buffer.Insert(std::move(frame->RawAccessRef()));
     EXPECT_TRUE(keepDecoding);
     EXPECT_FALSE(buffer.SizeKnown());
 
     if (i == 4) {
       EXPECT_EQ(size_t(15), buffer.PendingDecode());
       keepDecoding = buffer.MarkComplete();
       EXPECT_FALSE(keepDecoding);
       EXPECT_TRUE(buffer.SizeKnown());
--- a/image/test/gtest/TestSourceBuffer.cpp
+++ b/image/test/gtest/TestSourceBuffer.cpp
@@ -608,32 +608,30 @@ TEST_F(ImageSourceBuffer, SourceBufferIt
   auto GetIterator = [&]{
     SourceBufferIterator lambdaIterator = mSourceBuffer->Iterator();
     CheckedAdvanceIterator(lambdaIterator, chunkLength);
     return lambdaIterator;
   };
 
   // Move-construct |movedIterator| from the iterator returned from
   // GetIterator() and check that its state is as we expect.
-  SourceBufferIterator tmpIterator = GetIterator();
-  SourceBufferIterator movedIterator(std::move(tmpIterator));
+  SourceBufferIterator movedIterator = std::move(GetIterator());
   EXPECT_TRUE(movedIterator.Data());
   EXPECT_EQ(chunkLength, movedIterator.Length());
   ExpectChunkAndByteCount(movedIterator, 1, chunkLength);
 
   // Make sure that we can advance the iterator.
   CheckedAdvanceIterator(movedIterator, chunkLength, 2, totalLength);
 
   // Make sure that the iterator handles completion properly.
   CheckIteratorIsComplete(movedIterator, 2, totalLength);
 
   // Move-assign |movedIterator| from the iterator returned from
   // GetIterator() and check that its state is as we expect.
-  tmpIterator = GetIterator();
-  movedIterator = std::move(tmpIterator);
+  movedIterator = std::move(GetIterator());
   EXPECT_TRUE(movedIterator.Data());
   EXPECT_EQ(chunkLength, movedIterator.Length());
   ExpectChunkAndByteCount(movedIterator, 1, chunkLength);
 
   // Make sure that we can advance the iterator.
   CheckedAdvanceIterator(movedIterator, chunkLength, 2, totalLength);
 
   // Make sure that the iterator handles completion properly.
--- a/image/test/gtest/TestSurfacePipeIntegration.cpp
+++ b/image/test/gtest/TestSurfacePipeIntegration.cpp
@@ -21,17 +21,17 @@ namespace mozilla {
 namespace image {
 
 class TestSurfacePipeFactory
 {
 public:
   static SurfacePipe SimpleSurfacePipe()
   {
     SurfacePipe pipe;
-    return pipe;
+    return std::move(pipe);
   }
 
   template <typename T>
   static SurfacePipe SurfacePipeFromPipeline(T&& aPipeline)
   {
     return SurfacePipe { std::move(aPipeline) };
   }
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -3522,17 +3522,17 @@ struct FindPathHandler {
         if (!first)
             return true;
 
         // Record how we reached this node. This is the last edge on a
         // shortest path to this node.
         EdgeName edgeName = DuplicateString(cx, edge.name.get());
         if (!edgeName)
             return false;
-        *backEdge = BackEdge(origin, std::move(edgeName));
+        *backEdge = std::move(BackEdge(origin, std::move(edgeName)));
 
         // Have we reached our final target node?
         if (edge.referent == target) {
             // Record the path that got us here, which must be a shortest path.
             if (!recordPath(traversal))
                 return false;
             foundPath = true;
             traversal.stop();
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -5753,17 +5753,17 @@ ArrayType::BuildFFIType(JSContext* cx, J
     JS_ReportAllocationOverflow(cx);
     return nullptr;
   }
 
   for (size_t i = 0; i < length; ++i)
     ffiType->elements[i] = ffiBaseType;
   ffiType->elements[length] = nullptr;
 
-  return ffiType;
+  return std::move(ffiType);
 }
 
 bool
 ArrayType::IsArrayType(HandleValue v)
 {
   if (!v.isObject())
     return false;
   JSObject* obj = &v.toObject();
@@ -6301,17 +6301,17 @@ StructType::BuildFFIType(JSContext* cx, 
   // Fill in the ffi_type's size and align fields. This makes libffi treat the
   // type as initialized; it will not recompute the values. (We assume
   // everything agrees; if it doesn't, we really want to know about it, which
   // is the purpose of the above debug-only check.)
   ffiType->size = structSize;
   ffiType->alignment = structAlign;
 #endif
 
-  return ffiType;
+  return std::move(ffiType);
 }
 
 bool
 StructType::Define(JSContext* cx, unsigned argc, Value* vp)
 {
   CallArgs args = CallArgsFromVp(argc, vp);
   RootedObject obj(cx, GetThisObject(cx, args, "StructType.prototype.define"));
   if (!obj)
--- a/js/src/ds/LifoAlloc.cpp
+++ b/js/src/ds/LifoAlloc.cpp
@@ -46,21 +46,21 @@ BumpChunk::canAlloc(size_t n)
 
 } // namespace detail
 } // namespace js
 
 void
 LifoAlloc::freeAll()
 {
     while (!chunks_.empty()) {
-        BumpChunk bc = chunks_.popFirst();
+        BumpChunk bc = std::move(chunks_.popFirst());
         decrementCurSize(bc->computedSizeOfIncludingThis());
     }
     while (!unused_.empty()) {
-        BumpChunk bc = unused_.popFirst();
+        BumpChunk bc = std::move(unused_.popFirst());
         decrementCurSize(bc->computedSizeOfIncludingThis());
     }
 
     // Nb: maintaining curSize_ correctly isn't easy.  Fortunately, this is an
     // excellent sanity check.
     MOZ_ASSERT(curSize_ == 0);
 }
 
@@ -100,27 +100,27 @@ LifoAlloc::newChunkWithCapacity(size_t n
 bool
 LifoAlloc::getOrCreateChunk(size_t n)
 {
     // Look for existing unused BumpChunks to satisfy the request, and pick the
     // first one which is large enough, and move it into the list of used
     // chunks.
     if (!unused_.empty()) {
         if (unused_.begin()->canAlloc(n)) {
-            chunks_.append(unused_.popFirst());
+            chunks_.append(std::move(unused_.popFirst()));
             return true;
         }
 
         BumpChunkList::Iterator e(unused_.end());
         for (BumpChunkList::Iterator i(unused_.begin()); i->next() != e.get(); ++i) {
             detail::BumpChunk* elem = i->next();
             MOZ_ASSERT(elem->empty());
             if (elem->canAlloc(n)) {
-                BumpChunkList temp = unused_.splitAfter(i.get());
-                chunks_.append(temp.popFirst());
+                BumpChunkList temp = std::move(unused_.splitAfter(i.get()));
+                chunks_.append(std::move(temp.popFirst()));
                 unused_.appendAll(std::move(temp));
                 return true;
             }
         }
     }
 
     // Allocate a new BumpChunk with enough space for the next allocation.
     BumpChunk newChunk = newChunkWithCapacity(n);
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -706,17 +706,17 @@ class LifoAlloc
     void release(Mark mark) {
         markCount--;
 
         // Move the blocks which are after the mark to the set of unused chunks.
         BumpChunkList released;
         if (!mark.markedChunk())
             released = std::move(chunks_);
         else
-            released = chunks_.splitAfter(mark.markedChunk());
+            released = std::move(chunks_.splitAfter(mark.markedChunk()));
 
         // Release the content of all the blocks which are after the marks.
         for (detail::BumpChunk& bc : released)
             bc.release();
         unused_.appendAll(std::move(released));
 
         // Release everything which follows the mark in the last chunk.
         if (!chunks_.empty())
--- a/js/src/vm/CodeCoverage.cpp
+++ b/js/src/vm/CodeCoverage.cpp
@@ -511,17 +511,17 @@ LCovRealm::lookupOrAdd(JS::Realm* realm,
 
     char* source_name = js_strdup(name);
     if (!source_name) {
         outTN_.reportOutOfMemory();
         return nullptr;
     }
 
     // Allocate a new LCovSource for the current top-level.
-    if (!sources_->append(LCovSource(&alloc_, source_name))) {
+    if (!sources_->append(std::move(LCovSource(&alloc_, source_name)))) {
         outTN_.reportOutOfMemory();
         return nullptr;
     }
 
     return &sources_->back();
 }
 
 void
--- a/js/src/vm/UbiNode.cpp
+++ b/js/src/vm/UbiNode.cpp
@@ -262,17 +262,17 @@ class EdgeVectorTracer : public JS::Call
                 name16[i] = name[i];
             name16[i] = '\0';
         }
 
         // The simplest code is correct! The temporary Edge takes
         // ownership of name; if the append succeeds, the vector element
         // then takes ownership; if the append fails, then the temporary
         // retains it, and its destructor will free it.
-        if (!vec->append(Edge(name16, Node(thing)))) {
+        if (!vec->append(std::move(Edge(name16, Node(thing))))) {
             okay = false;
             return;
         }
     }
 
   public:
     // True if no errors (OOM, say) have yet occurred.
     bool okay;
@@ -543,17 +543,17 @@ RootList::addRoot(Node node, const char1
 
     UniqueTwoByteChars name;
     if (edgeName) {
         name = js::DuplicateString(edgeName);
         if (!name)
             return false;
     }
 
-    return edges.append(Edge(name.release(), node));
+    return edges.append(std::move(Edge(name.release(), node)));
 }
 
 const char16_t Concrete<RootList>::concreteTypeName[] = u"JS::ubi::RootList";
 
 UniquePtr<EdgeRange>
 Concrete<RootList>::edges(JSContext* cx, bool wantNames) const {
     MOZ_ASSERT_IF(wantNames, get().wantNames);
     return UniquePtr<EdgeRange>(js_new<PreComputedEdgeRange>(get().edges));
--- a/js/src/vm/UbiNodeShortestPaths.cpp
+++ b/js/src/vm/UbiNodeShortestPaths.cpp
@@ -23,17 +23,17 @@ BackEdge::clone() const
         return nullptr;
 
     clone->predecessor_ = predecessor();
     if (name()) {
         clone->name_ = js::DuplicateString(name().get());
         if (!clone->name_)
             return nullptr;
     }
-    return clone;
+    return std::move(clone);
 }
 
 #ifdef DEBUG
 
 static void
 dumpNode(const JS::ubi::Node& node)
 {
     fprintf(stderr, "    %p ", (void*) node.identifier());
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -1596,17 +1596,17 @@ DecodeExportName(Decoder& d, CStringSet*
     if (p) {
         d.fail("duplicate export");
         return nullptr;
     }
 
     if (!dupSet->add(p, exportName.get()))
         return nullptr;
 
-    return exportName;
+    return std::move(exportName);
 }
 
 static bool
 DecodeExport(Decoder& d, ModuleEnvironment* env, CStringSet* dupSet)
 {
     UniqueChars fieldName = DecodeExportName(d, dupSet);
     if (!fieldName)
         return false;
--- a/js/xpconnect/loader/URLPreloader.cpp
+++ b/js/xpconnect/loader/URLPreloader.cpp
@@ -619,21 +619,21 @@ URLPreloader::ShallowSizeOfIncludingThis
 
 Result<FileLocation, nsresult>
 URLPreloader::CacheKey::ToFileLocation()
 {
     if (mType == TypeFile) {
         nsCOMPtr<nsIFile> file;
         MOZ_TRY(NS_NewLocalFile(NS_ConvertUTF8toUTF16(mPath), false,
                                 getter_AddRefs(file)));
-        return FileLocation(file);
+        return std::move(FileLocation(file));
     }
 
     RefPtr<nsZipArchive> zip = Archive();
-    return FileLocation(zip, mPath.get());
+    return std::move(FileLocation(zip, mPath.get()));
 }
 
 Result<const nsCString, nsresult>
 URLPreloader::URLEntry::Read()
 {
     FileLocation location;
     MOZ_TRY_VAR(location, ToFileLocation());
 
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6248,17 +6248,17 @@ PresShell::Paint(nsView*         aViewTo
       bool computeInvalidRect = computeInvalidFunc ||
                                 (layerManager->GetBackendType() == LayersBackend::LAYERS_BASIC);
 
       UniquePtr<LayerProperties> props;
       // For WR, the layermanager has no root layer. We want to avoid
       // calling ComputeDifferences in that case because it assumes non-null
       // and crashes.
       if (computeInvalidRect && layerManager->GetRoot()) {
-        props = LayerProperties::CloneFrom(layerManager->GetRoot());
+        props = std::move(LayerProperties::CloneFrom(layerManager->GetRoot()));
       }
 
       MaybeSetupTransactionIdAllocator(layerManager, presContext);
 
       if (layerManager->EndEmptyTransaction((aFlags & PAINT_COMPOSITE) ?
             LayerManager::END_DEFAULT : LayerManager::END_NO_COMPOSITE)) {
         nsIntRegion invalid;
         bool areaOverflowed = false;
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -6613,18 +6613,18 @@ FrameLayerBuilder::DrawPaintedLayer(Pain
     FlashPaint(aContext);
   }
 
   if (presContext->GetDocShell() && isActiveLayerManager) {
     nsDocShell* docShell = static_cast<nsDocShell*>(presContext->GetDocShell());
     RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
 
     if (timelines && timelines->HasConsumer(docShell)) {
-      timelines->AddMarkerForDocShell(docShell,
-        MakeUnique<LayerTimelineMarker>(aRegionToDraw));
+      timelines->AddMarkerForDocShell(docShell, std::move(
+        MakeUnique<LayerTimelineMarker>(aRegionToDraw)));
     }
   }
 
   if (!aRegionToInvalidate.IsEmpty()) {
     aLayer->AddInvalidRect(aRegionToInvalidate.GetBounds());
   }
 }
 
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -509,17 +509,17 @@ RetainedDisplayListBuilder::MergeDisplay
 {
   MergeState merge(this, *aOldList, aOuterKey);
 
   Maybe<MergedListIndex> previousItemIndex;
   while (nsDisplayItem* item = aNewList->RemoveBottom()) {
     previousItemIndex = Some(merge.ProcessItemFromNewList(item, previousItemIndex));
   }
 
-  *aOutList = merge.Finalize();
+  *aOutList = std::move(merge.Finalize());
   aOutContainerASR = merge.mContainerASR;
   return merge.mResultIsModified;
 }
 
 static void
 TakeAndAddModifiedAndFramesWithPropsFromRootFrame(
   nsTArray<nsIFrame*>* aModifiedFrames,
   nsTArray<nsIFrame*>* aFramesWithProps,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2728,17 +2728,17 @@ already_AddRefed<LayerManager> nsDisplay
 
   UniquePtr<LayerProperties> props;
 
   bool computeInvalidRect = (computeInvalidFunc ||
                              (!layerManager->IsCompositingCheap() && layerManager->NeedsWidgetInvalidation())) &&
                             widgetTransaction;
 
   if (computeInvalidRect) {
-    props = LayerProperties::CloneFrom(layerManager->GetRoot());
+    props = std::move(LayerProperties::CloneFrom(layerManager->GetRoot()));
   }
 
   if (doBeginTransaction) {
     if (aCtx) {
       if (!layerManager->BeginTransactionWithTarget(aCtx)) {
         return nullptr;
       }
     } else {
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -1041,17 +1041,17 @@ StyleSheet::ParseSheet(css::Loader* aLoa
     Servo_StyleSheet_FromUTF8BytesAsync(loadDataHolder,
                                         Inner().mURLData,
                                         &aBytes,
                                         mParsingMode,
                                         aLoadData->mLineNumber,
                                         aLoader->GetCompatibilityMode());
   }
 
-  return p;
+  return std::move(p);
 }
 
 void
 StyleSheet::FinishAsyncParse(already_AddRefed<RawServoStyleSheetContents> aSheetContents)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mParsePromise.IsEmpty());
   Inner().mContents = aSheetContents;
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -601,17 +601,17 @@ AppendKeyframe(double aOffset,
 {
   Keyframe& frame = *aKeyframes.AppendElement();
   frame.mOffset.emplace(aOffset);
 
   if (aValue.mServo) {
     RefPtr<RawServoDeclarationBlock> decl =
       Servo_AnimationValue_Uncompute(aValue.mServo).Consume();
     frame.mPropertyValues.AppendElement(
-      PropertyValuePair(aProperty, std::move(decl)));
+      std::move(PropertyValuePair(aProperty, std::move(decl))));
   } else {
     MOZ_CRASH("old style system disabled");
   }
   return frame;
 }
 
 static nsTArray<Keyframe>
 GetTransitionKeyframes(nsCSSPropertyID aProperty,
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -1506,39 +1506,39 @@ class NewSdpTest : public ::testing::Tes
                    public ::testing::WithParamInterface<
                      ::testing::tuple<bool, bool> > {
   public:
     NewSdpTest() {}
 
     void ParseSdp(const std::string &sdp, bool expectSuccess = true) {
       if (::testing::get<1>(GetParam())) {
         mSdpErrorHolder = &mSipccParser;
-        mSdp = mSipccParser.Parse(sdp);
+        mSdp = std::move(mSipccParser.Parse(sdp));
       } else {
         mSdpErrorHolder = &mRustParser;
-        mSdp = mRustParser.Parse(sdp);
+        mSdp = std::move(mRustParser.Parse(sdp));
       }
 
       // Are we configured to do a parse and serialize before actually
       // running the test?
       if (::testing::get<0>(GetParam())) {
         std::stringstream os;
 
         if (expectSuccess) {
           ASSERT_TRUE(!!mSdp) << "Parse failed on first pass: "
                               << GetParseErrors();
         }
 
         if (mSdp) {
           // Serialize and re-parse
           mSdp->Serialize(os);
           if (::testing::get<1>(GetParam())) {
-            mSdp = mSipccParser.Parse(os.str());
+            mSdp = std::move(mSipccParser.Parse(os.str()));
           } else {
-            mSdp = mRustParser.Parse(os.str());
+            mSdp = std::move(mRustParser.Parse(os.str()));
           }
 
           // Whether we expected the parse to work or not, it should
           // succeed the second time if it succeeded the first.
           ASSERT_TRUE(!!mSdp) << "Parse failed on second pass, SDP was: "
             << std::endl << os.str() <<  std::endl
             << "Errors were: " << GetParseErrors();
 
--- a/mfbt/tests/TestUniquePtr.cpp
+++ b/mfbt/tests/TestUniquePtr.cpp
@@ -70,17 +70,17 @@ ReturnUniqueA()
 {
   return UniqueA(new B);
 }
 
 static UniqueA
 ReturnLocalA()
 {
   UniqueA a(new A);
-  return a;
+  return std::move(a);
 }
 
 static void
 TestDeleterType()
 {
   // Make sure UniquePtr will use its deleter's pointer type if it defines one.
   typedef int* Ptr;
   struct Deleter {
@@ -363,17 +363,17 @@ SetMallocedInt(UniquePtr<int, FreeSignat
 }
 
 static UniquePtr<int, FreeSignature>
 MallocedInt(int aI)
 {
   UniquePtr<int, FreeSignature>
     ptr(static_cast<int*>(malloc(sizeof(int))), free);
   *ptr = aI;
-  return ptr;
+  return std::move(ptr);
 }
 static bool
 TestFunctionReferenceDeleter()
 {
   // Look for allocator mismatches and leaks to verify these bits
   UniquePtr<int, FreeSignature> i1(MallocedInt(17));
   CHECK(*i1 == 17);
 
--- a/security/certverifier/tests/gtest/CTSerializationTest.cpp
+++ b/security/certverifier/tests/gtest/CTSerializationTest.cpp
@@ -178,18 +178,18 @@ TEST_F(CTSerializationTest, FailsDecodin
 }
 
 TEST_F(CTSerializationTest, EncodesSCTList)
 {
   const uint8_t SCT_1[] = { 0x61, 0x62, 0x63 };
   const uint8_t SCT_2[] = { 0x64, 0x65, 0x66 };
 
   Vector<Input> list;
-  ASSERT_TRUE(list.append(Input(SCT_1)));
-  ASSERT_TRUE(list.append(Input(SCT_2)));
+  ASSERT_TRUE(list.append(std::move(Input(SCT_1))));
+  ASSERT_TRUE(list.append(std::move(Input(SCT_2))));
 
   Buffer encodedList;
   ASSERT_EQ(Success, EncodeSCTList(list, encodedList));
 
   Reader listReader;
   ASSERT_EQ(Success, DecodeSCTList(InputForBuffer(encodedList), listReader));
 
   Input decoded1;
--- a/security/manager/ssl/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/nsPKCS12Blob.cpp
@@ -297,17 +297,17 @@ nsPKCS12Blob::newPKCS12FilePassword(uint
   bool pressedOK = false;
   rv = certDialogs->SetPKCS12FilePassword(mUIContext, password, &pressedOK);
   if (NS_FAILED(rv)) {
     return rv;
   }
   if (!pressedOK) {
     return NS_OK;
   }
-  passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
+  passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
   return NS_OK;
 }
 
 // Launch a dialog requesting the user for the password to a PKCS#12 file.
 // Handle user canceled by returning null password (caller must catch).
 nsresult
 nsPKCS12Blob::getPKCS12FilePassword(uint32_t& passwordBufferLength,
                                     UniquePtr<uint8_t[]>& passwordBuffer)
@@ -323,17 +323,17 @@ nsPKCS12Blob::getPKCS12FilePassword(uint
   bool pressedOK = false;
   rv = certDialogs->GetPKCS12FilePassword(mUIContext, password, &pressedOK);
   if (NS_FAILED(rv)) {
     return rv;
   }
   if (!pressedOK) {
     return NS_OK;
   }
-  passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
+  passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
   return NS_OK;
 }
 
 // Given a decoder, read bytes from file and input them to the decoder.
 nsresult
 nsPKCS12Blob::inputToDecoder(UniqueSEC_PKCS12DecoderContext& dcx, nsIFile* file,
                              PRErrorCode& nssError)
 {
--- a/toolkit/components/extensions/webrequest/WebRequestService.cpp
+++ b/toolkit/components/extensions/webrequest/WebRequestService.cpp
@@ -42,17 +42,17 @@ UniquePtr<WebRequestChannelEntry>
 WebRequestService::RegisterChannel(ChannelWrapper* aChannel)
 {
   UniquePtr<ChannelEntry> entry(new ChannelEntry(aChannel));
 
   auto key = mChannelEntries.LookupForAdd(entry->mChannelId);
   MOZ_DIAGNOSTIC_ASSERT(!key);
   key.OrInsert([&entry]() { return entry.get(); });
 
-  return entry;
+  return std::move(entry);
 
 }
 
 already_AddRefed<nsITraceableChannel>
 WebRequestService::GetTraceableChannel(uint64_t aChannelId,
                                        nsAtom* aAddonId,
                                        nsIContentParent* aContentParent)
 {
--- a/toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
+++ b/toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
@@ -17,17 +17,17 @@ GetClassifier()
 {
   nsCOMPtr<nsIFile> file;
   NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
 
   UniquePtr<Classifier> classifier = MakeUnique<Classifier>();
   nsresult rv = classifier->Open(*file);
   EXPECT_TRUE(rv == NS_OK);
 
-  return classifier;
+  return std::move(classifier);
 }
 
 static nsresult
 SetupLookupCacheV4(Classifier* classifier,
                    const _PrefixArray& aPrefixArray,
                    const nsACString& aTable)
 {
   LookupCacheV4* lookupCache =
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1787,17 +1787,17 @@ CollectJavaThreadProfileData()
       if (!frameName) {
         break;
       }
       buffer->CollectCodeLocation("", frameName->ToCString().get(), -1,
                                   Nothing());
     }
     sampleId++;
   }
-  return buffer;
+  return std::move(buffer);
 }
 #endif
 
 static void
 locked_profiler_stream_json_for_this_process(PSLockRef aLock,
                                              SpliceableJSONWriter& aWriter,
                                              double aSinceTime,
                                              bool aIsShuttingDown)
--- a/widget/android/nsAppShell.h
+++ b/widget/android/nsAppShell.h
@@ -239,28 +239,28 @@ protected:
                 nsAppShell::RecordLatencies();
 #endif
                 lock.Wait();
             }
 
             // Ownership of event object transfers to the return value.
             mozilla::UniquePtr<Event> event(mQueue.popFirst());
             if (!event || !event->mPostTime) {
-                return event;
+                return std::move(event);
             }
 
 #ifdef EARLY_BETA_OR_EARLIER
             const size_t latencyType = (event->ActivityType() ==
                     Event::Type::kUIActivity) ? LATENCY_UI : LATENCY_OTHER;
             const uint64_t latency = Event::GetTime() - event->mPostTime;
 
             sLatencyCount[latencyType]++;
             sLatencyTime[latencyType] += latency;
 #endif
-            return event;
+            return std::move(event);
         }
 
     } mEventQueue;
 
     mozilla::CondVar mSyncRunFinished;
     bool mSyncRunQuit;
 
     bool mAllowCoalescingTouches;
--- a/xpcom/tests/gtest/TestPLDHash.cpp
+++ b/xpcom/tests/gtest/TestPLDHash.cpp
@@ -192,24 +192,17 @@ static const PLDHashTableOps trivialOps 
 
 TEST(PLDHashTableTest, MoveSemantics)
 {
   PLDHashTable t1(&trivialOps, sizeof(PLDHashEntryStub));
   t1.Add((const void*)88);
   PLDHashTable t2(&trivialOps, sizeof(PLDHashEntryStub));
   t2.Add((const void*)99);
 
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wself-move"
-#endif
   t1 = std::move(t1);   // self-move
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
 
   t1 = std::move(t2);   // empty overwritten with empty
 
   PLDHashTable t3(&trivialOps, sizeof(PLDHashEntryStub));
   PLDHashTable t4(&trivialOps, sizeof(PLDHashEntryStub));
   t3.Add((const void*)88);
 
   t3 = std::move(t4);   // non-empty overwritten with empty
--- a/xpcom/tests/gtest/TestTArray.cpp
+++ b/xpcom/tests/gtest/TestTArray.cpp
@@ -133,26 +133,18 @@ TEST(TArray, Assign)
 
 TEST(TArray, AssignmentOperatorSelfAssignment)
 {
   nsTArray<int> array;
   array = DummyArray();
 
   array = *&array;
   ASSERT_EQ(DummyArray(), array);
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wself-move"
-#endif
-  array = std::move(array); // self-move
+  array = std::move(array);
   ASSERT_EQ(DummyArray(), array);
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
 }
 
 TEST(TArray, CopyOverlappingForwards)
 {
   const size_t rangeLength = 8;
   const size_t initialLength = 2 * rangeLength;
   uint32_t destructionCounters[initialLength];
   nsTArray<Movable> array;