Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 27 Apr 2016 14:16:50 +1000
changeset 334374 3d67e45f994a3ae1ae43479c32c2ed63bbf1a7c8
parent 334373 4fe5cc4663a37c77239fd9f3344d4816fa7c9ce6
child 334375 be44859293d451146751dcc723dd01a9b67a1ef4
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1267550
milestone49.0a1
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
Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj. It's an annotation that is used a lot, and should be used even more, so a shorter name is better. MozReview-Commit-ID: 1VS4Dney4WX
accessible/ipc/DocAccessibleParent.h
dom/base/FragmentOrElement.h
dom/base/nsContentUtils.h
dom/base/nsGenericDOMDataNode.h
dom/base/nsHTMLContentSerializer.h
dom/base/nsIContent.h
dom/base/nsScriptLoader.h
dom/base/nsTextFragment.h
dom/base/nsXHTMLContentSerializer.h
dom/base/nsXMLContentSerializer.h
dom/bindings/MozMap.h
dom/bindings/ToJSValue.h
dom/html/nsTextEditorState.h
dom/ipc/nsIContentParent.h
dom/media/webaudio/AlignedTArray.h
gfx/2d/BaseRect.h
gfx/src/nsPoint.h
gfx/src/nsRect.h
gfx/src/nsRegion.h
gfx/src/nsSize.h
intl/uconv/nsIUnicodeDecoder.h
intl/uconv/nsIUnicodeEncoder.h
intl/uconv/nsReplacementToUnicode.h
intl/uconv/nsUTF8ToUnicode.h
intl/uconv/nsUnicodeToUTF8.h
intl/uconv/ucvlatin/nsUTF16ToUnicode.h
intl/uconv/ucvlatin/nsUnicodeToUTF16.h
intl/uconv/ucvtw/nsUnicodeToBIG5.h
ipc/chromium/src/base/pickle.h
ipc/ipdl/ipdl/cxx/cgen.py
js/public/HashTable.h
js/public/Utility.h
js/src/asmjs/AsmJS.cpp
js/src/asmjs/WasmBinary.h
js/src/asmjs/WasmBinaryIterator.h
js/src/asmjs/WasmModule.h
js/src/ds/OrderedHashTable.h
js/src/frontend/FullParseHandler.h
js/src/frontend/SyntaxParseHandler.h
js/src/gc/Zone.h
js/src/irregexp/RegExpEngine.h
js/src/jit/BaselineCacheIR.cpp
js/src/jit/ExecutableAllocator.h
js/src/jit/FixedList.h
js/src/jit/MIR.h
js/src/jit/MIRGraph.h
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jit/shared/CodeGenerator-shared.h
js/src/jit/x64/BaseAssembler-x64.h
js/src/jit/x86-shared/BaseAssembler-x86-shared.h
js/src/jit/x86-shared/CodeGenerator-x86-shared.h
js/src/jscntxt.h
js/src/jscompartment.h
js/src/jsfriendapi.h
js/src/jsobjinlines.h
js/src/jsopcode.cpp
js/src/jsstr.cpp
js/src/vm/ArrayBufferObject.h
js/src/vm/StringBuffer.h
layout/svg/AutoReferenceLimiter.h
memory/mozalloc/mozalloc.h
mfbt/AlreadyAddRefed.h
mfbt/Assertions.h
mfbt/Attributes.h
mfbt/Endian.h
mfbt/FloatingPoint.h
mfbt/HashFunctions.h
mfbt/SegmentedVector.h
mfbt/ThreadLocal.h
mfbt/UniquePtr.h
mfbt/Vector.h
mfbt/tests/TestSegmentedVector.cpp
netwerk/base/nsNetUtil.h
netwerk/base/nsNetUtilInlines.h
netwerk/cache2/CacheFileChunk.cpp
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/CookieServiceParent.h
netwerk/ipc/NeckoParent.h
netwerk/sctp/datachannel/DataChannel.h
security/manager/ssl/nsNSSComponent.h
security/sandbox/linux/Sandbox.cpp
toolkit/components/url-classifier/HashStore.h
toolkit/identity/IdentityCryptoService.cpp
xpcom/ds/Tokenizer.h
xpcom/glue/nsBaseHashtable.h
xpcom/glue/nsDeque.h
xpcom/glue/nsRefPtrHashtable.h
xpcom/glue/nsTArray.h
xpcom/glue/nsTHashtable.h
xpcom/string/nsReadableUtils.h
xpcom/string/nsTString.h
xpcom/string/nsTSubstring.h
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -161,17 +161,17 @@ private:
     enum { ALLOW_MEMMOVE = true };
 
     ProxyAccessible* mProxy;
   };
 
   uint32_t AddSubtree(ProxyAccessible* aParent,
                       const nsTArray<AccessibleData>& aNewTree, uint32_t aIdx,
                       uint32_t aIdxInParent);
-  MOZ_WARN_UNUSED_RESULT bool CheckDocTree() const;
+  MOZ_MUST_USE bool CheckDocTree() const;
   xpcAccessibleGeneric* GetXPCAccessible(ProxyAccessible* aProxy);
 
   nsTArray<DocAccessibleParent*> mChildDocs;
   DocAccessibleParent* mParentDoc;
 
   /*
    * Conceptually this is a map from IDs to proxies, but we store the ID in the
    * proxy object so we can't use a real map.
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -137,17 +137,17 @@ public:
   {
     return SetText(aStr.BeginReading(), aStr.Length(), aNotify);
   }
   virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) override;
   virtual bool TextIsOnlyWhitespace() override;
   virtual bool HasTextForTranslation() override;
   virtual void AppendTextTo(nsAString& aResult) override;
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendTextTo(nsAString& aResult, const mozilla::fallible_t&) override;
   virtual nsIContent *GetBindingParent() const override;
   virtual nsXBLBinding *GetXBLBinding() const override;
   virtual void SetXBLBinding(nsXBLBinding* aBinding,
                              nsBindingManager* aOldBindingManager = nullptr) override;
   virtual ShadowRoot *GetShadowRoot() const override;
   virtual ShadowRoot *GetContainingShadow() const override;
   virtual nsTArray<nsIContent*> &DestInsertionPoints() override;
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -1387,17 +1387,17 @@ public:
    * @see nsLayoutUtils::GetFrameTextContent
    *
    * @param aNode Node to get textual contents of.
    * @param aDeep If true child elements of aNode are recursivly descended
    *              into to find text children.
    * @param aResult the result. Out param.
    * @return false on out of memory errors, true otherwise.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static bool GetNodeTextContent(nsINode* aNode, bool aDeep,
                                  nsAString& aResult, const mozilla::fallible_t&);
 
   static void GetNodeTextContent(nsINode* aNode, bool aDeep,
                                  nsAString& aResult);
 
   /**
    * Same as GetNodeTextContents but appends the result rather than sets it.
@@ -1760,34 +1760,34 @@ public:
 
   /**
    * The method checks whether the caller can access native anonymous content.
    * If there is no JS in the stack or privileged JS is running, this
    * method returns true, otherwise false.
    */
   static bool CanAccessNativeAnon();
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static nsresult WrapNative(JSContext *cx, nsISupports *native,
                              const nsIID* aIID, JS::MutableHandle<JS::Value> vp,
                              bool aAllowWrapping = true)
   {
     return WrapNative(cx, native, nullptr, aIID, vp, aAllowWrapping);
   }
 
   // Same as the WrapNative above, but use this one if aIID is nsISupports' IID.
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static nsresult WrapNative(JSContext *cx, nsISupports *native,
                              JS::MutableHandle<JS::Value> vp,
                              bool aAllowWrapping = true)
   {
     return WrapNative(cx, native, nullptr, nullptr, vp, aAllowWrapping);
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static nsresult WrapNative(JSContext *cx, nsISupports *native,
                              nsWrapperCache *cache,
                              JS::MutableHandle<JS::Value> vp,
                              bool aAllowWrapping = true)
   {
     return WrapNative(cx, native, cache, nullptr, vp, aAllowWrapping);
   }
 
@@ -1810,17 +1810,17 @@ public:
    */
   static void RemoveNewlines(nsString &aString);
 
   /**
    * Convert Windows and Mac platform linebreaks to \n.
    * @param aString the string to convert the newlines inside [in/out]
    */
   static void PlatformToDOMLineBreaks(nsString &aString);
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static bool PlatformToDOMLineBreaks(nsString &aString,
                                       const mozilla::fallible_t&);
 
   /**
    * Populates aResultString with the contents of the string-buffer aBuf, up
    * to aBuf's null-terminator.  aBuf must not be null. Ownership of the string
    * is not transferred.
    */
--- a/dom/base/nsGenericDOMDataNode.h
+++ b/dom/base/nsGenericDOMDataNode.h
@@ -133,17 +133,17 @@ public:
   {
     return SetText(aStr.BeginReading(), aStr.Length(), aNotify);
   }
   virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) override;
   virtual bool TextIsOnlyWhitespace() override;
   virtual bool HasTextForTranslation() override;
   virtual void AppendTextTo(nsAString& aResult) override;
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendTextTo(nsAString& aResult,
                             const mozilla::fallible_t&) override;
   virtual void SaveSubtreeState() override;
 
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const override;
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const override;
 #endif
--- a/dom/base/nsHTMLContentSerializer.h
+++ b/dom/base/nsHTMLContentSerializer.h
@@ -32,26 +32,26 @@ class nsHTMLContentSerializer final : pu
 
   NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
                               nsAString& aStr) override;
 
   NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
                                  nsAString& aStr) override;
  protected:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool SerializeHTMLAttributes(nsIContent* aContent,
                                        nsIContent *aOriginalElement,
                                        nsAString& aTagPrefix,
                                        const nsAString& aTagNamespaceURI,
                                        nsIAtom* aTagName,
                                        int32_t aNamespace,
                                        nsAString& aStr);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendAndTranslateEntities(const nsAString& aStr,
                                           nsAString& aOutputStr) override;
 
 };
 
 nsresult
 NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer);
 
--- a/dom/base/nsIContent.h
+++ b/dom/base/nsIContent.h
@@ -541,17 +541,17 @@ public:
    * NOTE: This asserts and returns for elements
    */
   virtual void AppendTextTo(nsAString& aResult) = 0;
 
   /**
    * Append the text content to aResult.
    * NOTE: This asserts and returns for elements
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendTextTo(nsAString& aResult, const mozilla::fallible_t&) = 0;
 
   /**
    * Check if this content is focusable and in the current tab order.
    * Note: most callers should use nsIFrame::IsFocusable() instead as it 
    *       checks visibility and other layout factors as well.
    * Tabbable is indicated by a nonnegative tabindex & is a subset of focusable.
    * For example, only the selected radio button in a group is in the 
--- a/dom/base/nsScriptLoader.h
+++ b/dom/base/nsScriptLoader.h
@@ -174,24 +174,24 @@ public:
 
   void AppendElement(nsScriptLoadRequest* aElem)
   {
     MOZ_ASSERT(!aElem->isInList());
     NS_ADDREF(aElem);
     insertBack(aElem);
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   already_AddRefed<nsScriptLoadRequest> Steal(nsScriptLoadRequest* aElem)
   {
     aElem->removeFrom(*this);
     return dont_AddRef(aElem);
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   already_AddRefed<nsScriptLoadRequest> StealFirst()
   {
     MOZ_ASSERT(!isEmpty());
     return Steal(getFirst());
   }
 };
 
 //////////////////////////////////////////////////////////////
--- a/dom/base/nsTextFragment.h
+++ b/dom/base/nsTextFragment.h
@@ -130,17 +130,17 @@ public:
       aString.AllocFailed(aString.Length() + GetLength());
     }
   }
 
   /**
    * Append the contents of this string fragment to aString
    * @return false if an out of memory condition is detected, true otherwise
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendTo(nsAString& aString,
                 const mozilla::fallible_t& aFallible) const {
     if (mState.mIs2b) {
       bool ok = aString.Append(m2b, mState.mLength, aFallible);
       if (!ok) {
         return false;
       }
 
@@ -164,17 +164,17 @@ public:
 
   /**
    * Append a substring of the contents of this string fragment to aString.
    * @param aString the string in which to append
    * @param aOffset where to start the substring in this text fragment
    * @param aLength the length of the substring
    * @return false if an out of memory condition is detected, true otherwise
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendTo(nsAString& aString, int32_t aOffset, int32_t aLength,
                 const mozilla::fallible_t& aFallible) const
   {
     if (mState.mIs2b) {
       bool ok = aString.Append(m2b + aOffset, aLength, aFallible);
       if (!ok) {
         return false;
       }
--- a/dom/base/nsXHTMLContentSerializer.h
+++ b/dom/base/nsXHTMLContentSerializer.h
@@ -42,17 +42,17 @@ class nsXHTMLContentSerializer : public 
  protected:
 
 
   virtual bool CheckElementStart(nsIContent * aContent,
                           bool & aForceFormat,
                           nsAString& aStr,
                           nsresult& aResult) override;
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AfterElementStart(nsIContent* aContent,
                                  nsIContent* aOriginalElement,
                                  nsAString& aStr) override;
 
   virtual bool CheckElementEnd(mozilla::dom::Element* aContent,
                                bool& aForceFormat,
                                nsAString& aStr) override;
 
@@ -65,35 +65,35 @@ class nsXHTMLContentSerializer : public 
   virtual bool LineBreakAfterClose(int32_t aNamespaceID, nsIAtom* aName) override;
 
   bool HasLongLines(const nsString& text, int32_t& aLastNewlineOffset);
 
   // functions to check if we enter in or leave from a preformated content
   virtual void MaybeEnterInPreContent(nsIContent* aNode) override;
   virtual void MaybeLeaveFromPreContent(nsIContent* aNode) override;
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool SerializeAttributes(nsIContent* aContent,
                            nsIContent *aOriginalElement,
                            nsAString& aTagPrefix,
                            const nsAString& aTagNamespaceURI,
                            nsIAtom* aTagName,
                            nsAString& aStr,
                            uint32_t aSkipAttr,
                            bool aAddNSAttr) override;
 
   bool IsFirstChildOfOL(nsIContent* aElement);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool SerializeLIValueAttribute(nsIContent* aElement,
                                  nsAString& aStr);
   bool IsShorthandAttr(const nsIAtom* aAttrName,
                          const nsIAtom* aElementName);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendAndTranslateEntities(const nsAString& aStr,
                                           nsAString& aOutputStr) override;
 
   nsresult EscapeURI(nsIContent* aContent,
                      const nsAString& aURI,
                      nsAString& aEscapedURI);
 
 private:
--- a/dom/base/nsXMLContentSerializer.h
+++ b/dom/base/nsXMLContentSerializer.h
@@ -67,92 +67,92 @@ class nsXMLContentSerializer : public ns
                                  nsAString& aStr) override;
 
  protected:
   virtual ~nsXMLContentSerializer();
 
   /**
    * Appends a char16_t character and increments the column position
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendToString(const char16_t aChar,
                       nsAString& aOutputStr);
 
   /**
    * Appends a nsAString string and increments the column position
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendToString(const nsAString& aStr,
                       nsAString& aOutputStr);
 
   /**
    * Appends a string by replacing all line-endings
    * by mLineBreak, except in the case of raw output.
    * It increments the column position.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendToStringConvertLF(const nsAString& aStr,
                                nsAString& aOutputStr);
 
   /**
    * Appends a string by wrapping it when necessary.
    * It updates the column position.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendToStringWrapped(const nsASingleFragmentString& aStr,
                              nsAString& aOutputStr);
 
   /**
    * Appends a string by formating and wrapping it when necessary
    * It updates the column position.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendToStringFormatedWrapped(const nsASingleFragmentString& aStr,
                                      nsAString& aOutputStr);
 
   // used by AppendToStringWrapped
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendWrapped_WhitespaceSequence(
           nsASingleFragmentString::const_char_iterator &aPos,
           const nsASingleFragmentString::const_char_iterator aEnd,
           const nsASingleFragmentString::const_char_iterator aSequenceStart,
           nsAString &aOutputStr);
 
   // used by AppendToStringFormatedWrapped
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendFormatedWrapped_WhitespaceSequence(
           nsASingleFragmentString::const_char_iterator &aPos,
           const nsASingleFragmentString::const_char_iterator aEnd,
           const nsASingleFragmentString::const_char_iterator aSequenceStart,
           bool &aMayIgnoreStartOfLineWhitespaceSequence,
           nsAString &aOutputStr);
 
   // used by AppendToStringWrapped and AppendToStringFormatedWrapped
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendWrapped_NonWhitespaceSequence(
           nsASingleFragmentString::const_char_iterator &aPos,
           const nsASingleFragmentString::const_char_iterator aEnd,
           const nsASingleFragmentString::const_char_iterator aSequenceStart,
           bool &aMayIgnoreStartOfLineWhitespaceSequence,
           bool &aSequenceStartAfterAWhiteSpace,
           nsAString &aOutputStr);
 
   /**
    * add mLineBreak to the string
    * It updates the column position and other flags.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendNewLineToString(nsAString& aOutputStr);
 
 
   /**
    * Appends a string by translating entities
    * It doesn't increment the column position
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AppendAndTranslateEntities(const nsAString& aStr,
                                           nsAString& aOutputStr);
 
   /**
    * retrieve the text content of the node and append it to the given string
    * It doesn't increment the column position
    */
   nsresult AppendTextData(nsIContent* aNode,
@@ -192,27 +192,27 @@ class nsXMLContentSerializer : public ns
    * GenerateNewPrefix generates a new prefix and writes it to aPrefix
    */
   void GenerateNewPrefix(nsAString& aPrefix);
 
   uint32_t ScanNamespaceDeclarations(nsIContent* aContent,
                                      nsIContent *aOriginalElement,
                                      const nsAString& aTagNamespaceURI);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool SerializeAttributes(nsIContent* aContent,
                                    nsIContent *aOriginalElement,
                                    nsAString& aTagPrefix,
                                    const nsAString& aTagNamespaceURI,
                                    nsIAtom* aTagName,
                                    nsAString& aStr,
                                    uint32_t aSkipAttr,
                                    bool aAddNSAttr);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool SerializeAttr(const nsAString& aPrefix,
                      const nsAString& aName,
                      const nsAString& aValue,
                      nsAString& aStr,
                      bool aDoEscapeEntities);
 
   bool IsJavaScript(nsIContent * aContent,
                       nsIAtom* aAttrNameAtom,
@@ -234,27 +234,27 @@ class nsXMLContentSerializer : public ns
 
   /**
    * This method is responsible for appending the '>' at the end of the start
    * tag, possibly preceded by '/' and maybe a ' ' before that too.
    *
    * aElement and aOriginalElement are the same as the corresponding arguments
    * to AppendElementStart.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendEndOfElementStart(mozilla::dom::Element* aEleemnt,
                                mozilla::dom::Element* aOriginalElement,
                                nsAString& aStr);
 
   /**
    * This method can be redefine to serialize additional things just after
    * after the serialization ot the start tag.
    * (called at the end of AppendElementStart)
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   virtual bool AfterElementStart(nsIContent* aContent,
                                  nsIContent* aOriginalElement,
                                  nsAString& aStr) { return true; };
 
   /**
    * This method can be redefined to check if the element can be serialized.
    * It is called when the serialization of the end tag is asked 
    * (AppendElementEnd)
@@ -293,26 +293,26 @@ class nsXMLContentSerializer : public ns
    * Returns true if a line break should be inserted after an element close tag
    */
   virtual bool LineBreakAfterClose(int32_t aNamespaceID, nsIAtom* aName);
 
   /**
    * add intendation. Call only in the case of formating and if the current
    * position is at 0. It updates the column position.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool AppendIndentation(nsAString& aStr);
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool IncrIndentation(nsIAtom* aName);
   void DecrIndentation(nsIAtom* aName);
 
   // Functions to check for newlines that needs to be added between nodes in
   // the root of a document. See mAddNewlineForRootNode
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool MaybeAddNewlineForRootNode(nsAString& aStr);
   void MaybeFlagNewlineForRootNode(nsINode* aNode);
 
   // Functions to check if we enter in or leave from a preformated content
   virtual void MaybeEnterInPreContent(nsIContent* aNode);
   virtual void MaybeLeaveFromPreContent(nsIContent* aNode);
 
   bool ShouldMaintainPreLevel() const;
--- a/dom/bindings/MozMap.h
+++ b/dom/bindings/MozMap.h
@@ -99,17 +99,17 @@ public:
   typedef void (* Enumerator)(DataType* aValue, void* aClosure);
   void EnumerateValues(Enumerator aEnumerator, void *aClosure)
   {
     for (auto iter = this->Iter(); !iter.Done(); iter.Next()) {
       aEnumerator(&iter.Get()->mData, aClosure);
     }
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   DataType* AddEntry(const nsAString& aKey)
   {
     EntryType* ent = this->PutEntry(aKey, fallible);
     if (!ent) {
       return nullptr;
     }
     return &ent->mData;
   }
--- a/dom/bindings/ToJSValue.h
+++ b/dom/bindings/ToJSValue.h
@@ -20,28 +20,28 @@ namespace mozilla {
 namespace dom {
 
 class Promise;
 
 // If ToJSValue returns false, it must set an exception on the
 // JSContext.
 
 // Accept strings.
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const nsAString& aArgument,
           JS::MutableHandle<JS::Value> aValue);
 
 // Accept booleans.  But be careful here: if we just have a function that takes
 // a boolean argument, then any pointer that doesn't match one of our other
 // signatures/templates will get treated as a boolean, which is clearly not
 // desirable.  So make this a template that only gets used if the argument type
 // is actually boolean
 template<typename T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsSame<T, bool>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           T aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
@@ -119,49 +119,49 @@ ToJSValue(JSContext* aCx,
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
   aValue.setNumber(aArgument);
   return true;
 }
 
 // Accept CallbackObjects
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 ToJSValue(JSContext* aCx,
           CallbackObject& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
   aValue.setObject(*aArgument.Callback());
 
   return MaybeWrapValue(aCx, aValue);
 }
 
 // Accept objects that inherit from nsWrapperCache (e.g. most
 // DOM objects).
 template <class T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsBaseOf<nsWrapperCache, T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           T& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
   // Make sure non-webidl objects don't sneak in here
   MOZ_ASSERT(aArgument.IsDOMBinding());
 
   return GetOrCreateDOMReflector(aCx, aArgument, aValue);
 }
 
 // Accept typed arrays built from appropriate nsTArray values
 template<typename T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsBaseOf<AllTypedArraysBase, T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           const TypedArrayCreator<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
@@ -171,17 +171,17 @@ ToJSValue(JSContext* aCx,
   }
   aValue.setObject(*obj);
   return true;
 }
 
 // Accept objects that inherit from nsISupports but not nsWrapperCache (e.g.
 // DOM File).
 template <class T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<!IsBaseOf<nsWrapperCache, T>::value &&
                   !IsBaseOf<CallbackObject, T>::value &&
                   IsBaseOf<nsISupports, T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           T& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
@@ -189,139 +189,139 @@ ToJSValue(JSContext* aCx,
 
   qsObjectHelper helper(ToSupports(&aArgument), nullptr);
   JS::Rooted<JSObject*> scope(aCx, JS::CurrentGlobalOrNull(aCx));
   return XPCOMObjectToJsval(aCx, scope, helper, nullptr, true, aValue);
 }
 
 // Accept nsRefPtr/nsCOMPtr
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const nsCOMPtr<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, *aArgument.get(), aValue);
 }
 
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const RefPtr<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, *aArgument.get(), aValue);
 }
 
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const NonNull<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, *aArgument.get(), aValue);
 }
 
 // Accept WebIDL dictionaries
 template <class T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsBaseOf<DictionaryBase, T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           const T& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return aArgument.ToObjectInternal(aCx, aValue);
 }
 
 // Accept existing JS values (which may not be same-compartment with us
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 ToJSValue(JSContext* aCx, JS::Handle<JS::Value> aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   aValue.set(aArgument);
   return MaybeWrapValue(aCx, aValue);
 }
 
 // Accept existing JS values on the Heap (which may not be same-compartment with us
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 ToJSValue(JSContext* aCx, const JS::Heap<JS::Value>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   aValue.set(aArgument);
   return MaybeWrapValue(aCx, aValue);
 }
 
 // Accept existing rooted JS values (which may not be same-compartment with us
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 ToJSValue(JSContext* aCx, const JS::Rooted<JS::Value>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   aValue.set(aArgument);
   return MaybeWrapValue(aCx, aValue);
 }
 
 // Accept existing rooted JS objects (which may not be same-compartment with
 // us).
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 ToJSValue(JSContext* aCx, const JS::Rooted<JSObject*>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   aValue.setObjectOrNull(aArgument);
   return MaybeWrapObjectOrNullValue(aCx, aValue);
 }
 
 // Accept nsresult, for use in rejections, and create an XPCOM
 // exception object representing that nsresult.
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           nsresult aArgument,
           JS::MutableHandle<JS::Value> aValue);
 
 // Accept ErrorResult, for use in rejections, and create an exception
 // representing the failure.  Note, the ErrorResult must indicate a failure
 // with aArgument.Failure() returning true.
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           ErrorResult& aArgument,
           JS::MutableHandle<JS::Value> aValue);
 
 // Accept owning WebIDL unions.
 template <typename T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsBaseOf<AllOwningUnionBase, T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           const T& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
   return aArgument.ToJSVal(aCx, global, aValue);
 }
 
 // Accept pointers to other things we accept
 template <typename T>
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 typename EnableIf<IsPointer<T>::value, bool>::Type
 ToJSValue(JSContext* aCx,
           T aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, *aArgument, aValue);
 }
 
 #ifdef SPIDERMONKEY_PROMISE
 // Accept Promise objects, which need special handling.
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           Promise& aArgument,
           JS::MutableHandle<JS::Value> aValue);
 #endif // SPIDERMONKEY_PROMISE
 
 // Accept arrays of other things we accept
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           T* aArguments,
           size_t aLength,
           JS::MutableHandle<JS::Value> aValue)
 {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
@@ -338,37 +338,37 @@ ToJSValue(JSContext* aCx,
   if (!arrayObj) {
     return false;
   }
   aValue.setObject(*arrayObj);
   return true;
 }
 
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const nsTArray<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, aArgument.Elements(),
                    aArgument.Length(), aValue);
 }
 
 template <typename T>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const FallibleTArray<T>& aArgument,
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, aArgument.Elements(),
                    aArgument.Length(), aValue);
 }
 
 template <typename T, int N>
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 ToJSValue(JSContext* aCx,
           const T(&aArgument)[N],
           JS::MutableHandle<JS::Value> aValue)
 {
   return ToJSValue(aCx, aArgument, N, aValue);
 }
 
 } // namespace dom
--- a/dom/html/nsTextEditorState.h
+++ b/dom/html/nsTextEditorState.h
@@ -151,18 +151,17 @@ public:
     // The value is changed by a call of setUserInput() from chrome.
     eSetValue_BySetUserInput        = 1 << 0,
     // The value is changed by changing value attribute of the element or
     // something like setRangeText().
     eSetValue_ByContent             = 1 << 1,
     // Whether the value change should be notified to the frame/contet nor not.
     eSetValue_Notify                = 1 << 2
   };
-  MOZ_WARN_UNUSED_RESULT bool SetValue(const nsAString& aValue,
-                                       uint32_t aFlags);
+  MOZ_MUST_USE bool SetValue(const nsAString& aValue, uint32_t aFlags);
   void GetValue(nsAString& aValue, bool aIgnoreWrap) const;
   void EmptyValue() { if (mValue) mValue->Truncate(); }
   bool IsEmpty() const { return mValue ? mValue->IsEmpty() : true; }
 
   nsresult CreatePlaceholderNode();
 
   mozilla::dom::Element* GetRootNode() {
     if (!mRootNode)
--- a/dom/ipc/nsIContentParent.h
+++ b/dom/ipc/nsIContentParent.h
@@ -54,21 +54,21 @@ public:
 
   BlobParent* GetOrCreateActorForBlob(Blob* aBlob);
   BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
 
   virtual ContentParentId ChildID() const = 0;
   virtual bool IsForApp() const = 0;
   virtual bool IsForBrowser() const = 0;
 
-  MOZ_WARN_UNUSED_RESULT virtual PBlobParent*
+  MOZ_MUST_USE virtual PBlobParent*
   SendPBlobConstructor(PBlobParent* aActor,
                        const BlobConstructorParams& aParams) = 0;
 
-  MOZ_WARN_UNUSED_RESULT virtual PBrowserParent*
+  MOZ_MUST_USE virtual PBrowserParent*
   SendPBrowserConstructor(PBrowserParent* actor,
                           const TabId& aTabId,
                           const IPCTabContext& context,
                           const uint32_t& chromeFlags,
                           const ContentParentId& aCpId,
                           const bool& aIsForApp,
                           const bool& aIsForBrowser) = 0;
 
--- a/dom/media/webaudio/AlignedTArray.h
+++ b/dom/media/webaudio/AlignedTArray.h
@@ -31,17 +31,17 @@ public:
   elem_type& operator[](index_type i) { return Elements()[i];}
   const elem_type& operator[](index_type i) const { return Elements()[i]; }
 
   void SetLength(size_type newLen)
   {
     base_type::SetLength(newLen + sExtra);
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool SetLength(size_type newLen, const mozilla::fallible_t&)
   {
     return base_type::SetLength(newLen + sExtra, mozilla::fallible);
   }
 
   size_type Length() const {
     return base_type::Length() <= sExtra ? 0 : base_type::Length() - sExtra;
   }
--- a/gfx/2d/BaseRect.h
+++ b/gfx/2d/BaseRect.h
@@ -101,17 +101,17 @@ struct BaseRect {
     return !IsEmpty() && !aRect.IsEmpty() &&
            x < aRect.XMost() && aRect.x < XMost() &&
            y < aRect.YMost() && aRect.y < YMost();
   }
   // Returns the rectangle containing the intersection of the points
   // (including edges) of *this and aRect. If there are no points in that
   // intersection, returns an empty rectangle with x/y set to the std::max of the x/y
   // of *this and aRect.
-  MOZ_WARN_UNUSED_RESULT Sub Intersect(const Sub& aRect) const
+  MOZ_MUST_USE Sub Intersect(const Sub& aRect) const
   {
     Sub result;
     result.x = std::max<T>(x, aRect.x);
     result.y = std::max<T>(y, aRect.y);
     result.width = std::min<T>(x - result.x + width, aRect.x - result.x + aRect.width);
     result.height = std::min<T>(y - result.y + height, aRect.y - result.y + aRect.height);
     if (result.width < 0 || result.height < 0) {
       result.SizeTo(0, 0);
@@ -129,30 +129,30 @@ struct BaseRect {
     *static_cast<Sub*>(this) = aRect1.Intersect(aRect2);
     return !IsEmpty();
   }
 
   // Returns the smallest rectangle that contains both the area of both
   // this and aRect2.
   // Thus, empty input rectangles are ignored.
   // If both rectangles are empty, returns this.
-  MOZ_WARN_UNUSED_RESULT Sub Union(const Sub& aRect) const
+  MOZ_MUST_USE Sub Union(const Sub& aRect) const
   {
     if (IsEmpty()) {
       return aRect;
     } else if (aRect.IsEmpty()) {
       return *static_cast<const Sub*>(this);
     } else {
       return UnionEdges(aRect);
     }
   }
   // Returns the smallest rectangle that contains both the points (including
   // edges) of both aRect1 and aRect2.
   // Thus, empty input rectangles are allowed to affect the result.
-  MOZ_WARN_UNUSED_RESULT Sub UnionEdges(const Sub& aRect) const
+  MOZ_MUST_USE Sub UnionEdges(const Sub& aRect) const
   {
     Sub result;
     result.x = std::min(x, aRect.x);
     result.y = std::min(y, aRect.y);
     result.width = std::max(XMost(), aRect.XMost()) - result.x;
     result.height = std::max(YMost(), aRect.YMost()) - result.y;
     return result;
   }
@@ -520,28 +520,28 @@ struct BaseRect {
     width = std::max<T>(0, right - x);
     height = std::max<T>(0, bottom - y);
   }
 
   /**
    * Clamp aPoint to this rectangle. It is allowed to end up on any
    * edge of the rectangle.
    */
-  MOZ_WARN_UNUSED_RESULT Point ClampPoint(const Point& aPoint) const
+  MOZ_MUST_USE Point ClampPoint(const Point& aPoint) const
   {
     return Point(std::max(x, std::min(XMost(), aPoint.x)),
                  std::max(y, std::min(YMost(), aPoint.y)));
   }
 
   /**
    * Translate this rectangle to be inside aRect. If it doesn't fit inside
    * aRect then the dimensions that don't fit will be shrunk so that they
    * do fit. The resulting rect is returned.
    */
-  MOZ_WARN_UNUSED_RESULT Sub MoveInsideAndClamp(const Sub& aRect) const
+  MOZ_MUST_USE Sub MoveInsideAndClamp(const Sub& aRect) const
   {
     Sub rect(std::max(aRect.x, x),
              std::max(aRect.y, y),
              std::min(aRect.width, width),
              std::min(aRect.height, height));
     rect.x = std::min(rect.XMost(), aRect.XMost()) - rect.width;
     rect.y = std::min(rect.YMost(), aRect.YMost()) - rect.height;
     return rect;
--- a/gfx/src/nsPoint.h
+++ b/gfx/src/nsPoint.h
@@ -30,22 +30,22 @@ struct nsPoint : public mozilla::gfx::Ba
                                          nscoord aAppUnitsPerPixel) const;
   inline nsIntPoint ToNearestPixels(nscoord aAppUnitsPerPixel) const;
 
   /**
    * Return this point scaled to a different appunits per pixel (APP) ratio.
    * @param aFromAPP the APP to scale from
    * @param aToAPP the APP to scale to
    */
-  MOZ_WARN_UNUSED_RESULT inline nsPoint
+  MOZ_MUST_USE inline nsPoint
     ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
 
-  MOZ_WARN_UNUSED_RESULT inline nsPoint
+  MOZ_MUST_USE inline nsPoint
     RemoveResolution(const float resolution) const;
-  MOZ_WARN_UNUSED_RESULT inline nsPoint
+  MOZ_MUST_USE inline nsPoint
     ApplyResolution(const float resolution) const;
 };
 
 inline nsPoint ToAppUnits(const nsIntPoint& aPoint, nscoord aAppUnitsPerPixel);
 
 inline nsIntPoint
 nsPoint::ScaleToNearestPixels(float aXScale, float aYScale,
                               nscoord aAppUnitsPerPixel) const
--- a/gfx/src/nsRect.h
+++ b/gfx/src/nsRect.h
@@ -51,28 +51,28 @@ struct nsRect :
     MOZ_COUNT_DTOR(nsRect);
   }
 #endif
 
   // We have saturating versions of all the Union methods. These avoid
   // overflowing nscoord values in the 'width' and 'height' fields by
   // clamping the width and height values to nscoord_MAX if necessary.
 
-  MOZ_WARN_UNUSED_RESULT nsRect SaturatingUnion(const nsRect& aRect) const
+  MOZ_MUST_USE nsRect SaturatingUnion(const nsRect& aRect) const
   {
     if (IsEmpty()) {
       return aRect;
     } else if (aRect.IsEmpty()) {
       return *static_cast<const nsRect*>(this);
     } else {
       return SaturatingUnionEdges(aRect);
     }
   }
 
-  MOZ_WARN_UNUSED_RESULT nsRect SaturatingUnionEdges(const nsRect& aRect) const
+  MOZ_MUST_USE nsRect SaturatingUnionEdges(const nsRect& aRect) const
   {
 #ifdef NS_COORD_IS_FLOAT
     return UnionEdges(aRect);
 #else
     nsRect result;
     result.x = std::min(aRect.x, x);
     int64_t w = std::max(int64_t(aRect.x) + aRect.width, int64_t(x) + width) - result.x;
     if (MOZ_UNLIKELY(w > nscoord_MAX)) {
@@ -97,25 +97,25 @@ struct nsRect :
     }
     result.height = nscoord(h);
     return result;
 #endif
   }
 
 #ifndef NS_COORD_IS_FLOAT
   // Make all nsRect Union methods be saturating.
-  MOZ_WARN_UNUSED_RESULT nsRect UnionEdges(const nsRect& aRect) const
+  MOZ_MUST_USE nsRect UnionEdges(const nsRect& aRect) const
   {
     return SaturatingUnionEdges(aRect);
   }
   void UnionRectEdges(const nsRect& aRect1, const nsRect& aRect2)
   {
     *this = aRect1.UnionEdges(aRect2);
   }
-  MOZ_WARN_UNUSED_RESULT nsRect Union(const nsRect& aRect) const
+  MOZ_MUST_USE nsRect Union(const nsRect& aRect) const
   {
     return SaturatingUnion(aRect);
   }
   void UnionRect(const nsRect& aRect1, const nsRect& aRect2)
   {
     *this = aRect1.Union(aRect2);
   }
 #endif
@@ -133,51 +133,51 @@ struct nsRect :
    * Return this rect scaled to a different appunits per pixel (APP) ratio.
    * In the RoundOut version we make the rect the smallest rect containing the
    * unrounded result. In the RoundIn version we make the rect the largest rect
    * contained in the unrounded result.
    * @param aFromAPP the APP to scale from
    * @param aToAPP the APP to scale to
    * @note this can turn an empty rectangle into a non-empty rectangle
    */
-  MOZ_WARN_UNUSED_RESULT inline nsRect
+  MOZ_MUST_USE inline nsRect
     ScaleToOtherAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const;
-  MOZ_WARN_UNUSED_RESULT inline nsRect
+  MOZ_MUST_USE inline nsRect
     ScaleToOtherAppUnitsRoundIn(int32_t aFromAPP, int32_t aToAPP) const;
 
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ScaleToNearestPixels(float aXScale, float aYScale,
                        nscoord aAppUnitsPerPixel) const;
 
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ToNearestPixels(nscoord aAppUnitsPerPixel) const;
 
   // Note: this can turn an empty rectangle into a non-empty rectangle
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ScaleToOutsidePixels(float aXScale, float aYScale,
                        nscoord aAppUnitsPerPixel) const;
 
   // Note: this can turn an empty rectangle into a non-empty rectangle
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ToOutsidePixels(nscoord aAppUnitsPerPixel) const;
 
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ScaleToInsidePixels(float aXScale, float aYScale,
                       nscoord aAppUnitsPerPixel) const;
 
-  MOZ_WARN_UNUSED_RESULT inline mozilla::gfx::IntRect
+  MOZ_MUST_USE inline mozilla::gfx::IntRect
   ToInsidePixels(nscoord aAppUnitsPerPixel) const;
 
   // This is here only to keep IPDL-generated code happy. DO NOT USE.
   bool operator==(const nsRect& aRect) const
   {
     return IsEqualEdges(aRect);
   }
 
-  MOZ_WARN_UNUSED_RESULT inline nsRect RemoveResolution(const float aResolution) const;
+  MOZ_MUST_USE inline nsRect RemoveResolution(const float aResolution) const;
 };
 
 /*
  * App Unit/Pixel conversions
  */
 
 inline nsRect
 nsRect::ScaleToOtherAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const
--- a/gfx/src/nsRegion.h
+++ b/gfx/src/nsRegion.h
@@ -292,19 +292,19 @@ public:
 
   /**
    * Return this region scaled to a different appunits per pixel (APP) ratio.
    * This applies nsRect::ScaleToOtherAppUnitsRoundOut/In to each rect of the region.
    * @param aFromAPP the APP to scale from
    * @param aToAPP the APP to scale to
    * @note this can turn an empty region into a non-empty region
    */
-  MOZ_WARN_UNUSED_RESULT nsRegion
+  MOZ_MUST_USE nsRegion
     ScaleToOtherAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) const;
-  MOZ_WARN_UNUSED_RESULT nsRegion
+  MOZ_MUST_USE nsRegion
     ScaleToOtherAppUnitsRoundIn (int32_t aFromAPP, int32_t aToAPP) const;
   nsRegion& ScaleRoundOut(float aXScale, float aYScale);
   nsRegion& ScaleInverseRoundOut(float aXScale, float aYScale);
   nsRegion& Transform (const mozilla::gfx::Matrix4x4 &aTransform);
   nsIntRegion ScaleToOutsidePixels (float aXScale, float aYScale, nscoord aAppUnitsPerPixel) const;
   nsIntRegion ScaleToInsidePixels (float aXScale, float aYScale, nscoord aAppUnitsPerPixel) const;
   nsIntRegion ScaleToNearestPixels (float aXScale, float aYScale, nscoord aAppUnitsPerPixel) const;
   nsIntRegion ToOutsidePixels (nscoord aAppUnitsPerPixel) const;
--- a/gfx/src/nsSize.h
+++ b/gfx/src/nsSize.h
@@ -25,17 +25,17 @@ struct nsSize : public mozilla::gfx::Bas
                                         nscoord aAppUnitsPerPixel) const;
   inline mozilla::gfx::IntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const;
 
   /**
    * Return this size scaled to a different appunits per pixel (APP) ratio.
    * @param aFromAPP the APP to scale from
    * @param aToAPP the APP to scale to
    */
-  MOZ_WARN_UNUSED_RESULT inline nsSize
+  MOZ_MUST_USE inline nsSize
     ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
 };
 
 inline mozilla::gfx::IntSize
 nsSize::ScaleToNearestPixels(float aXScale, float aYScale,
                              nscoord aAppUnitsPerPixel) const
 {
   return mozilla::gfx::IntSize(
--- a/intl/uconv/nsIUnicodeDecoder.h
+++ b/intl/uconv/nsIUnicodeDecoder.h
@@ -105,19 +105,19 @@ public:
    *
    * @param aSrc        [IN] the source data buffer
    * @param aSrcLength  [IN] the length of source data buffer
    * @param aDestLength [OUT] the needed size of the destination buffer
    * @return            NS_EXACT_LENGTH if an exact length was computed
    *                    NS_ERROR_OUT_OF_MEMORY if OOM
    *                    NS_OK is all we have is an approximation
    */
-   MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char* aSrc,
-                                                  int32_t aSrcLength,
-                                                  int32_t* aDestLength) = 0;
+   MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char* aSrc,
+                                        int32_t aSrcLength,
+                                        int32_t* aDestLength) = 0;
 
   /**
    * Resets the charset converter so it may be recycled for a completely 
    * different and urelated buffer of data.
    */
   NS_IMETHOD Reset() = 0;
 
   /**
--- a/intl/uconv/nsIUnicodeEncoder.h
+++ b/intl/uconv/nsIUnicodeEncoder.h
@@ -130,19 +130,19 @@ public:
    *
    * @param aSrc        [IN] the source data buffer
    * @param aSrcLength  [IN] the length of source data buffer
    * @param aDestLength [OUT] the needed size of the destination buffer
    * @return            NS_OK_UENC_EXACTLENGTH if an exact length was computed
    *                    NS_ERROR_OUT_OF_MEMORY if OOM
    *                    NS_OK if all we have is an approximation
    */
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char16_t* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) = 0;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char16_t* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) = 0;
 
   /**
    * Resets the charset converter so it may be recycled for a completely 
    * different and urelated buffer of data.
    */
   NS_IMETHOD Reset() = 0;
 
   /**
--- a/intl/uconv/nsReplacementToUnicode.h
+++ b/intl/uconv/nsReplacementToUnicode.h
@@ -19,19 +19,19 @@ class nsReplacementToUnicode : public ns
 public:
   nsReplacementToUnicode();
 
   NS_IMETHOD Convert(const char* aSrc,
                      int32_t* aSrcLength,
                      char16_t* aDest,
                      int32_t* aDestLength) override;
 
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) override;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) override;
 
   NS_IMETHOD Reset() override;
 
 private:
   bool mSeenByte;
 };
 
 #endif // nsReplacementToUnicode_h_
--- a/intl/uconv/nsUTF8ToUnicode.h
+++ b/intl/uconv/nsUTF8ToUnicode.h
@@ -44,19 +44,19 @@ protected:
   uint32_t mUcs4; // cached Unicode character
   uint8_t mState; // cached expected number of bytes per UTF8 character sequence
   uint8_t mBytes;
   bool mFirst;
 
   //--------------------------------------------------------------------
   // Subclassing of nsDecoderSupport class [declaration]
 
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) override;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) override;
 
   //--------------------------------------------------------------------
   // Subclassing of nsBasicDecoderSupport class [declaration]
 
   NS_IMETHOD Convert(const char * aSrc, int32_t * aSrcLength, 
       char16_t * aDest, int32_t * aDestLength) override;
 
   //--------------------------------------------------------------------
--- a/intl/uconv/nsUnicodeToUTF8.h
+++ b/intl/uconv/nsUnicodeToUTF8.h
@@ -43,19 +43,19 @@ public:
 
   NS_IMETHOD Convert(const char16_t*aSrc,
                      int32_t* aSrcLength,
                      char* aDest,
                      int32_t* aDestLength) override;
 
   NS_IMETHOD Finish(char* aDest, int32_t* aDestLength) override;
 
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char16_t* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) override;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char16_t* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) override;
 
   NS_IMETHOD Reset() override {mHighSurrogate = 0; return NS_OK;}
 
   NS_IMETHOD SetOutputErrorBehavior(int32_t aBehavior,
     nsIUnicharEncoder* aEncoder, char16_t aChar) override {return NS_OK;}
 
 protected:
   char16_t mHighSurrogate;
--- a/intl/uconv/ucvlatin/nsUTF16ToUnicode.h
+++ b/intl/uconv/ucvlatin/nsUTF16ToUnicode.h
@@ -19,19 +19,19 @@ protected:
   nsresult UTF16ConvertToUnicode(const char* aSrc,
                                  int32_t* aSrcLength, char16_t* aDest,
                                  int32_t* aDestLength, bool aSwapBytes);
 
 public:
   //--------------------------------------------------------------------
   // Subclassing of nsDecoderSupport class [declaration]
 
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) override;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) override;
   NS_IMETHOD Reset() override;
 
 protected:
   uint8_t mState;
   // to store an odd byte left over between runs
   uint8_t mOddByte;
   // to store an odd high surrogate left over between runs
   char16_t mOddHighSurrogate;
--- a/intl/uconv/ucvlatin/nsUnicodeToUTF16.h
+++ b/intl/uconv/ucvlatin/nsUnicodeToUTF16.h
@@ -14,19 +14,19 @@ class nsUnicodeToUTF16BE: public nsBasic
 public:
   nsUnicodeToUTF16BE() { mBOM = 0;}
 
   //--------------------------------------------------------------------
   // Interface nsIUnicodeEncoder [declaration]
 
   NS_IMETHOD Convert(const char16_t* aSrc, int32_t* aSrcLength, 
       char* aDest, int32_t* aDestLength);
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char16_t* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength);
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char16_t* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength);
   NS_IMETHOD Finish(char* aDest, int32_t* aDestLength);
   NS_IMETHOD Reset();
   NS_IMETHOD SetOutputErrorBehavior(int32_t aBehavior, 
       nsIUnicharEncoder* aEncoder, char16_t aChar);
 
 protected:
   char16_t mBOM;
   NS_IMETHOD CopyData(char* aDest, const char16_t* aSrc, int32_t aLen  );
--- a/intl/uconv/ucvtw/nsUnicodeToBIG5.h
+++ b/intl/uconv/ucvtw/nsUnicodeToBIG5.h
@@ -24,19 +24,19 @@ public:
   NS_IMETHOD Convert(const char16_t* aSrc,
                      int32_t* aSrcLength,
                      char* aDest,
                      int32_t * aDestLength) override;
 
   NS_IMETHOD Finish(char* aDest,
                     int32_t* aDestLength) override;
 
-  MOZ_WARN_UNUSED_RESULT NS_IMETHOD GetMaxLength(const char16_t* aSrc,
-                                                 int32_t aSrcLength,
-                                                 int32_t* aDestLength) override;
+  MOZ_MUST_USE NS_IMETHOD GetMaxLength(const char16_t* aSrc,
+                                       int32_t aSrcLength,
+                                       int32_t* aDestLength) override;
 
   NS_IMETHOD Reset() override;
 
   NS_IMETHOD SetOutputErrorBehavior(int32_t aBehavior,
                                     nsIUnicharEncoder* aEncoder,
                                     char16_t aChar) override;
 
 private:
--- a/ipc/chromium/src/base/pickle.h
+++ b/ipc/chromium/src/base/pickle.h
@@ -76,40 +76,40 @@ class Pickle {
 
   // Returns the data for this Pickle.
   const void* data() const { return header_; }
 
   // Methods for reading the payload of the Pickle.  To read from the start of
   // the Pickle, initialize *iter to NULL.  If successful, these methods return
   // true.  Otherwise, false is returned to indicate that the result could not
   // be extracted.
-  MOZ_WARN_UNUSED_RESULT bool ReadBool(void** iter, bool* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadInt16(void** iter, int16_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadUInt16(void** iter, uint16_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadShort(void** iter, short* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadInt(void** iter, int* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadLong(void** iter, long* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadULong(void** iter, unsigned long* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadSize(void** iter, size_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadInt32(void** iter, int32_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadUInt32(void** iter, uint32_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadInt64(void** iter, int64_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadUInt64(void** iter, uint64_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadDouble(void** iter, double* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadIntPtr(void** iter, intptr_t* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadUnsignedChar(void** iter, unsigned char* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadString(void** iter, std::string* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadWString(void** iter, std::wstring* result) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadData(void** iter, const char** data, int* length) const;
-  MOZ_WARN_UNUSED_RESULT bool ReadBytes(void** iter, const char** data, int length,
+  MOZ_MUST_USE bool ReadBool(void** iter, bool* result) const;
+  MOZ_MUST_USE bool ReadInt16(void** iter, int16_t* result) const;
+  MOZ_MUST_USE bool ReadUInt16(void** iter, uint16_t* result) const;
+  MOZ_MUST_USE bool ReadShort(void** iter, short* result) const;
+  MOZ_MUST_USE bool ReadInt(void** iter, int* result) const;
+  MOZ_MUST_USE bool ReadLong(void** iter, long* result) const;
+  MOZ_MUST_USE bool ReadULong(void** iter, unsigned long* result) const;
+  MOZ_MUST_USE bool ReadSize(void** iter, size_t* result) const;
+  MOZ_MUST_USE bool ReadInt32(void** iter, int32_t* result) const;
+  MOZ_MUST_USE bool ReadUInt32(void** iter, uint32_t* result) const;
+  MOZ_MUST_USE bool ReadInt64(void** iter, int64_t* result) const;
+  MOZ_MUST_USE bool ReadUInt64(void** iter, uint64_t* result) const;
+  MOZ_MUST_USE bool ReadDouble(void** iter, double* result) const;
+  MOZ_MUST_USE bool ReadIntPtr(void** iter, intptr_t* result) const;
+  MOZ_MUST_USE bool ReadUnsignedChar(void** iter, unsigned char* result) const;
+  MOZ_MUST_USE bool ReadString(void** iter, std::string* result) const;
+  MOZ_MUST_USE bool ReadWString(void** iter, std::wstring* result) const;
+  MOZ_MUST_USE bool ReadData(void** iter, const char** data, int* length) const;
+  MOZ_MUST_USE bool ReadBytes(void** iter, const char** data, int length,
 					uint32_t alignment = sizeof(memberAlignmentType)) const;
 
   // Safer version of ReadInt() checks for the result not being negative.
   // Use it for reading the object sizes.
-  MOZ_WARN_UNUSED_RESULT bool ReadLength(void** iter, int* result) const;
+  MOZ_MUST_USE bool ReadLength(void** iter, int* result) const;
 
   // Methods for adding to the payload of the Pickle.  These values are
   // appended to the end of the Pickle's payload.  When reading values from a
   // Pickle, it is important to read them in the order in which they were added
   // to the Pickle.
   bool WriteBool(bool value) {
     return WriteInt(value ? 1 : 0);
   }
--- a/ipc/ipdl/ipdl/cxx/cgen.py
+++ b/ipc/ipdl/ipdl/cxx/cgen.py
@@ -180,17 +180,17 @@ class CxxCodeGen(CodePrinter, Visitor):
         if md.T:
             self.write('template<')
             self.write('typename ')
             md.T.accept(self)
             self.println('>')
             self.printdent()
 
         if md.warn_unused:
-            self.write('MOZ_WARN_UNUSED_RESULT ')
+            self.write('MOZ_MUST_USE ')
         if md.inline:
             self.write('inline ')
         if md.never_inline:
             self.write('MOZ_NEVER_INLINE ')
         if md.static:
             self.write('static ')
         if md.virtual:
             self.write('virtual ')
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -72,18 +72,18 @@ class HashMap
 
   public:
     typedef typename HashPolicy::Lookup Lookup;
     typedef TableEntry Entry;
 
     // HashMap construction is fallible (due to OOM); thus the user must call
     // init after constructing a HashMap and check the return value.
     explicit HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}
-    MOZ_WARN_UNUSED_RESULT bool init(uint32_t len = 16) { return impl.init(len); }
-    bool initialized() const                          { return impl.initialized(); }
+    MOZ_MUST_USE bool init(uint32_t len = 16) { return impl.init(len); }
+    bool initialized() const                  { return impl.initialized(); }
 
     // Return whether the given lookup value is present in the map. E.g.:
     //
     //   typedef HashMap<int,char> HM;
     //   HM h;
     //   if (HM::Ptr p = h.lookup(3)) {
     //     const HM::Entry& e = *p; // p acts like a pointer to Entry
     //     assert(p->key == 3);     // Entry contains the key
@@ -135,29 +135,29 @@ class HashMap
     //    assert(p->key == 3);
     //    char val = p->value;
     typedef typename Impl::AddPtr AddPtr;
     AddPtr lookupForAdd(const Lookup& l) const {
         return impl.lookupForAdd(l);
     }
 
     template<typename KeyInput, typename ValueInput>
-    MOZ_WARN_UNUSED_RESULT bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) {
+    MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) {
         return impl.add(p,
                         mozilla::Forward<KeyInput>(k),
                         mozilla::Forward<ValueInput>(v));
     }
 
     template<typename KeyInput>
-    MOZ_WARN_UNUSED_RESULT bool add(AddPtr& p, KeyInput&& k) {
+    MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k) {
         return impl.add(p, mozilla::Forward<KeyInput>(k), Value());
     }
 
     template<typename KeyInput, typename ValueInput>
-    MOZ_WARN_UNUSED_RESULT bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) {
+    MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) {
         return impl.relookupOrAdd(p, k,
                                   mozilla::Forward<KeyInput>(k),
                                   mozilla::Forward<ValueInput>(v));
     }
 
     // |all()| returns a Range containing |count()| elements. E.g.:
     //
     //   typedef HashMap<int,char> HM;
@@ -218,28 +218,28 @@ class HashMap
     /************************************************** Shorthand operations */
 
     bool has(const Lookup& l) const {
         return impl.lookup(l).found();
     }
 
     // Overwrite existing value with v. Return false on oom.
     template<typename KeyInput, typename ValueInput>
-    MOZ_WARN_UNUSED_RESULT bool put(KeyInput&& k, ValueInput&& v) {
+    MOZ_MUST_USE bool put(KeyInput&& k, ValueInput&& v) {
         AddPtr p = lookupForAdd(k);
         if (p) {
             p->value() = mozilla::Forward<ValueInput>(v);
             return true;
         }
         return add(p, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v));
     }
 
     // Like put, but assert that the given key is not already present.
     template<typename KeyInput, typename ValueInput>
-    MOZ_WARN_UNUSED_RESULT bool putNew(KeyInput&& k, ValueInput&& v) {
+    MOZ_MUST_USE bool putNew(KeyInput&& k, ValueInput&& v) {
         return impl.putNew(k, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v));
     }
 
     // Only call this to populate an empty map after reserving space with init().
     template<typename KeyInput, typename ValueInput>
     void putNewInfallible(KeyInput&& k, ValueInput&& v) {
         impl.putNewInfallible(k, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v));
     }
@@ -326,18 +326,18 @@ class HashSet
 
   public:
     typedef typename HashPolicy::Lookup Lookup;
     typedef T Entry;
 
     // HashSet construction is fallible (due to OOM); thus the user must call
     // init after constructing a HashSet and check the return value.
     explicit HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}
-    MOZ_WARN_UNUSED_RESULT bool init(uint32_t len = 16) { return impl.init(len); }
-    bool initialized() const                          { return impl.initialized(); }
+    MOZ_MUST_USE bool init(uint32_t len = 16) { return impl.init(len); }
+    bool initialized() const                  { return impl.initialized(); }
 
     // Return whether the given lookup value is present in the map. E.g.:
     //
     //   typedef HashSet<int> HS;
     //   HS h;
     //   if (HS::Ptr p = h.lookup(3)) {
     //     assert(*p == 3);   // p acts like a pointer to int
     //   }
@@ -384,22 +384,22 @@ class HashSet
     //    assert(*p == 3);
     //
     // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the
     // entry |t|, where the caller ensures match(l,t).
     typedef typename Impl::AddPtr AddPtr;
     AddPtr lookupForAdd(const Lookup& l) const        { return impl.lookupForAdd(l); }
 
     template <typename U>
-    MOZ_WARN_UNUSED_RESULT bool add(AddPtr& p, U&& u) {
+    MOZ_MUST_USE bool add(AddPtr& p, U&& u) {
         return impl.add(p, mozilla::Forward<U>(u));
     }
 
     template <typename U>
-    MOZ_WARN_UNUSED_RESULT bool relookupOrAdd(AddPtr& p, const Lookup& l, U&& u) {
+    MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, const Lookup& l, U&& u) {
         return impl.relookupOrAdd(p, l, mozilla::Forward<U>(u));
     }
 
     // |all()| returns a Range containing |count()| elements:
     //
     //   typedef HashSet<int> HS;
     //   HS h;
     //   for (HS::Range r = h.all(); !r.empty(); r.popFront())
@@ -458,29 +458,29 @@ class HashSet
     /************************************************** Shorthand operations */
 
     bool has(const Lookup& l) const {
         return impl.lookup(l).found();
     }
 
     // Add |u| if it is not present already. Return false on oom.
     template <typename U>
-    MOZ_WARN_UNUSED_RESULT bool put(U&& u) {
+    MOZ_MUST_USE bool put(U&& u) {
         AddPtr p = lookupForAdd(u);
         return p ? true : add(p, mozilla::Forward<U>(u));
     }
 
     // Like put, but assert that the given key is not already present.
     template <typename U>
-    MOZ_WARN_UNUSED_RESULT bool putNew(U&& u) {
+    MOZ_MUST_USE bool putNew(U&& u) {
         return impl.putNew(u, mozilla::Forward<U>(u));
     }
 
     template <typename U>
-    MOZ_WARN_UNUSED_RESULT bool putNew(const Lookup& l, U&& u) {
+    MOZ_MUST_USE bool putNew(const Lookup& l, U&& u) {
         return impl.putNew(l, mozilla::Forward<U>(u));
     }
 
     // Only call this to populate an empty set after reserving space with init().
     template <typename U>
     void putNewInfallible(const Lookup& l, U&& u) {
         impl.putNewInfallible(l, mozilla::Forward<U>(u));
     }
@@ -1188,17 +1188,17 @@ class HashTable : private AllocPolicy
       , entryCount(0)
       , removedCount(0)
 #ifdef JS_DEBUG
       , mutationCount(0)
       , mEntered(false)
 #endif
     {}
 
-    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)
+    MOZ_MUST_USE bool init(uint32_t length)
     {
         MOZ_ASSERT(!initialized());
 
         // Reject all lengths whose initial computed capacity would exceed
         // sMaxCapacity.  Round that maximum length down to the nearest power
         // of two for speedier code.
         if (MOZ_UNLIKELY(length > sMaxInit)) {
             this->reportAllocOverflow();
@@ -1684,17 +1684,17 @@ class HashTable : private AllocPolicy
         mozilla::ReentrancyGuard g(*this);
         HashNumber keyHash = prepareHash(l);
         Entry& entry = lookup(l, keyHash, sCollisionBit);
         AddPtr p(entry, *this, keyHash);
         return p;
     }
 
     template <typename... Args>
-    MOZ_WARN_UNUSED_RESULT bool add(AddPtr& p, Args&&... args)
+    MOZ_MUST_USE bool add(AddPtr& p, Args&&... args)
     {
         mozilla::ReentrancyGuard g(*this);
         MOZ_ASSERT(table);
         MOZ_ASSERT(!p.found());
         MOZ_ASSERT(!(p.keyHash & sCollisionBit));
 
         // Changing an entry from removed to live does not affect whether we
         // are overloaded and can be handled separately.
@@ -1733,32 +1733,32 @@ class HashTable : private AllocPolicy
         MOZ_ASSERT(!lookup(l).found());
         mozilla::ReentrancyGuard g(*this);
         putNewInfallibleInternal(l, mozilla::Forward<Args>(args)...);
     }
 
     // Note: |l| may be alias arguments in |args|, so this function must take
     // care not to use |l| after moving |args|.
     template <typename... Args>
-    MOZ_WARN_UNUSED_RESULT bool putNew(const Lookup& l, Args&&... args)
+    MOZ_MUST_USE bool putNew(const Lookup& l, Args&&... args)
     {
         if (!this->checkSimulatedOOM())
             return false;
 
         if (checkOverloaded() == RehashFailed)
             return false;
 
         putNewInfallible(l, mozilla::Forward<Args>(args)...);
         return true;
     }
 
     // Note: |l| may be a reference to a piece of |u|, so this function
     // must take care not to use |l| after moving |u|.
     template <typename... Args>
-    MOZ_WARN_UNUSED_RESULT bool relookupOrAdd(AddPtr& p, const Lookup& l, Args&&... args)
+    MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, const Lookup& l, Args&&... args)
     {
 #ifdef JS_DEBUG
         p.generation = generation();
         p.mutationCount = mutationCount;
 #endif
         {
             mozilla::ReentrancyGuard g(*this);
             MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -339,30 +339,30 @@ JS_DECLARE_NEW_METHODS(js_new, js_malloc
 
 namespace js {
 
 /*
  * Calculate the number of bytes needed to allocate |numElems| contiguous
  * instances of type |T|.  Return false if the calculation overflowed.
  */
 template <typename T>
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 CalculateAllocSize(size_t numElems, size_t* bytesOut)
 {
     *bytesOut = numElems * sizeof(T);
     return (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value) == 0;
 }
 
 /*
  * Calculate the number of bytes needed to allocate a single instance of type
  * |T| followed by |numExtra| contiguous instances of type |Extra|.  Return
  * false if the calculation overflowed.
  */
 template <typename T, typename Extra>
-MOZ_WARN_UNUSED_RESULT inline bool
+MOZ_MUST_USE inline bool
 CalculateAllocSizeWithExtra(size_t numExtra, size_t* bytesOut)
 {
     *bytesOut = sizeof(T) + numExtra * sizeof(Extra);
     return (numExtra & mozilla::tl::MulOverflowMask<sizeof(Extra)>::value) == 0 &&
            *bytesOut >= sizeof(T);
 }
 
 } /* namespace js */
--- a/js/src/asmjs/AsmJS.cpp
+++ b/js/src/asmjs/AsmJS.cpp
@@ -2823,21 +2823,21 @@ class MOZ_STACK_CLASS FunctionValidator
     }
 
     size_t numLocals() const { return locals_.count(); }
 
     /**************************************************** Encoding interface */
 
     Encoder& encoder() { return *encoder_; }
 
-    MOZ_WARN_UNUSED_RESULT bool writeInt32Lit(int32_t i32) {
+    MOZ_MUST_USE bool writeInt32Lit(int32_t i32) {
         return encoder().writeExpr(Expr::I32Const) &&
                encoder().writeVarS32(i32);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeConstExpr(NumLit lit) {
+    MOZ_MUST_USE bool writeConstExpr(NumLit lit) {
         switch (lit.which()) {
           case NumLit::Fixnum:
           case NumLit::NegativeInt:
           case NumLit::BigUnsigned:
             return writeInt32Lit(lit.toInt32());
           case NumLit::Float:
             return encoder().writeExpr(Expr::F32Const) &&
                    encoder().writeFixedF32(lit.toFloat());
@@ -2855,24 +2855,24 @@ class MOZ_STACK_CLASS FunctionValidator
             // Boolean vectors use the Int32x4 memory representation.
             return encoder().writeExpr(Expr::B32x4Const) &&
                    encoder().writeFixedI32x4(lit.simdValue().asInt32x4());
           case NumLit::OutOfRangeInt:
             break;
         }
         MOZ_CRASH("unexpected literal type");
     }
-    MOZ_WARN_UNUSED_RESULT bool writeCall(ParseNode* pn, Expr op) {
+    MOZ_MUST_USE bool writeCall(ParseNode* pn, Expr op) {
         return encoder().writeExpr(op) &&
                fg_.addCallSiteLineNum(m().tokenStream().srcCoords.lineNum(pn->pn_pos.begin));
     }
-    MOZ_WARN_UNUSED_RESULT bool prepareCall(ParseNode* pn) {
+    MOZ_MUST_USE bool prepareCall(ParseNode* pn) {
         return fg_.addCallSiteLineNum(m().tokenStream().srcCoords.lineNum(pn->pn_pos.begin));
     }
-    MOZ_WARN_UNUSED_RESULT bool writeSimdOp(SimdType simdType, SimdOperation op) {
+    MOZ_MUST_USE bool writeSimdOp(SimdType simdType, SimdOperation op) {
         Expr expr = SimdToExpr(simdType, op);
         if (expr == Expr::Limit)
             return true;
         return encoder().writeExpr(expr);
     }
 };
 
 } /* anonymous namespace */
--- a/js/src/asmjs/WasmBinary.h
+++ b/js/src/asmjs/WasmBinary.h
@@ -340,35 +340,35 @@ typedef Vector<uint8_t, 0, SystemAllocPo
 // construction. The client is responsible for the Bytes's lifetime and must
 // keep the Bytes alive as long as the Encoder is used.
 
 class Encoder
 {
     Bytes& bytes_;
 
     template <class T>
-    MOZ_WARN_UNUSED_RESULT bool write(const T& v) {
+    MOZ_MUST_USE bool write(const T& v) {
         return bytes_.append(reinterpret_cast<const uint8_t*>(&v), sizeof(T));
     }
 
     template <typename UInt>
-    MOZ_WARN_UNUSED_RESULT bool writeVarU(UInt i) {
+    MOZ_MUST_USE bool writeVarU(UInt i) {
         do {
             uint8_t byte = i & 0x7f;
             i >>= 7;
             if (i != 0)
                 byte |= 0x80;
             if (!bytes_.append(byte))
                 return false;
         } while (i != 0);
         return true;
     }
 
     template <typename SInt>
-    MOZ_WARN_UNUSED_RESULT bool writeVarS(SInt i) {
+    MOZ_MUST_USE bool writeVarS(SInt i) {
         bool done;
         do {
             uint8_t byte = i & 0x7f;
             i >>= 7;
             done = ((i == 0) && !(byte & 0x40)) || ((i == -1) && (byte & 0x40));
             if (!done)
                 byte |= 0x80;
             if (!bytes_.append(byte))
@@ -410,87 +410,87 @@ class Encoder
     }
 
     size_t currentOffset() const { return bytes_.length(); }
     bool empty() const { return currentOffset() == 0; }
 
     // Fixed-size encoding operations simply copy the literal bytes (without
     // attempting to align).
 
-    MOZ_WARN_UNUSED_RESULT bool writeFixedU8(uint8_t i) {
+    MOZ_MUST_USE bool writeFixedU8(uint8_t i) {
         return write<uint8_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeFixedU32(uint32_t i) {
+    MOZ_MUST_USE bool writeFixedU32(uint32_t i) {
         return write<uint32_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeFixedF32(float f) {
+    MOZ_MUST_USE bool writeFixedF32(float f) {
         return write<float>(f);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeFixedF64(double d) {
+    MOZ_MUST_USE bool writeFixedF64(double d) {
         return write<double>(d);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeFixedI32x4(const I32x4& i32x4) {
+    MOZ_MUST_USE bool writeFixedI32x4(const I32x4& i32x4) {
         return write<I32x4>(i32x4);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeFixedF32x4(const F32x4& f32x4) {
+    MOZ_MUST_USE bool writeFixedF32x4(const F32x4& f32x4) {
         return write<F32x4>(f32x4);
     }
 
     // Variable-length encodings that all use LEB128.
 
-    MOZ_WARN_UNUSED_RESULT bool writeVarU32(uint32_t i) {
+    MOZ_MUST_USE bool writeVarU32(uint32_t i) {
         return writeVarU<uint32_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeVarS32(int32_t i) {
+    MOZ_MUST_USE bool writeVarS32(int32_t i) {
         return writeVarS<int32_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeVarU64(uint64_t i) {
+    MOZ_MUST_USE bool writeVarU64(uint64_t i) {
         return writeVarU<uint64_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeVarS64(int64_t i) {
+    MOZ_MUST_USE bool writeVarS64(int64_t i) {
         return writeVarS<int64_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool writeValType(ValType type) {
+    MOZ_MUST_USE bool writeValType(ValType type) {
         static_assert(size_t(ValType::Limit) <= INT8_MAX, "fits");
         return writeFixedU8(size_t(type));
     }
-    MOZ_WARN_UNUSED_RESULT bool writeExpr(Expr expr) {
+    MOZ_MUST_USE bool writeExpr(Expr expr) {
         static_assert(size_t(Expr::Limit) <= ExprLimit, "fits");
         if (size_t(expr) < UINT8_MAX)
             return writeFixedU8(uint8_t(expr));
         return writeFixedU8(UINT8_MAX) &&
                writeFixedU8(size_t(expr) - UINT8_MAX);
     }
 
     // Variable-length encodings that allow back-patching.
 
-    MOZ_WARN_UNUSED_RESULT bool writePatchableVarU32(size_t* offset) {
+    MOZ_MUST_USE bool writePatchableVarU32(size_t* offset) {
         *offset = bytes_.length();
         return writeVarU32(UINT32_MAX);
     }
     void patchVarU32(size_t offset, uint32_t patchBits) {
         return patchVarU32(offset, patchBits, UINT32_MAX);
     }
 
     // Byte ranges start with an LEB128 length followed by an arbitrary sequence
     // of bytes. When used for strings, bytes are to be interpreted as utf8.
 
-    MOZ_WARN_UNUSED_RESULT bool writeBytes(const void* bytes, uint32_t numBytes) {
+    MOZ_MUST_USE bool writeBytes(const void* bytes, uint32_t numBytes) {
         return writeVarU32(numBytes) &&
                bytes_.append(reinterpret_cast<const uint8_t*>(bytes), numBytes);
     }
 
     // A "section" is a contiguous range of bytes that stores its own size so
     // that it may be trivially skipped without examining the contents. Sections
     // require backpatching since the size of the section is only known at the
     // end while the size's varU32 must be stored at the beginning. Immediately
     // after the section length is the string id of the section.
 
     template <size_t IdSizeWith0>
-    MOZ_WARN_UNUSED_RESULT bool startSection(const char (&id)[IdSizeWith0], size_t* offset) {
+    MOZ_MUST_USE bool startSection(const char (&id)[IdSizeWith0], size_t* offset) {
         static const size_t IdSize = IdSizeWith0 - 1;
         MOZ_ASSERT(id[IdSize] == '\0');
         return writeVarU32(IdSize) &&
                bytes_.append(reinterpret_cast<const uint8_t*>(id), IdSize) &&
                writePatchableVarU32(offset);
     }
     void finishSection(size_t offset) {
         return patchVarU32(offset, bytes_.length() - offset - varU32ByteLength(offset));
@@ -503,17 +503,17 @@ class Encoder
 
 class Decoder
 {
     const uint8_t* const beg_;
     const uint8_t* const end_;
     const uint8_t* cur_;
 
     template <class T>
-    MOZ_WARN_UNUSED_RESULT bool read(T* out) {
+    MOZ_MUST_USE bool read(T* out) {
         if (bytesRemain() < sizeof(T))
             return false;
         memcpy((void*)out, cur_, sizeof(T));
         cur_ += sizeof(T);
         return true;
     }
 
     template <class T>
@@ -521,17 +521,17 @@ class Decoder
         MOZ_ASSERT(bytesRemain() >= sizeof(T));
         T ret;
         memcpy(&ret, cur_, sizeof(T));
         cur_ += sizeof(T);
         return ret;
     }
 
     template <typename UInt>
-    MOZ_WARN_UNUSED_RESULT bool readVarU(UInt* out) {
+    MOZ_MUST_USE bool readVarU(UInt* out) {
         const unsigned numBits = sizeof(UInt) * CHAR_BIT;
         const unsigned remainderBits = numBits % 7;
         const unsigned numBitsInSevens = numBits - remainderBits;
         UInt u = 0;
         uint8_t byte;
         UInt shift = 0;
         do {
             if (!readFixedU8(&byte))
@@ -545,17 +545,17 @@ class Decoder
         } while (shift != numBitsInSevens);
         if (!readFixedU8(&byte) || (byte & (unsigned(-1) << remainderBits)))
             return false;
         *out = u | (UInt(byte) << numBitsInSevens);
         return true;
     }
 
     template <typename SInt>
-    MOZ_WARN_UNUSED_RESULT bool readVarS(SInt* out) {
+    MOZ_MUST_USE bool readVarS(SInt* out) {
         const unsigned numBits = sizeof(SInt) * CHAR_BIT;
         const unsigned remainderBits = numBits % 7;
         const unsigned numBitsInSevens = numBits - remainderBits;
         SInt s = 0;
         uint8_t byte;
         unsigned shift = 0;
         do {
             if (!readFixedU8(&byte))
@@ -608,58 +608,58 @@ class Decoder
     }
     size_t currentOffset() const {
         return cur_ - beg_;
     }
 
     // Fixed-size encoding operations simply copy the literal bytes (without
     // attempting to align).
 
-    MOZ_WARN_UNUSED_RESULT bool readFixedU8(uint8_t* i) {
+    MOZ_MUST_USE bool readFixedU8(uint8_t* i) {
         return read<uint8_t>(i);
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedU32(uint32_t* u) {
+    MOZ_MUST_USE bool readFixedU32(uint32_t* u) {
         return read<uint32_t>(u);
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF32(float* f) {
+    MOZ_MUST_USE bool readFixedF32(float* f) {
         return read<float>(f);
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF64(double* d) {
+    MOZ_MUST_USE bool readFixedF64(double* d) {
         return read<double>(d);
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedI32x4(I32x4* i32x4) {
+    MOZ_MUST_USE bool readFixedI32x4(I32x4* i32x4) {
         return read<I32x4>(i32x4);
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF32x4(F32x4* f32x4) {
+    MOZ_MUST_USE bool readFixedF32x4(F32x4* f32x4) {
         return read<F32x4>(f32x4);
     }
 
     // Variable-length encodings that all use LEB128.
 
-    MOZ_WARN_UNUSED_RESULT bool readVarU32(uint32_t* out) {
+    MOZ_MUST_USE bool readVarU32(uint32_t* out) {
         return readVarU<uint32_t>(out);
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarS32(int32_t* out) {
+    MOZ_MUST_USE bool readVarS32(int32_t* out) {
         return readVarS<int32_t>(out);
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarU64(uint64_t* out) {
+    MOZ_MUST_USE bool readVarU64(uint64_t* out) {
         return readVarU<uint64_t>(out);
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarS64(int64_t* out) {
+    MOZ_MUST_USE bool readVarS64(int64_t* out) {
         return readVarS<int64_t>(out);
     }
-    MOZ_WARN_UNUSED_RESULT bool readValType(ValType* type) {
+    MOZ_MUST_USE bool readValType(ValType* type) {
         static_assert(uint8_t(ValType::Limit) <= INT8_MAX, "fits");
         uint8_t u8;
         if (!readFixedU8(&u8))
             return false;
         *type = (ValType)u8;
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readExpr(Expr* expr) {
+    MOZ_MUST_USE bool readExpr(Expr* expr) {
         static_assert(size_t(Expr::Limit) <= ExprLimit, "fits");
         uint8_t u8;
         if (!readFixedU8(&u8))
             return false;
         if (u8 != UINT8_MAX) {
             *expr = Expr(u8);
             return true;
         }
@@ -668,43 +668,43 @@ class Decoder
         if (u8 == UINT8_MAX)
             return false;
         *expr = Expr(u8 + UINT8_MAX);
         return true;
     }
 
     // See writeBytes comment.
 
-    MOZ_WARN_UNUSED_RESULT bool readBytes(Bytes* bytes) {
+    MOZ_MUST_USE bool readBytes(Bytes* bytes) {
         uint32_t numBytes;
         if (!readVarU32(&numBytes))
             return false;
         if (bytesRemain() < numBytes)
             return false;
         if (!bytes->resize(numBytes))
             return false;
         memcpy(bytes->begin(), cur_, numBytes);
         cur_ += numBytes;
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readBytesRaw(uint32_t numBytes, const uint8_t** bytes) {
+    MOZ_MUST_USE bool readBytesRaw(uint32_t numBytes, const uint8_t** bytes) {
         if (bytes)
             *bytes = cur_;
         if (bytesRemain() < numBytes)
             return false;
         cur_ += numBytes;
         return true;
     }
 
     // See "section" description in Encoder.
 
     static const uint32_t NotStarted = UINT32_MAX;
 
     template <size_t IdSizeWith0>
-    MOZ_WARN_UNUSED_RESULT bool startSection(const char (&id)[IdSizeWith0], uint32_t* startOffset,
+    MOZ_MUST_USE bool startSection(const char (&id)[IdSizeWith0], uint32_t* startOffset,
                                              uint32_t* size) {
         static const size_t IdSize = IdSizeWith0 - 1;
         MOZ_ASSERT(id[IdSize] == '\0');
         const uint8_t* before = cur_;
         uint32_t idSize;
         if (!readVarU32(&idSize))
             goto backup;
         if (bytesRemain() < idSize)
@@ -718,20 +718,20 @@ class Decoder
             return false;
         *startOffset = cur_ - beg_;
         return true;
       backup:
         cur_ = before;
         *startOffset = NotStarted;
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool finishSection(uint32_t startOffset, uint32_t size) {
+    MOZ_MUST_USE bool finishSection(uint32_t startOffset, uint32_t size) {
         return size == (cur_ - beg_) - startOffset;
     }
-    MOZ_WARN_UNUSED_RESULT bool skipSection() {
+    MOZ_MUST_USE bool skipSection() {
         uint32_t idSize;
         if (!readVarU32(&idSize) || bytesRemain() < idSize)
             return false;
         cur_ += idSize;
         uint32_t size;
         if (!readVarU32(&size) || bytesRemain() < size)
             return false;
         cur_ += size;
--- a/js/src/asmjs/WasmBinaryIterator.h
+++ b/js/src/asmjs/WasmBinaryIterator.h
@@ -500,88 +500,88 @@ class ExprIter : private Policy
 
     ExprRecord u_;
 
 #ifdef DEBUG
     Expr expr_;
     bool isInitialized_;
 #endif
 
-    MOZ_WARN_UNUSED_RESULT bool readFixedU8(uint8_t* out) {
+    MOZ_MUST_USE bool readFixedU8(uint8_t* out) {
         if (Validate)
             return d_.readFixedU8(out);
         *out = d_.uncheckedReadFixedU8();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedU32(uint32_t* out) {
+    MOZ_MUST_USE bool readFixedU32(uint32_t* out) {
         if (Validate)
             return d_.readFixedU32(out);
         *out = d_.uncheckedReadFixedU32();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarS32(int32_t* out) {
+    MOZ_MUST_USE bool readVarS32(int32_t* out) {
         if (Validate)
             return d_.readVarS32(out);
         *out = d_.uncheckedReadVarS32();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarU32(uint32_t* out) {
+    MOZ_MUST_USE bool readVarU32(uint32_t* out) {
         if (Validate)
             return d_.readVarU32(out);
         *out = d_.uncheckedReadVarU32();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarS64(int64_t* out) {
+    MOZ_MUST_USE bool readVarS64(int64_t* out) {
         if (Validate)
             return d_.readVarS64(out);
         *out = d_.uncheckedReadVarS64();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readVarU64(uint64_t* out) {
+    MOZ_MUST_USE bool readVarU64(uint64_t* out) {
         if (Validate)
             return d_.readVarU64(out);
         *out = d_.uncheckedReadVarU64();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF32(float* out) {
+    MOZ_MUST_USE bool readFixedF32(float* out) {
         if (Validate)
             return d_.readFixedF32(out);
         *out = d_.uncheckedReadFixedF32();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF64(double* out) {
+    MOZ_MUST_USE bool readFixedF64(double* out) {
         if (Validate)
             return d_.readFixedF64(out);
         *out = d_.uncheckedReadFixedF64();
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedI32x4(I32x4* out) {
+    MOZ_MUST_USE bool readFixedI32x4(I32x4* out) {
         if (Validate)
             return d_.readFixedI32x4(out);
         d_.uncheckedReadFixedI32x4(out);
         return true;
     }
-    MOZ_WARN_UNUSED_RESULT bool readFixedF32x4(F32x4* out) {
+    MOZ_MUST_USE bool readFixedF32x4(F32x4* out) {
         if (Validate)
             return d_.readFixedF32x4(out);
         d_.uncheckedReadFixedF32x4(out);
         return true;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool readAtomicViewType(Scalar::Type* viewType) {
+    MOZ_MUST_USE bool readAtomicViewType(Scalar::Type* viewType) {
         uint8_t x;
         if (!readFixedU8(&x))
             return false;
         if (Validate && x >= Scalar::MaxTypedArrayViewType)
             return fail("invalid atomic view type");
         *viewType = Scalar::Type(x);
         return true;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool readAtomicBinOpOp(jit::AtomicOp* op) {
+    MOZ_MUST_USE bool readAtomicBinOpOp(jit::AtomicOp* op) {
         uint8_t x;
         if (!readFixedU8(&x))
             return false;
         if (Validate) {
             switch (x) {
               case jit::AtomicFetchAddOp:
               case jit::AtomicFetchSubOp:
               case jit::AtomicFetchAndOp:
@@ -817,68 +817,68 @@ class ExprIter : private Policy
     bool setInitialized() {
         isInitialized_ = true;
         return true;
     }
 #else
     bool setInitialized() { return true; }
 #endif
 
-    MOZ_WARN_UNUSED_RESULT bool typeMismatch(ExprType actual, ExprType expected) MOZ_COLD;
-    MOZ_WARN_UNUSED_RESULT bool checkType(ExprType actual, ExprType expected);
-    MOZ_WARN_UNUSED_RESULT bool readFunctionReturnValue(ExprType ret);
-    MOZ_WARN_UNUSED_RESULT bool checkBranch(uint32_t relativeDepth, ExprType type);
-    MOZ_WARN_UNUSED_RESULT bool pushControl(LabelKind kind);
-    MOZ_WARN_UNUSED_RESULT bool popControl(LabelKind* kind, ExprType* type, Value* value);
-    MOZ_WARN_UNUSED_RESULT bool popControlAfterCheck(LabelKind* kind, ExprType* type, Value* value);
-    MOZ_WARN_UNUSED_RESULT bool push(ExprType t) { return valueStack_.emplaceBack(t); }
-    MOZ_WARN_UNUSED_RESULT bool push(TypeAndValue<Value> tv) { return valueStack_.append(tv); }
-    MOZ_WARN_UNUSED_RESULT bool readLinearMemoryAddress(uint32_t byteSize, LinearMemoryAddress<Value>* addr);
+    MOZ_MUST_USE bool typeMismatch(ExprType actual, ExprType expected) MOZ_COLD;
+    MOZ_MUST_USE bool checkType(ExprType actual, ExprType expected);
+    MOZ_MUST_USE bool readFunctionReturnValue(ExprType ret);
+    MOZ_MUST_USE bool checkBranch(uint32_t relativeDepth, ExprType type);
+    MOZ_MUST_USE bool pushControl(LabelKind kind);
+    MOZ_MUST_USE bool popControl(LabelKind* kind, ExprType* type, Value* value);
+    MOZ_MUST_USE bool popControlAfterCheck(LabelKind* kind, ExprType* type, Value* value);
+    MOZ_MUST_USE bool push(ExprType t) { return valueStack_.emplaceBack(t); }
+    MOZ_MUST_USE bool push(TypeAndValue<Value> tv) { return valueStack_.append(tv); }
+    MOZ_MUST_USE bool readLinearMemoryAddress(uint32_t byteSize, LinearMemoryAddress<Value>* addr);
 
     void infallibleCheckSuccessor(ControlStackEntry<ControlItem>& controlItem, ExprType type);
     void infalliblePush(ExprType t) { valueStack_.infallibleEmplaceBack(t); }
     void infalliblePush(TypeAndValue<Value> tv) { valueStack_.infallibleAppend(tv); }
 
     // Test whether reading the top of the value stack is currently valid.
-    MOZ_WARN_UNUSED_RESULT bool checkTop() {
+    MOZ_MUST_USE bool checkTop() {
         if (Validate && valueStack_.length() <= controlStack_.back().valueStackStart())
             return fail("popping value from outside block");
         return true;
     }
 
     // Pop the top of the value stack.
-    MOZ_WARN_UNUSED_RESULT bool pop(TypeAndValue<Value>* tv) {
+    MOZ_MUST_USE bool pop(TypeAndValue<Value>* tv) {
         if (!checkTop())
             return false;
         *tv = valueStack_.popCopy();
         return true;
     }
 
     // Pop the top of the value stack and check that it has the given type.
-    MOZ_WARN_UNUSED_RESULT bool popWithType(ExprType expectedType, Value* value) {
+    MOZ_MUST_USE bool popWithType(ExprType expectedType, Value* value) {
         if (!checkTop())
             return false;
         TypeAndValue<Value> tv = valueStack_.popCopy();
         if (!checkType(tv.type(), expectedType))
             return false;
         *value = tv.value();
         return true;
     }
 
     // Read the top of the value stack (without popping it).
-    MOZ_WARN_UNUSED_RESULT bool top(TypeAndValue<Value>* tv) {
+    MOZ_MUST_USE bool top(TypeAndValue<Value>* tv) {
         if (!checkTop())
             return false;
         *tv = valueStack_.back();
         return true;
     }
 
     // Read the top of the value stack (without popping it) and check that it
     // has the given type.
-    MOZ_WARN_UNUSED_RESULT bool topWithType(ExprType expectedType, Value* value) {
+    MOZ_MUST_USE bool topWithType(ExprType expectedType, Value* value) {
         if (!checkTop())
             return false;
         TypeAndValue<Value>& tv = valueStack_.back();
         if (!checkType(tv.type(), expectedType))
             return false;
         *value = tv.value();
         return true;
     }
@@ -903,87 +903,85 @@ class ExprIter : private Policy
 
     // Return the decoding byte offset.
     uint32_t currentOffset() const { return d_.currentOffset(); }
 
     // Test whether the iterator has reached the end of the buffer.
     bool done() const { return d_.done(); }
 
     // Report a general failure.
-    MOZ_WARN_UNUSED_RESULT bool fail(const char* msg) MOZ_COLD;
+    MOZ_MUST_USE bool fail(const char* msg) MOZ_COLD;
 
     // Report an unimplemented feature.
-    MOZ_WARN_UNUSED_RESULT
-    bool notYetImplemented(const char* what) MOZ_COLD;
+    MOZ_MUST_USE bool notYetImplemented(const char* what) MOZ_COLD;
 
     // Report an unrecognized opcode.
-    MOZ_WARN_UNUSED_RESULT
-    bool unrecognizedOpcode(Expr expr) MOZ_COLD;
+    MOZ_MUST_USE bool unrecognizedOpcode(Expr expr) MOZ_COLD;
 
     // ------------------------------------------------------------------------
     // Decoding and validation interface.
 
-    MOZ_WARN_UNUSED_RESULT bool readExpr(Expr* expr);
-    MOZ_WARN_UNUSED_RESULT bool readFunctionStart();
-    MOZ_WARN_UNUSED_RESULT bool readFunctionEnd(ExprType ret);
-    MOZ_WARN_UNUSED_RESULT bool readReturn();
-    MOZ_WARN_UNUSED_RESULT bool readBlock();
-    MOZ_WARN_UNUSED_RESULT bool readLoop();
-    MOZ_WARN_UNUSED_RESULT bool readIf();
-    MOZ_WARN_UNUSED_RESULT bool readElse();
-    MOZ_WARN_UNUSED_RESULT bool readEnd();
-    MOZ_WARN_UNUSED_RESULT bool readBr();
-    MOZ_WARN_UNUSED_RESULT bool readBrIf();
-    MOZ_WARN_UNUSED_RESULT bool readBrTable();
-    MOZ_WARN_UNUSED_RESULT bool readBrTableEntry(ExprType type, uint32_t* depth);
-    MOZ_WARN_UNUSED_RESULT bool readUnreachable();
-    MOZ_WARN_UNUSED_RESULT bool readUnary(ValType operandType);
-    MOZ_WARN_UNUSED_RESULT bool readConversion(ValType operandType, ValType resultType);
-    MOZ_WARN_UNUSED_RESULT bool readBinary(ValType operandType);
-    MOZ_WARN_UNUSED_RESULT bool readComparison(ValType operandType);
-    MOZ_WARN_UNUSED_RESULT bool readLoad(ValType resultType, uint32_t byteSize);
-    MOZ_WARN_UNUSED_RESULT bool readStore(ValType resultType, uint32_t byteSize);
-    MOZ_WARN_UNUSED_RESULT bool readTrivial();
-    MOZ_WARN_UNUSED_RESULT bool readSelect();
-    MOZ_WARN_UNUSED_RESULT bool readGetLocal(const ValTypeVector& locals);
-    MOZ_WARN_UNUSED_RESULT bool readSetLocal(const ValTypeVector& locals);
-    MOZ_WARN_UNUSED_RESULT bool readGetGlobal(const GlobalDescVector& globals);
-    MOZ_WARN_UNUSED_RESULT bool readSetGlobal(const GlobalDescVector& globals);
-    MOZ_WARN_UNUSED_RESULT bool readI32Const();
-    MOZ_WARN_UNUSED_RESULT bool readI64Const();
-    MOZ_WARN_UNUSED_RESULT bool readF32Const();
-    MOZ_WARN_UNUSED_RESULT bool readF64Const();
-    MOZ_WARN_UNUSED_RESULT bool readI32x4Const();
-    MOZ_WARN_UNUSED_RESULT bool readF32x4Const();
-    MOZ_WARN_UNUSED_RESULT bool readB32x4Const();
-    MOZ_WARN_UNUSED_RESULT bool readCall();
-    MOZ_WARN_UNUSED_RESULT bool readCallIndirect();
-    MOZ_WARN_UNUSED_RESULT bool readCallImport();
-    MOZ_WARN_UNUSED_RESULT bool readCallArg(ValType type, uint32_t numArgs, uint32_t argIndex, Value* arg);
-    MOZ_WARN_UNUSED_RESULT bool readCallArgsEnd(uint32_t numArgs);
-    MOZ_WARN_UNUSED_RESULT bool readCallIndirectCallee(Value* callee);
-    MOZ_WARN_UNUSED_RESULT bool readCallReturn(ExprType ret);
-    MOZ_WARN_UNUSED_RESULT bool readAtomicLoad();
-    MOZ_WARN_UNUSED_RESULT bool readAtomicStore();
-    MOZ_WARN_UNUSED_RESULT bool readAtomicBinOp();
-    MOZ_WARN_UNUSED_RESULT bool readAtomicCompareExchange();
-    MOZ_WARN_UNUSED_RESULT bool readAtomicExchange();
-    MOZ_WARN_UNUSED_RESULT bool readSimdComparison(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSimdShiftByScalar(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSimdBooleanReduction(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readExtractLane(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readReplaceLane(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSplat(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSwizzle(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readShuffle(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSimdSelect(ValType simdType);
-    MOZ_WARN_UNUSED_RESULT bool readSimdCtor();
-    MOZ_WARN_UNUSED_RESULT bool readSimdCtorArg(ValType elementType, uint32_t numElements, uint32_t argIndex, Value* arg);
-    MOZ_WARN_UNUSED_RESULT bool readSimdCtorArgsEnd(uint32_t numElements);
-    MOZ_WARN_UNUSED_RESULT bool readSimdCtorReturn(ValType simdType);
+    MOZ_MUST_USE bool readExpr(Expr* expr);
+    MOZ_MUST_USE bool readFunctionStart();
+    MOZ_MUST_USE bool readFunctionEnd(ExprType ret);
+    MOZ_MUST_USE bool readReturn();
+    MOZ_MUST_USE bool readBlock();
+    MOZ_MUST_USE bool readLoop();
+    MOZ_MUST_USE bool readIf();
+    MOZ_MUST_USE bool readElse();
+    MOZ_MUST_USE bool readEnd();
+    MOZ_MUST_USE bool readBr();
+    MOZ_MUST_USE bool readBrIf();
+    MOZ_MUST_USE bool readBrTable();
+    MOZ_MUST_USE bool readBrTableEntry(ExprType type, uint32_t* depth);
+    MOZ_MUST_USE bool readUnreachable();
+    MOZ_MUST_USE bool readUnary(ValType operandType);
+    MOZ_MUST_USE bool readConversion(ValType operandType, ValType resultType);
+    MOZ_MUST_USE bool readBinary(ValType operandType);
+    MOZ_MUST_USE bool readComparison(ValType operandType);
+    MOZ_MUST_USE bool readLoad(ValType resultType, uint32_t byteSize);
+    MOZ_MUST_USE bool readStore(ValType resultType, uint32_t byteSize);
+    MOZ_MUST_USE bool readTrivial();
+    MOZ_MUST_USE bool readSelect();
+    MOZ_MUST_USE bool readGetLocal(const ValTypeVector& locals);
+    MOZ_MUST_USE bool readSetLocal(const ValTypeVector& locals);
+    MOZ_MUST_USE bool readGetGlobal(const GlobalDescVector& globals);
+    MOZ_MUST_USE bool readSetGlobal(const GlobalDescVector& globals);
+    MOZ_MUST_USE bool readI32Const();
+    MOZ_MUST_USE bool readI64Const();
+    MOZ_MUST_USE bool readF32Const();
+    MOZ_MUST_USE bool readF64Const();
+    MOZ_MUST_USE bool readI32x4Const();
+    MOZ_MUST_USE bool readF32x4Const();
+    MOZ_MUST_USE bool readB32x4Const();
+    MOZ_MUST_USE bool readCall();
+    MOZ_MUST_USE bool readCallIndirect();
+    MOZ_MUST_USE bool readCallImport();
+    MOZ_MUST_USE bool readCallArg(ValType type, uint32_t numArgs, uint32_t argIndex, Value* arg);
+    MOZ_MUST_USE bool readCallArgsEnd(uint32_t numArgs);
+    MOZ_MUST_USE bool readCallIndirectCallee(Value* callee);
+    MOZ_MUST_USE bool readCallReturn(ExprType ret);
+    MOZ_MUST_USE bool readAtomicLoad();
+    MOZ_MUST_USE bool readAtomicStore();
+    MOZ_MUST_USE bool readAtomicBinOp();
+    MOZ_MUST_USE bool readAtomicCompareExchange();
+    MOZ_MUST_USE bool readAtomicExchange();
+    MOZ_MUST_USE bool readSimdComparison(ValType simdType);
+    MOZ_MUST_USE bool readSimdShiftByScalar(ValType simdType);
+    MOZ_MUST_USE bool readSimdBooleanReduction(ValType simdType);
+    MOZ_MUST_USE bool readExtractLane(ValType simdType);
+    MOZ_MUST_USE bool readReplaceLane(ValType simdType);
+    MOZ_MUST_USE bool readSplat(ValType simdType);
+    MOZ_MUST_USE bool readSwizzle(ValType simdType);
+    MOZ_MUST_USE bool readShuffle(ValType simdType);
+    MOZ_MUST_USE bool readSimdSelect(ValType simdType);
+    MOZ_MUST_USE bool readSimdCtor();
+    MOZ_MUST_USE bool readSimdCtorArg(ValType elementType, uint32_t numElements, uint32_t argIndex, Value* arg);
+    MOZ_MUST_USE bool readSimdCtorArgsEnd(uint32_t numElements);
+    MOZ_MUST_USE bool readSimdCtorReturn(ValType simdType);
 
     // ------------------------------------------------------------------------
     // Translation interface. These methods provide the information obtained
     // through decoding.
 
     int32_t                     i32()     const { MOZ_ASSERT(isI32());     return u_.i32; }
     int64_t                     i64()     const { MOZ_ASSERT(isI64());     return u_.i64; }
     float                       f32()     const { MOZ_ASSERT(isF32());     return u_.f32; }
@@ -1057,17 +1055,17 @@ ExprIter<Policy>::typeMismatch(ExprType 
                                   ToCString(actual), ToCString(expected)));
     if (!error)
         return false;
 
     return fail(error.get());
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::checkType(ExprType actual, ExprType expected)
 {
     if (!Validate) {
         MOZ_ASSERT(actual == AnyType || actual == expected, "type mismatch");
         return true;
     }
 
     if (MOZ_LIKELY(actual == AnyType || actual == expected))
@@ -1693,87 +1691,87 @@ ExprIter<Policy>::readSetGlobal(const Gl
     if (!topWithType(ToExprType(globals[id].type), &value))
         return false;
 
     u_.setVar = SetVarRecord<Value>(id, value);
     return setInitialized();
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readI32Const()
 {
     return readVarS32(&u_.i32) &&
            setInitialized() &&
            push(ExprType::I32);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readI64Const()
 {
     return readVarS64(&u_.i64) &&
            setInitialized() &&
            push(ExprType::I64);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readF32Const()
 {
     if (!readFixedF32(&u_.f32))
         return false;
 
     if (Validate && mozilla::IsNaN(u_.f32)) {
         const float jsNaN = (float)JS::GenericNaN();
         if (memcmp(&u_.f32, &jsNaN, sizeof(u_.f32)) != 0)
             return notYetImplemented("NaN literals with custom payloads");
     }
 
     return setInitialized() &&
            push(ExprType::F32);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readF64Const()
 {
     if (!readFixedF64(&u_.f64))
        return false;
 
     if (Validate && mozilla::IsNaN(u_.f64)) {
         const double jsNaN = JS::GenericNaN();
         if (memcmp(&u_.f64, &jsNaN, sizeof(u_.f64)) != 0)
             return notYetImplemented("NaN literals with custom payloads");
     }
 
     return setInitialized() &&
            push(ExprType::F64);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readI32x4Const()
 {
     return readFixedI32x4(&u_.i32x4) &&
            setInitialized() &&
            push(ExprType::I32x4);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readF32x4Const()
 {
     return readFixedF32x4(&u_.f32x4) &&
            setInitialized() &&
            push(ExprType::F32x4);
 }
 
 template <typename Policy>
-inline MOZ_WARN_UNUSED_RESULT bool
+inline MOZ_MUST_USE bool
 ExprIter<Policy>::readB32x4Const()
 {
     return readFixedI32x4(&u_.i32x4) &&
            setInitialized() &&
            push(ExprType::B32x4);
 }
 
 template <typename Policy>
--- a/js/src/asmjs/WasmModule.h
+++ b/js/src/asmjs/WasmModule.h
@@ -496,17 +496,17 @@ class Module : public mozilla::LinkedLis
     Bytes                        source_;
 
     uint8_t* rawHeapPtr() const;
     uint8_t*& rawHeapPtr();
     WasmActivation*& activation();
     void specializeToHeap(ArrayBufferObjectMaybeShared* heap);
     void despecializeFromHeap(ArrayBufferObjectMaybeShared* heap);
     bool sendCodeRangesToProfiler(JSContext* cx);
-    MOZ_WARN_UNUSED_RESULT bool setProfilingEnabled(JSContext* cx, bool enabled);
+    MOZ_MUST_USE bool setProfilingEnabled(JSContext* cx, bool enabled);
     ImportExit& importToExit(const Import& import);
 
     friend class js::WasmActivation;
 
   protected:
     const ModuleData& base() const { return *module_; }
     bool clone(JSContext* cx, const StaticLinkData& link, Module* clone) const;
 
--- a/js/src/ds/OrderedHashTable.h
+++ b/js/src/ds/OrderedHashTable.h
@@ -735,27 +735,27 @@ class OrderedHashMap
 
     typedef detail::OrderedHashTable<Entry, MapOps, AllocPolicy> Impl;
     Impl impl;
 
   public:
     typedef typename Impl::Range Range;
 
     explicit OrderedHashMap(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
-    MOZ_WARN_UNUSED_RESULT bool init()              { return impl.init(); }
+    MOZ_MUST_USE bool init()                        { return impl.init(); }
     uint32_t count() const                          { return impl.count(); }
     bool has(const Key& key) const                  { return impl.has(key); }
     Range all()                                     { return impl.all(); }
     const Entry* get(const Key& key) const          { return impl.get(key); }
     Entry* get(const Key& key)                      { return impl.get(key); }
     bool remove(const Key& key, bool* foundp)       { return impl.remove(key, foundp); }
-    MOZ_WARN_UNUSED_RESULT bool clear()             { return impl.clear(); }
+    MOZ_MUST_USE bool clear()                       { return impl.clear(); }
 
     template <typename V>
-    MOZ_WARN_UNUSED_RESULT bool put(const Key& key, V&& value) {
+    MOZ_MUST_USE bool put(const Key& key, V&& value) {
         return impl.put(Entry(key, Forward<V>(value)));
     }
 
     void rekeyOneEntry(const Key& current, const Key& newKey) {
         const Entry* e = get(current);
         if (!e)
             return;
         return impl.rekeyOneEntry(current, newKey, Entry(newKey, e->value));
@@ -787,23 +787,23 @@ class OrderedHashSet
 
     typedef detail::OrderedHashTable<T, SetOps, AllocPolicy> Impl;
     Impl impl;
 
   public:
     typedef typename Impl::Range Range;
 
     explicit OrderedHashSet(AllocPolicy ap = AllocPolicy()) : impl(ap) {}
-    MOZ_WARN_UNUSED_RESULT bool init()              { return impl.init(); }
+    MOZ_MUST_USE bool init()                        { return impl.init(); }
     uint32_t count() const                          { return impl.count(); }
     bool has(const T& value) const                  { return impl.has(value); }
     Range all()                                     { return impl.all(); }
-    MOZ_WARN_UNUSED_RESULT bool put(const T& value) { return impl.put(value); }
+    MOZ_MUST_USE bool put(const T& value)           { return impl.put(value); }
     bool remove(const T& value, bool* foundp)       { return impl.remove(value, foundp); }
-    MOZ_WARN_UNUSED_RESULT bool clear()             { return impl.clear(); }
+    MOZ_MUST_USE bool clear()                       { return impl.clear(); }
 
     void rekeyOneEntry(const T& current, const T& newKey) {
         return impl.rekeyOneEntry(current, newKey, newKey);
     }
 };
 
 }  // namespace js
 
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -861,21 +861,21 @@ class FullParseHandler
     }
     void setFlag(ParseNode* pn, unsigned flag) {
         pn->pn_dflags |= flag;
     }
     void setListFlag(ParseNode* pn, unsigned flag) {
         MOZ_ASSERT(pn->isArity(PN_LIST));
         pn->pn_xflags |= flag;
     }
-    MOZ_WARN_UNUSED_RESULT ParseNode* parenthesize(ParseNode* pn) {
+    MOZ_MUST_USE ParseNode* parenthesize(ParseNode* pn) {
         pn->setInParens(true);
         return pn;
     }
-    MOZ_WARN_UNUSED_RESULT ParseNode* setLikelyIIFE(ParseNode* pn) {
+    MOZ_MUST_USE ParseNode* setLikelyIIFE(ParseNode* pn) {
         return parenthesize(pn);
     }
     void setPrologue(ParseNode* pn) {
         pn->pn_prologue = true;
     }
 
     bool isConstant(ParseNode* pn) {
         return pn->isConstant();
--- a/js/src/frontend/SyntaxParseHandler.h
+++ b/js/src/frontend/SyntaxParseHandler.h
@@ -497,17 +497,17 @@ class SyntaxParseHandler
     bool isSuperBase(Node pn) {
         return pn == NodeSuperBase;
     }
 
     void setOp(Node pn, JSOp op) {}
     void setBlockId(Node pn, unsigned blockid) {}
     void setFlag(Node pn, unsigned flag) {}
     void setListFlag(Node pn, unsigned flag) {}
-    MOZ_WARN_UNUSED_RESULT Node parenthesize(Node node) {
+    MOZ_MUST_USE Node parenthesize(Node node) {
         // A number of nodes have different behavior upon parenthesization, but
         // only in some circumstances.  Convert these nodes to special
         // parenthesized forms.
         if (node == NodeUnparenthesizedArgumentsName)
             return NodeParenthesizedArgumentsName;
         if (node == NodeUnparenthesizedEvalName)
             return NodeParenthesizedEvalName;
         if (node == NodeUnparenthesizedName)
@@ -526,17 +526,17 @@ class SyntaxParseHandler
         {
             return NodeGeneric;
         }
 
         // In all other cases, the parenthesized form of |node| is equivalent
         // to the unparenthesized form: return |node| unchanged.
         return node;
     }
-    MOZ_WARN_UNUSED_RESULT Node setLikelyIIFE(Node pn) {
+    MOZ_MUST_USE Node setLikelyIIFE(Node pn) {
         return pn; // Remain in syntax-parse mode.
     }
     void setPrologue(Node pn) {}
 
     bool isConstant(Node pn) { return false; }
 
     bool isUnparenthesizedName(Node node) {
         return node == NodeUnparenthesizedArgumentsName ||
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -122,17 +122,17 @@ namespace JS {
 // We always guarantee that a zone has at least one live compartment by refusing
 // to delete the last compartment in a live zone.
 struct Zone : public JS::shadow::Zone,
               public js::gc::GraphNodeBase<JS::Zone>,
               public js::MallocProvider<JS::Zone>
 {
     explicit Zone(JSRuntime* rt);
     ~Zone();
-    MOZ_WARN_UNUSED_RESULT bool init(bool isSystem);
+    MOZ_MUST_USE bool init(bool isSystem);
 
     void findOutgoingEdges(js::gc::ComponentFinder<JS::Zone>& finder);
 
     void discardJitCode(js::FreeOp* fop);
 
     void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
                                 size_t* typePool,
                                 size_t* baselineStubsOptimized,
@@ -146,17 +146,17 @@ struct Zone : public JS::shadow::Zone,
         gcMallocBytes -= ptrdiff_t(nbytes);
         if (MOZ_UNLIKELY(isTooMuchMalloc()))
             onTooMuchMalloc();
     }
 
     bool isTooMuchMalloc() const { return gcMallocBytes <= 0; }
     void onTooMuchMalloc();
 
-    MOZ_WARN_UNUSED_RESULT void* onOutOfMemory(js::AllocFunction allocFunc, size_t nbytes,
+    MOZ_MUST_USE void* onOutOfMemory(js::AllocFunction allocFunc, size_t nbytes,
                                                void* reallocPtr = nullptr) {
         if (!js::CurrentThreadCanAccessRuntime(runtime_))
             return nullptr;
         return runtimeFromMainThread()->onOutOfMemory(allocFunc, nbytes, reallocPtr);
     }
     void reportAllocationOverflow() { js::ReportAllocationOverflow(nullptr); }
 
     void beginSweepTypes(js::FreeOp* fop, bool releaseTypes);
@@ -375,27 +375,27 @@ struct Zone : public JS::shadow::Zone,
     unsigned gcLastZoneGroupIndex;
 #endif
 
     static js::HashNumber UniqueIdToHash(uint64_t uid) {
         return js::HashNumber(uid >> 32) ^ js::HashNumber(uid & 0xFFFFFFFF);
     }
 
     // Creates a HashNumber based on getUniqueId. Returns false on OOM.
-    MOZ_WARN_UNUSED_RESULT bool getHashCode(js::gc::Cell* cell, js::HashNumber* hashp) {
+    MOZ_MUST_USE bool getHashCode(js::gc::Cell* cell, js::HashNumber* hashp) {
         uint64_t uid;
         if (!getUniqueId(cell, &uid))
             return false;
         *hashp = UniqueIdToHash(uid);
         return true;
     }
 
     // Puts an existing UID in |uidp|, or creates a new UID for this Cell and
     // puts that into |uidp|. Returns false on OOM.
-    MOZ_WARN_UNUSED_RESULT bool getUniqueId(js::gc::Cell* cell, uint64_t* uidp) {
+    MOZ_MUST_USE bool getUniqueId(js::gc::Cell* cell, uint64_t* uidp) {
         MOZ_ASSERT(uidp);
         MOZ_ASSERT(js::CurrentThreadCanAccessZone(this));
 
         // Get an existing uid, if one has been set.
         auto p = uniqueIds_.lookupForAdd(cell);
         if (p) {
             *uidp = p->value();
             return true;
@@ -420,17 +420,17 @@ struct Zone : public JS::shadow::Zone,
         uint64_t uid;
         js::AutoEnterOOMUnsafeRegion oomUnsafe;
         if (!getUniqueId(cell, &uid))
             oomUnsafe.crash("failed to allocate uid");
         return uid;
     }
 
     // Return true if this cell has a UID associated with it.
-    MOZ_WARN_UNUSED_RESULT bool hasUniqueId(js::gc::Cell* cell) {
+    MOZ_MUST_USE bool hasUniqueId(js::gc::Cell* cell) {
         MOZ_ASSERT(js::CurrentThreadCanAccessZone(this));
         return uniqueIds_.has(cell);
     }
 
     // Transfer an id from another cell. This must only be called on behalf of a
     // moving GC. This method is infallible.
     void transferUniqueId(js::gc::Cell* tgt, js::gc::Cell* src) {
         MOZ_ASSERT(src != tgt);
--- a/js/src/irregexp/RegExpEngine.h
+++ b/js/src/irregexp/RegExpEngine.h
@@ -125,17 +125,17 @@ InterpretCode(JSContext* cx, const uint8
   VISIT(Text)
 
 #define FORWARD_DECLARE(Name) class RegExp##Name;
 FOR_EACH_REG_EXP_TREE_TYPE(FORWARD_DECLARE)
 #undef FORWARD_DECLARE
 
 // InfallibleVector is like Vector, but all its methods are infallible (they
 // crash on OOM). We use this class instead of Vector to avoid a ton of
-// MOZ_WARN_UNUSED_RESULT warnings in irregexp code (imported from V8).
+// MOZ_MUST_USE warnings in irregexp code (imported from V8).
 template<typename T, size_t N>
 class InfallibleVector
 {
     Vector<T, N, LifoAllocPolicy<Infallible>> vector_;
 
     InfallibleVector(const InfallibleVector&) = delete;
     void operator=(const InfallibleVector&) = delete;
 
--- a/js/src/jit/BaselineCacheIR.cpp
+++ b/js/src/jit/BaselineCacheIR.cpp
@@ -164,17 +164,17 @@ class MOZ_RAII CacheRegisterAllocator
     friend class AutoScratchRegister;
 
     explicit CacheRegisterAllocator(const CacheIRWriter& writer)
       : stackPushed_(0),
         currentInstruction_(0),
         writer_(writer)
     {}
 
-    MOZ_WARN_UNUSED_RESULT bool init(const AllocatableGeneralRegisterSet& available) {
+    MOZ_MUST_USE bool init(const AllocatableGeneralRegisterSet& available) {
         availableRegs_ = available;
         if (!origInputLocations_.resize(writer_.numInputOperands()))
             return false;
         if (!operandLocations_.resize(writer_.numOperandIds()))
             return false;
         return true;
     }
 
@@ -390,22 +390,22 @@ class MOZ_RAII BaselineCacheIRCompiler :
     uint32_t stubDataOffset_;
 
   public:
     BaselineCacheIRCompiler(JSContext* cx, const CacheIRWriter& writer, uint32_t stubDataOffset)
       : CacheIRCompiler(cx, writer),
         stubDataOffset_(stubDataOffset)
     {}
 
-    MOZ_WARN_UNUSED_RESULT bool init(CacheKind kind);
+    MOZ_MUST_USE bool init(CacheKind kind);
 
     JitCode* compile();
 
   private:
-#define DEFINE_OP(op) MOZ_WARN_UNUSED_RESULT bool emit##op();
+#define DEFINE_OP(op) MOZ_MUST_USE bool emit##op();
     CACHE_IR_OPS(DEFINE_OP)
 #undef DEFINE_OP
 
     Address stubAddress(uint32_t offset) const {
         return Address(ICStubReg, stubDataOffset_ + offset * sizeof(uintptr_t));
     }
 
     bool addFailurePath(FailurePath** failure) {
--- a/js/src/jit/ExecutableAllocator.h
+++ b/js/src/jit/ExecutableAllocator.h
@@ -199,27 +199,27 @@ class ExecutableAllocator
     void* computeRandomAllocationAddress();
 
     ExecutablePool* createPool(size_t n);
     ExecutablePool* poolForSize(size_t n);
 
     static void reprotectPool(JSRuntime* rt, ExecutablePool* pool, ProtectionSetting protection);
 
   public:
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     static bool makeWritable(void* start, size_t size)
     {
 #ifdef NON_WRITABLE_JIT_CODE
         return reprotectRegion(start, size, Writable);
 #else
         return true;
 #endif
     }
 
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     static bool makeExecutable(void* start, size_t size)
     {
 #ifdef NON_WRITABLE_JIT_CODE
         return reprotectRegion(start, size, Executable);
 #else
         return true;
 #endif
     }
@@ -303,17 +303,17 @@ class ExecutableAllocator
     }
 #endif
 
   private:
     ExecutableAllocator(const ExecutableAllocator&) = delete;
     void operator=(const ExecutableAllocator&) = delete;
 
 #ifdef NON_WRITABLE_JIT_CODE
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     static bool reprotectRegion(void*, size_t, ProtectionSetting);
 #endif
 
     void reprotectAll(ProtectionSetting);
 
     // These are strong references;  they keep pools alive.
     static const size_t maxSmallPools = 4;
     typedef js::Vector<ExecutablePool*, maxSmallPools, js::SystemAllocPolicy> SmallExecPoolVector;
--- a/js/src/jit/FixedList.h
+++ b/js/src/jit/FixedList.h
@@ -27,17 +27,17 @@ class FixedList
     void operator= (const FixedList*); // no assignment definition.
 
   public:
     FixedList()
       : list_(nullptr), length_(0)
     { }
 
     // Dynamic memory allocation requires the ability to report failure.
-    MOZ_WARN_UNUSED_RESULT bool init(TempAllocator& alloc, size_t length) {
+    MOZ_MUST_USE bool init(TempAllocator& alloc, size_t length) {
         length_ = length;
         if (length == 0)
             return true;
 
         size_t bytes;
         if (MOZ_UNLIKELY(!CalculateAllocSize<T>(length, &bytes)))
             return false;
         list_ = (T*)alloc.allocate(bytes);
@@ -52,17 +52,17 @@ class FixedList
         return length_;
     }
 
     void shrink(size_t num) {
         MOZ_ASSERT(num < length_);
         length_ -= num;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool growBy(TempAllocator& alloc, size_t num) {
+    MOZ_MUST_USE bool growBy(TempAllocator& alloc, size_t num) {
         size_t newlength = length_ + num;
         if (newlength < length_)
             return false;
         size_t bytes;
         if (MOZ_UNLIKELY(!CalculateAllocSize<T>(newlength, &bytes)))
             return false;
         T* list = (T*)alloc.allocate(bytes);
         if (MOZ_UNLIKELY(!list))
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1216,17 +1216,17 @@ class MQuaternaryInstruction : public MA
 };
 
 template <class T>
 class MVariadicT : public T
 {
     FixedList<MUse> operands_;
 
   protected:
-    MOZ_WARN_UNUSED_RESULT bool init(TempAllocator& alloc, size_t length) {
+    MOZ_MUST_USE bool init(TempAllocator& alloc, size_t length) {
         return operands_.init(alloc, length);
     }
     void initOperand(size_t index, MDefinition* operand) {
         // FixedList doesn't initialize its elements, so do an unchecked init.
         operands_[index].initUnchecked(operand, this);
     }
     MUse* getUseFor(size_t index) final override {
         return &operands_[index];
@@ -2017,17 +2017,17 @@ class MSimdGeneralShuffle :
     INSTRUCTION_HEADER(SimdGeneralShuffle);
 
     static MSimdGeneralShuffle* New(TempAllocator& alloc, unsigned numVectors, unsigned numLanes,
                                     MIRType type)
     {
         return new(alloc) MSimdGeneralShuffle(numVectors, numLanes, type);
     }
 
-    MOZ_WARN_UNUSED_RESULT bool init(TempAllocator& alloc) {
+    MOZ_MUST_USE bool init(TempAllocator& alloc) {
         return MVariadicInstruction::init(alloc, numVectors_ + numLanes_);
     }
     void setVector(unsigned i, MDefinition* vec) {
         MOZ_ASSERT(i < numVectors_);
         initOperand(i, vec);
     }
     void setLane(unsigned i, MDefinition* laneIndex) {
         MOZ_ASSERT(i < numLanes_);
@@ -2661,17 +2661,17 @@ class MTableSwitch final
   public:
     INSTRUCTION_HEADER(TableSwitch)
     static MTableSwitch* New(TempAllocator& alloc, MDefinition* ins, int32_t low, int32_t high);
 
     size_t numSuccessors() const override {
         return successors_.length();
     }
 
-    MOZ_WARN_UNUSED_RESULT bool addSuccessor(MBasicBlock* successor, size_t* index) {
+    MOZ_MUST_USE bool addSuccessor(MBasicBlock* successor, size_t* index) {
         MOZ_ASSERT(successors_.length() < (size_t)(high_ - low_ + 2));
         MOZ_ASSERT(!successors_.empty());
         *index = successors_.length();
         return successors_.append(successor);
     }
 
     MBasicBlock* getSuccessor(size_t i) const override {
         MOZ_ASSERT(i < numSuccessors());
@@ -2706,33 +2706,33 @@ class MTableSwitch final
     MBasicBlock* getCase(size_t i) const {
         return getSuccessor(cases_[i]);
     }
 
     size_t numCases() const {
         return high() - low() + 1;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool addDefault(MBasicBlock* block, size_t* index = nullptr) {
+    MOZ_MUST_USE bool addDefault(MBasicBlock* block, size_t* index = nullptr) {
         MOZ_ASSERT(successors_.empty());
         if (index)
             *index = 0;
         return successors_.append(block);
     }
 
-    MOZ_WARN_UNUSED_RESULT bool addCase(size_t successorIndex) {
+    MOZ_MUST_USE bool addCase(size_t successorIndex) {
         return cases_.append(successorIndex);
     }
 
     MBasicBlock* getBlock(size_t i) const {
         MOZ_ASSERT(i < numBlocks());
         return blocks_[i];
     }
 
-    MOZ_WARN_UNUSED_RESULT bool addBlock(MBasicBlock* block) {
+    MOZ_MUST_USE bool addBlock(MBasicBlock* block) {
         return blocks_.append(block);
     }
 
     MDefinition* getOperand(size_t index) const override {
         MOZ_ASSERT(index == 0);
         return operand_.producer();
     }
 
@@ -3625,17 +3625,17 @@ class MArrayState
   : public MVariadicInstruction,
     public NoFloatPolicyAfter<2>::Data
 {
   private:
     uint32_t numElements_;
 
     explicit MArrayState(MDefinition* arr);
 
-    MOZ_WARN_UNUSED_RESULT bool init(TempAllocator& alloc, MDefinition* obj, MDefinition* len);
+    MOZ_MUST_USE bool init(TempAllocator& alloc, MDefinition* obj, MDefinition* len);
 
     void initElement(uint32_t index, MDefinition* def) {
         initOperand(index + 2, def);
     }
 
   public:
     INSTRUCTION_HEADER(ArrayState)
 
@@ -7344,32 +7344,32 @@ class MPhi final
         return getOperand(1);
     }
 
     // Whether this phi's type already includes information for def.
     bool typeIncludes(MDefinition* def);
 
     // Add types for this phi which speculate about new inputs that may come in
     // via a loop backedge.
-    MOZ_WARN_UNUSED_RESULT bool addBackedgeType(MIRType type, TemporaryTypeSet* typeSet);
+    MOZ_MUST_USE bool addBackedgeType(MIRType type, TemporaryTypeSet* typeSet);
 
     // Initializes the operands vector to the given capacity,
     // permitting use of addInput() instead of addInputSlow().
-    MOZ_WARN_UNUSED_RESULT bool reserveLength(size_t length) {
+    MOZ_MUST_USE bool reserveLength(size_t length) {
         return inputs_.reserve(length);
     }
 
     // Use only if capacity has been reserved by reserveLength
     void addInput(MDefinition* ins) {
         inputs_.infallibleEmplaceBack(ins, this);
     }
 
     // Appends a new input to the input vector. May perform reallocation.
     // Prefer reserveLength() and addInput() instead, where possible.
-    MOZ_WARN_UNUSED_RESULT bool addInputSlow(MDefinition* ins) {
+    MOZ_MUST_USE bool addInputSlow(MDefinition* ins) {
         return inputs_.emplaceBack(ins, this);
     }
 
     // Appends a new input to the input vector. Infallible because
     // we know the inputs fits in the vector's inline storage.
     void addInlineInput(MDefinition* ins) {
         MOZ_ASSERT(inputs_.length() < InputVector::InlineLength);
         MOZ_ALWAYS_TRUE(addInputSlow(ins));
@@ -13391,17 +13391,17 @@ class MResumePoint final :
     Mode mode_;
 
     MResumePoint(MBasicBlock* block, jsbytecode* pc, Mode mode);
     void inherit(MBasicBlock* state);
 
   protected:
     // Initializes operands_ to an empty array of a fixed length.
     // The array may then be filled in by inherit().
-    MOZ_WARN_UNUSED_RESULT bool init(TempAllocator& alloc);
+    MOZ_MUST_USE bool init(TempAllocator& alloc);
 
     void clearOperand(size_t index) {
         // FixedList doesn't initialize its elements, so do an unchecked init.
         operands_[index].initUncheckedWithoutProducer(this);
     }
 
     MUse* getUseFor(size_t index) override {
         return &operands_[index];
--- a/js/src/jit/MIRGraph.h
+++ b/js/src/jit/MIRGraph.h
@@ -42,21 +42,21 @@ class MBasicBlock : public TempObject, p
         PENDING_LOOP_HEADER,
         LOOP_HEADER,
         SPLIT_EDGE,
         DEAD
     };
 
   private:
     MBasicBlock(MIRGraph& graph, const CompileInfo& info, BytecodeSite* site, Kind kind);
-    MOZ_WARN_UNUSED_RESULT bool init();
+    MOZ_MUST_USE bool init();
     void copySlots(MBasicBlock* from);
-    MOZ_WARN_UNUSED_RESULT bool inherit(TempAllocator& alloc, BytecodeAnalysis* analysis, MBasicBlock* pred,
+    MOZ_MUST_USE bool inherit(TempAllocator& alloc, BytecodeAnalysis* analysis, MBasicBlock* pred,
                                         uint32_t popped, unsigned stackPhiCount = 0);
-    MOZ_WARN_UNUSED_RESULT bool inheritResumePoint(MBasicBlock* pred);
+    MOZ_MUST_USE bool inheritResumePoint(MBasicBlock* pred);
     void assertUsesAreNotWithin(MUseIterator use, MUseIterator end);
 
     // This block cannot be reached by any means.
     bool unreachable_;
 
     // Pushes a copy of a local variable or argument.
     void pushVariable(uint32_t slot);
 
@@ -149,29 +149,29 @@ class MBasicBlock : public TempObject, p
 
     // Gets the instruction associated with various slot types.
     MDefinition* peek(int32_t depth);
 
     MDefinition* scopeChain();
     MDefinition* argumentsObject();
 
     // Increase the number of slots available
-    MOZ_WARN_UNUSED_RESULT bool increaseSlots(size_t num);
-    MOZ_WARN_UNUSED_RESULT bool ensureHasSlots(size_t num);
+    MOZ_MUST_USE bool increaseSlots(size_t num);
+    MOZ_MUST_USE bool ensureHasSlots(size_t num);
 
     // Initializes a slot value; must not be called for normal stack
     // operations, as it will not create new SSA names for copies.
     void initSlot(uint32_t index, MDefinition* ins);
 
     // Discard the slot at the given depth, lowering all slots above.
     void shimmySlots(int discardDepth);
 
     // In an OSR block, set all MOsrValues to use the MResumePoint attached to
     // the MStart.
-    MOZ_WARN_UNUSED_RESULT bool linkOsrValues(MStart* start);
+    MOZ_MUST_USE bool linkOsrValues(MStart* start);
 
     // Sets the instruction associated with various slot types. The
     // instruction must lie at the top of the stack.
     void setLocal(uint32_t local);
     void setArg(uint32_t arg);
     void setSlot(uint32_t slot);
     void setSlot(uint32_t slot, MDefinition* ins);
 
@@ -215,27 +215,27 @@ class MBasicBlock : public TempObject, p
     void discardPreAllocatedResumePoint(MResumePoint* resume) {
         MOZ_ASSERT(!resume->instruction());
         discardResumePoint(resume);
     }
 
     // Adds a predecessor. Every predecessor must have the same exit stack
     // depth as the entry state to this block. Adding a predecessor
     // automatically creates phi nodes and rewrites uses as needed.
-    MOZ_WARN_UNUSED_RESULT bool addPredecessor(TempAllocator& alloc, MBasicBlock* pred);
-    MOZ_WARN_UNUSED_RESULT bool addPredecessorPopN(TempAllocator& alloc, MBasicBlock* pred, uint32_t popped);
+    MOZ_MUST_USE bool addPredecessor(TempAllocator& alloc, MBasicBlock* pred);
+    MOZ_MUST_USE bool addPredecessorPopN(TempAllocator& alloc, MBasicBlock* pred, uint32_t popped);
 
     // Add a predecessor which won't introduce any new phis to this block.
     // This may be called after the contents of this block have been built.
     void addPredecessorSameInputsAs(MBasicBlock* pred, MBasicBlock* existingPred);
 
     // Stranger utilities used for inlining.
-    MOZ_WARN_UNUSED_RESULT bool addPredecessorWithoutPhis(MBasicBlock* pred);
+    MOZ_MUST_USE bool addPredecessorWithoutPhis(MBasicBlock* pred);
     void inheritSlots(MBasicBlock* parent);
-    MOZ_WARN_UNUSED_RESULT bool initEntrySlots(TempAllocator& alloc);
+    MOZ_MUST_USE bool initEntrySlots(TempAllocator& alloc);
 
     // Replaces an edge for a given block with a new block. This is
     // used for critical edge splitting.
     //
     // Note: If successorWithPhis is set, you must not be replacing it.
     void replacePredecessor(MBasicBlock* old, MBasicBlock* split);
     void replaceSuccessor(size_t pos, MBasicBlock* split);
 
@@ -250,36 +250,36 @@ class MBasicBlock : public TempObject, p
     void removePredecessorWithoutPhiOperands(MBasicBlock* pred, size_t predIndex);
 
     // Resets all the dominator info so that it can be recomputed.
     void clearDominatorInfo();
 
     // Sets a back edge. This places phi nodes and rewrites instructions within
     // the current loop as necessary. If the backedge introduces new types for
     // phis at the loop header, returns a disabling abort.
-    MOZ_WARN_UNUSED_RESULT AbortReason setBackedge(MBasicBlock* block);
-    MOZ_WARN_UNUSED_RESULT bool setBackedgeAsmJS(MBasicBlock* block);
+    MOZ_MUST_USE AbortReason setBackedge(MBasicBlock* block);
+    MOZ_MUST_USE bool setBackedgeAsmJS(MBasicBlock* block);
 
     // Resets a LOOP_HEADER block to a NORMAL block.  This is needed when
     // optimizations remove the backedge.
     void clearLoopHeader();
 
     // Sets a block to a LOOP_HEADER block, with newBackedge as its backedge.
     // This is needed when optimizations remove the normal entry to a loop
     // with multiple entries.
     void setLoopHeader(MBasicBlock* newBackedge);
 
     // Propagates phis placed in a loop header down to this successor block.
     void inheritPhis(MBasicBlock* header);
 
     // Propagates backedge slots into phis operands of the loop header.
-    MOZ_WARN_UNUSED_RESULT bool inheritPhisFromBackedge(MBasicBlock* backedge, bool* hadTypeChange);
+    MOZ_MUST_USE bool inheritPhisFromBackedge(MBasicBlock* backedge, bool* hadTypeChange);
 
     // Compute the types for phis in this block according to their inputs.
-    MOZ_WARN_UNUSED_RESULT bool specializePhis();
+    MOZ_MUST_USE bool specializePhis();
 
     void insertBefore(MInstruction* at, MInstruction* ins);
     void insertAfter(MInstruction* at, MInstruction* ins);
 
     void insertAtEnd(MInstruction* ins);
 
     // Add an instruction to this block, from elsewhere in the graph.
     void addFromElsewhere(MInstruction* ins);
@@ -768,17 +768,17 @@ class MIRGraph
 
     void setReturnAccumulator(MIRGraphReturns* accum) {
         returnAccumulator_ = accum;
     }
     MIRGraphReturns* returnAccumulator() const {
         return returnAccumulator_;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool addReturn(MBasicBlock* returnBlock) {
+    MOZ_MUST_USE bool addReturn(MBasicBlock* returnBlock) {
         if (!returnAccumulator_)
             return true;
 
         return returnAccumulator_->append(returnBlock);
     }
 
     MBasicBlock* entryBlock() {
         return *blocks_.begin();
--- a/js/src/jit/shared/CodeGenerator-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
@@ -1614,17 +1614,17 @@ CodeGeneratorShared::jumpToBlock(MBasicB
 
         masm.propagateOOM(patchableBackedges_.append(PatchableBackedgeInfo(backedge, mir->lir()->label(), oolEntry)));
     } else {
         masm.j(cond, mir->lir()->label());
     }
 }
 #endif
 
-MOZ_WARN_UNUSED_RESULT bool
+MOZ_MUST_USE bool
 CodeGeneratorShared::addCacheLocations(const CacheLocationList& locs, size_t* numLocs,
                                        size_t* curIndex)
 {
     size_t firstIndex = runtimeData_.length();
     size_t numLocations = 0;
     for (CacheLocationList::iterator iter = locs.begin(); iter != locs.end(); iter++) {
         // allocateData() ensures that sizeof(CacheLocation) is word-aligned.
         // If this changes, we will need to pad to ensure alignment.
--- a/js/src/jit/shared/CodeGenerator-shared.h
+++ b/js/src/jit/shared/CodeGenerator-shared.h
@@ -257,17 +257,17 @@ class CodeGeneratorShared : public LElem
             return lookup();
         }
         T * operator*() {
             return lookup();
         }
     };
 
   protected:
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     bool allocateData(size_t size, size_t* offset) {
         MOZ_ASSERT(size % sizeof(void*) == 0);
         *offset = runtimeData_.length();
         masm.propagateOOM(runtimeData_.appendN(0, size));
         return !masm.oom();
     }
 
     // Ensure the cache is an IonCache while expecting the size of the derived
--- a/js/src/jit/x64/BaseAssembler-x64.h
+++ b/js/src/jit/x64/BaseAssembler-x64.h
@@ -612,50 +612,50 @@ class BaseAssemblerX64 : public BaseAsse
         m_formatter.oneByteOp64(OP_MOVSXD_GvEv, offset, base, dst);
     }
     void movslq_mr(int32_t offset, RegisterID base, RegisterID index, int scale, RegisterID dst)
     {
         spew("movslq     " MEM_obs ", %s", ADDR_obs(offset, base, index, scale), GPReg64Name(dst));
         m_formatter.oneByteOp64(OP_MOVSXD_GvEv, offset, base, index, scale, dst);
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     movl_ripr(RegisterID dst)
     {
         m_formatter.oneByteRipOp(OP_MOV_GvEv, 0, (RegisterID)dst);
         JmpSrc label(m_formatter.size());
         spew("movl       " MEM_o32r ", %s", ADDR_o32r(label.offset()), GPReg32Name(dst));
         return label;
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     movl_rrip(RegisterID src)
     {
         m_formatter.oneByteRipOp(OP_MOV_EvGv, 0, (RegisterID)src);
         JmpSrc label(m_formatter.size());
         spew("movl       %s, " MEM_o32r "", GPReg32Name(src), ADDR_o32r(label.offset()));
         return label;
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     movq_ripr(RegisterID dst)
     {
         m_formatter.oneByteRipOp64(OP_MOV_GvEv, 0, dst);
         JmpSrc label(m_formatter.size());
         spew("movq       " MEM_o32r ", %s", ADDR_o32r(label.offset()), GPRegName(dst));
         return label;
     }
 
     void leaq_mr(int32_t offset, RegisterID base, RegisterID dst)
     {
         spew("leaq       " MEM_ob ", %s", ADDR_ob(offset, base), GPReg64Name(dst));
         m_formatter.oneByteOp64(OP_LEA, offset, base, dst);
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     leaq_rip(RegisterID dst)
     {
         m_formatter.oneByteRipOp64(OP_LEA, 0, dst);
         JmpSrc label(m_formatter.size());
         spew("leaq       " MEM_o32r ", %s", ADDR_o32r(label.offset()), GPRegName(dst));
         return label;
     }
 
@@ -709,62 +709,62 @@ class BaseAssemblerX64 : public BaseAsse
 
     void vmovq_rr(RegisterID src, XMMRegisterID dst)
     {
         // While this is called "vmovq", it actually uses the vmovd encoding
         // with a REX prefix modifying it to be 64-bit.
         twoByteOpInt64Simd("vmovq", VEX_PD, OP2_MOVD_VdEd, src, invalid_xmm, dst);
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovsd_ripr(XMMRegisterID dst)
     {
         return twoByteRipOpSimd("vmovsd", VEX_SD, OP2_MOVSD_VsdWsd, invalid_xmm, dst);
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovss_ripr(XMMRegisterID dst)
     {
         return twoByteRipOpSimd("vmovss", VEX_SS, OP2_MOVSD_VsdWsd, invalid_xmm, dst);
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovsd_rrip(XMMRegisterID src)
     {
         return twoByteRipOpSimd("vmovsd", VEX_SD, OP2_MOVSD_WsdVsd, invalid_xmm, src);
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovss_rrip(XMMRegisterID src)
     {
         return twoByteRipOpSimd("vmovss", VEX_SS, OP2_MOVSD_WsdVsd, invalid_xmm, src);
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovdqa_rrip(XMMRegisterID src)
     {
         return twoByteRipOpSimd("vmovdqa", VEX_PD, OP2_MOVDQ_WdqVdq, invalid_xmm, src);
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovaps_rrip(XMMRegisterID src)
     {
         return twoByteRipOpSimd("vmovdqa", VEX_PS, OP2_MOVAPS_WsdVsd, invalid_xmm, src);
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovaps_ripr(XMMRegisterID dst)
     {
         return twoByteRipOpSimd("vmovaps", VEX_PS, OP2_MOVAPS_VsdWsd, invalid_xmm, dst);
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     vmovdqa_ripr(XMMRegisterID dst)
     {
         return twoByteRipOpSimd("vmovdqa", VEX_PD, OP2_MOVDQ_VdqWdq, invalid_xmm, dst);
     }
 
   private:
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     twoByteRipOpSimd(const char* name, VexOperandType ty, TwoByteOpcodeID opcode,
                      XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
             m_formatter.legacySSEPrefix(ty);
             m_formatter.twoByteRipOp(opcode, 0, dst);
             JmpSrc label(m_formatter.size());
             if (IsXMMReversedOperands(opcode))
--- a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
@@ -1499,34 +1499,34 @@ public:
             m_formatter.oneByteOp(OP_GROUP1_EvIb, offset, base, index, scale, GROUP1_OP_CMP);
             m_formatter.immediate8s(rhs);
         } else {
             m_formatter.oneByteOp(OP_GROUP1_EvIz, offset, base, index, scale, GROUP1_OP_CMP);
             m_formatter.immediate32(rhs);
         }
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     cmpl_im_disp32(int32_t rhs, int32_t offset, RegisterID base)
     {
         spew("cmpl       $0x%x, " MEM_o32b, rhs, ADDR_o32b(offset, base));
         JmpSrc r;
         if (CAN_SIGN_EXTEND_8_32(rhs)) {
             m_formatter.oneByteOp_disp32(OP_GROUP1_EvIb, offset, base, GROUP1_OP_CMP);
             r = JmpSrc(m_formatter.size());
             m_formatter.immediate8s(rhs);
         } else {
             m_formatter.oneByteOp_disp32(OP_GROUP1_EvIz, offset, base, GROUP1_OP_CMP);
             r = JmpSrc(m_formatter.size());
             m_formatter.immediate32(rhs);
         }
         return r;
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     cmpl_im_disp32(int32_t rhs, const void* addr)
     {
         spew("cmpl       $0x%x, %p", rhs, addr);
         JmpSrc r;
         if (CAN_SIGN_EXTEND_8_32(rhs)) {
             m_formatter.oneByteOp_disp32(OP_GROUP1_EvIb, addr, GROUP1_OP_CMP);
             r = JmpSrc(m_formatter.size());
             m_formatter.immediate8s(rhs);
@@ -2231,17 +2231,17 @@ public:
     void leal_mr(int32_t offset, RegisterID base, RegisterID dst)
     {
         spew("leal       " MEM_ob ", %s", ADDR_ob(offset, base), GPReg32Name(dst));
         m_formatter.oneByteOp(OP_LEA, offset, base, dst);
     }
 
     // Flow control:
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     call()
     {
         m_formatter.oneByteOp(OP_CALL_rel32);
         JmpSrc r = m_formatter.immediateRel32();
         spew("call       .Lfrom%d", r.offset());
         return r;
     }
 
@@ -2255,17 +2255,17 @@ public:
     {
         spew("call       *" MEM_ob, ADDR_ob(offset, base));
         m_formatter.oneByteOp(OP_GROUP5_Ev, offset, base, GROUP5_OP_CALLN);
     }
 
     // Comparison of EAX against a 32-bit immediate. The immediate is patched
     // in as if it were a jump target. The intention is to toggle the first
     // byte of the instruction between a CMP and a JMP to produce a pseudo-NOP.
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     cmp_eax()
     {
         m_formatter.oneByteOp(OP_CMP_EAXIv);
         JmpSrc r = m_formatter.immediateRel32();
         spew("cmpl       %%eax, .Lfrom%d", r.offset());
         return r;
     }
 
@@ -2280,17 +2280,17 @@ public:
         if (CAN_SIGN_EXTEND_8_32(diff - 2)) {
             m_formatter.oneByteOp(OP_JMP_rel8);
             m_formatter.immediate8s(diff - 2);
         } else {
             m_formatter.oneByteOp(OP_JMP_rel32);
             m_formatter.immediate32(diff - 5);
         }
     }
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     jmp()
     {
         m_formatter.oneByteOp(OP_JMP_rel32);
         JmpSrc r = m_formatter.immediateRel32();
         spew("jmp        .Lfrom%d", r.offset());
         return r;
     }
 
@@ -2323,17 +2323,17 @@ public:
             m_formatter.oneByteOp(jccRel8(cond));
             m_formatter.immediate8s(diff - 2);
         } else {
             m_formatter.twoByteOp(jccRel32(cond));
             m_formatter.immediate32(diff - 6);
         }
     }
 
-    MOZ_WARN_UNUSED_RESULT JmpSrc
+    MOZ_MUST_USE JmpSrc
     jCC(Condition cond)
     {
         m_formatter.twoByteOp(jccRel32(cond));
         JmpSrc r = m_formatter.immediateRel32();
         spew("j%s        .Lfrom%d", CCName(cond), r.offset());
         return r;
     }
 
@@ -4664,17 +4664,17 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
             m_buffer.putIntUnchecked(imm);
         }
 
         void immediate64(int64_t imm)
         {
             m_buffer.putInt64Unchecked(imm);
         }
 
-        MOZ_WARN_UNUSED_RESULT JmpSrc
+        MOZ_MUST_USE JmpSrc
         immediateRel32()
         {
             m_buffer.putIntUnchecked(0);
             return JmpSrc(m_buffer.size());
         }
 
         // Data:
 
--- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.h
+++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.h
@@ -87,33 +87,33 @@ class CodeGeneratorX86Shared : public Co
         LInstruction* ins() const { return ins_; }
 
         void accept(CodeGeneratorX86Shared* codegen) {
             codegen->visitOutOfLineSimdFloatToIntCheck(this);
         }
     };
 
   private:
-    MOZ_WARN_UNUSED_RESULT uint32_t
+    MOZ_MUST_USE uint32_t
     emitAsmJSBoundsCheckBranch(const MAsmJSHeapAccess* mir, const MInstruction* ins,
                                Register ptr, Label* fail);
 
   public:
     // For SIMD and atomic loads and stores (which throw on out-of-bounds):
-    MOZ_WARN_UNUSED_RESULT uint32_t
+    MOZ_MUST_USE uint32_t
     maybeEmitThrowingAsmJSBoundsCheck(const MAsmJSHeapAccess* mir, const MInstruction* ins,
                                       const LAllocation* ptr);
 
     // For asm.js plain and atomic loads that possibly require a bounds check:
-    MOZ_WARN_UNUSED_RESULT uint32_t
+    MOZ_MUST_USE uint32_t
     maybeEmitAsmJSLoadBoundsCheck(const MAsmJSLoadHeap* mir, LAsmJSLoadHeap* ins,
                                   OutOfLineLoadTypedArrayOutOfBounds** ool);
 
     // For asm.js plain and atomic stores that possibly require a bounds check:
-    MOZ_WARN_UNUSED_RESULT uint32_t
+    MOZ_MUST_USE uint32_t
     maybeEmitAsmJSStoreBoundsCheck(const MAsmJSStoreHeap* mir, LAsmJSStoreHeap* ins,
                                    Label** rejoin);
 
     void cleanupAfterAsmJSBoundsCheckBranch(const MAsmJSHeapAccess* mir, Register ptr);
 
     NonAssertingLabel deoptLabel_;
 
     Operand ToOperand(const LAllocation& a);
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -429,17 +429,17 @@ struct JSContext : public js::ExclusiveC
         runtime_->gc.minorGC(this, reason);
     }
 
   public:
     bool isExceptionPending() {
         return throwing;
     }
 
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     bool getPendingException(JS::MutableHandleValue rval);
 
     bool isThrowingOutOfMemory();
     bool isThrowingDebuggeeWouldRun();
     bool isClosingGenerator();
 
     void setPendingException(js::Value v);
 
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -516,37 +516,37 @@ struct JSCompartment
                                                  DebuggerObservesAsmJS;
 
     void updateDebuggerObservesFlag(unsigned flag);
 
   public:
     JSCompartment(JS::Zone* zone, const JS::CompartmentOptions& options);
     ~JSCompartment();
 
-    MOZ_WARN_UNUSED_RESULT bool init(JSContext* maybecx);
+    MOZ_MUST_USE bool init(JSContext* maybecx);
 
-    MOZ_WARN_UNUSED_RESULT inline bool wrap(JSContext* cx, JS::MutableHandleValue vp,
+    MOZ_MUST_USE inline bool wrap(JSContext* cx, JS::MutableHandleValue vp,
                                             JS::HandleObject existing = nullptr);
 
-    MOZ_WARN_UNUSED_RESULT bool wrap(JSContext* cx, js::MutableHandleString strp);
-    MOZ_WARN_UNUSED_RESULT bool wrap(JSContext* cx, JS::MutableHandleObject obj,
+    MOZ_MUST_USE bool wrap(JSContext* cx, js::MutableHandleString strp);
+    MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandleObject obj,
                                      JS::HandleObject existingArg = nullptr);
-    MOZ_WARN_UNUSED_RESULT bool wrap(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc);
+    MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc);
 
-    template<typename T> MOZ_WARN_UNUSED_RESULT bool wrap(JSContext* cx,
-                                                          JS::AutoVectorRooter<T>& vec) {
+    template<typename T> MOZ_MUST_USE bool wrap(JSContext* cx,
+                                                JS::AutoVectorRooter<T>& vec) {
         for (size_t i = 0; i < vec.length(); ++i) {
             if (!wrap(cx, vec[i]))
                 return false;
         }
         return true;
     };
 
-    MOZ_WARN_UNUSED_RESULT bool putWrapper(JSContext* cx, const js::CrossCompartmentKey& wrapped,
-                                           const js::Value& wrapper);
+    MOZ_MUST_USE bool putWrapper(JSContext* cx, const js::CrossCompartmentKey& wrapped,
+                                 const js::Value& wrapper);
 
     js::WrapperMap::Ptr lookupWrapper(const js::Value& wrapped) const {
         return crossCompartmentWrappers.lookup(js::CrossCompartmentKey(wrapped));
     }
 
     void removeWrapper(js::WrapperMap::Ptr p) {
         crossCompartmentWrappers.remove(p);
     }
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1313,21 +1313,21 @@ class MOZ_STACK_CLASS AutoStableStringCh
     enum State { Uninitialized, Latin1, TwoByte };
     State state_;
 
   public:
     explicit AutoStableStringChars(JSContext* cx)
       : s_(cx), state_(Uninitialized)
     {}
 
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     bool init(JSContext* cx, JSString* s);
 
     /* Like init(), but Latin1 chars are inflated to TwoByte. */
-    MOZ_WARN_UNUSED_RESULT
+    MOZ_MUST_USE
     bool initTwoByte(JSContext* cx, JSString* s);
 
     bool isLatin1() const { return state_ == Latin1; }
     bool isTwoByte() const { return state_ == TwoByte; }
 
     const char16_t* twoByteChars() const {
         MOZ_ASSERT(state_ == TwoByte);
         return twoByteChars_;
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -280,17 +280,17 @@ ClassCanHaveFixedData(const Class* clasp
 // If we do have an allocation metadata builder, it can cause a GC, so the object
 // must be rooted. The usual way to do this would be to make our callers pass a
 // HandleObject, but that would require them to pay the cost of rooting the
 // object unconditionally, even though collecting metadata is rare. Instead,
 // SetNewObjectMetadata's contract is that the caller must use the pointer
 // returned in place of the pointer passed. If a GC occurs, the returned pointer
 // may be the passed pointer, relocated by GC. If no GC could occur, it's just
 // passed through. We root nothing unless necessary.
-static MOZ_ALWAYS_INLINE MOZ_WARN_UNUSED_RESULT JSObject*
+static MOZ_ALWAYS_INLINE MOZ_MUST_USE JSObject*
 SetNewObjectMetadata(ExclusiveContext* cxArg, JSObject* obj)
 {
     MOZ_ASSERT(!cxArg->compartment()->hasObjectPendingMetadata());
 
     // The metadata builder is invoked for each object created on the main
     // thread, except when analysis/compilation is active, to avoid recursion.
     if (JSContext* cx = cxArg->maybeJSContext()) {
         if (MOZ_UNLIKELY((size_t)cx->compartment()->hasAllocationMetadataBuilder()) &&
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1667,17 +1667,17 @@ js::GetPCCountScriptCount(JSContext* cx)
     if (!rt->scriptAndCountsVector)
         return 0;
 
     return rt->scriptAndCountsVector->length();
 }
 
 enum MaybeComma {NO_COMMA, COMMA};
 
-static MOZ_WARN_UNUSED_RESULT bool
+static MOZ_MUST_USE bool
 AppendJSONProperty(StringBuffer& buf, const char* name, MaybeComma comma = COMMA)
 {
     if (comma && !buf.append(','))
         return false;
 
     return buf.append('\"') &&
            buf.append(name, strlen(name)) &&
            buf.append("\":", 2);
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -1367,31 +1367,31 @@ class StringSegmentRange
         return true;
     }
 
   public:
     explicit StringSegmentRange(JSContext* cx)
       : stack(cx, StringVector(cx)), cur(cx)
     {}
 
-    MOZ_WARN_UNUSED_RESULT bool init(JSString* str) {
+    MOZ_MUST_USE bool init(JSString* str) {
         MOZ_ASSERT(stack.empty());
         return settle(str);
     }
 
     bool empty() const {
         return cur == nullptr;
     }
 
     JSLinearString* front() const {
         MOZ_ASSERT(!cur->isRope());
         return cur;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool popFront() {
+    MOZ_MUST_USE bool popFront() {
         MOZ_ASSERT(!empty());
         if (stack.empty()) {
             cur = nullptr;
             return true;
         }
         return settle(stack.popCopy());
     }
 };
--- a/js/src/vm/ArrayBufferObject.h
+++ b/js/src/vm/ArrayBufferObject.h
@@ -277,17 +277,17 @@ class ArrayBufferObject : public ArrayBu
 
     bool addView(JSContext* cx, JSObject* view);
 
     void setNewOwnedData(FreeOp* fop, BufferContents newContents);
     void changeContents(JSContext* cx, BufferContents newContents);
 
     // Detach this buffer from its original memory.  (This necessarily makes
     // views of this buffer unusable for modifying that original memory.)
-    static MOZ_WARN_UNUSED_RESULT bool
+    static MOZ_MUST_USE bool
     detach(JSContext* cx, Handle<ArrayBufferObject*> buffer, BufferContents newContents);
 
   private:
     void changeViewContents(JSContext* cx, ArrayBufferViewObject* view,
                             uint8_t* oldDataPointer, BufferContents newContents);
     void setFirstView(ArrayBufferViewObject* view);
 
     uint8_t* inlineDataPointer() const;
--- a/js/src/vm/StringBuffer.h
+++ b/js/src/vm/StringBuffer.h
@@ -67,104 +67,104 @@ class StringBuffer
 
     MOZ_ALWAYS_INLINE const Latin1CharBuffer& latin1Chars() const {
         return cb.ref<Latin1CharBuffer>();
     }
     MOZ_ALWAYS_INLINE const TwoByteCharBuffer& twoByteChars() const {
         return cb.ref<TwoByteCharBuffer>();
     }
 
-    MOZ_WARN_UNUSED_RESULT bool inflateChars();
+    MOZ_MUST_USE bool inflateChars();
 
   public:
     explicit StringBuffer(ExclusiveContext* cx)
       : cx(cx)
 #ifdef DEBUG
       , hasEnsuredTwoByteChars_(false)
 #endif
       , reserved_(0)
     {
         cb.construct<Latin1CharBuffer>(cx);
     }
 
-    MOZ_WARN_UNUSED_RESULT bool reserve(size_t len) {
+    MOZ_MUST_USE bool reserve(size_t len) {
         if (len > reserved_)
             reserved_ = len;
         return isLatin1() ? latin1Chars().reserve(len) : twoByteChars().reserve(len);
     }
-    MOZ_WARN_UNUSED_RESULT bool resize(size_t len) {
+    MOZ_MUST_USE bool resize(size_t len) {
         return isLatin1() ? latin1Chars().resize(len) : twoByteChars().resize(len);
     }
     bool empty() const {
         return isLatin1() ? latin1Chars().empty() : twoByteChars().empty();
     }
     size_t length() const {
         return isLatin1() ? latin1Chars().length() : twoByteChars().length();
     }
     char16_t getChar(size_t idx) const {
         return isLatin1() ? latin1Chars()[idx] : twoByteChars()[idx];
     }
 
-    MOZ_WARN_UNUSED_RESULT bool ensureTwoByteChars() {
+    MOZ_MUST_USE bool ensureTwoByteChars() {
         if (isLatin1() && !inflateChars())
             return false;
 
 #ifdef DEBUG
         hasEnsuredTwoByteChars_ = true;
 #endif
         return true;
     }
 
-    MOZ_WARN_UNUSED_RESULT bool append(const char16_t c) {
+    MOZ_MUST_USE bool append(const char16_t c) {
         if (isLatin1()) {
             if (c <= JSString::MAX_LATIN1_CHAR)
                 return latin1Chars().append(Latin1Char(c));
             if (!inflateChars())
                 return false;
         }
         return twoByteChars().append(c);
     }
-    MOZ_WARN_UNUSED_RESULT bool append(Latin1Char c) {
+    MOZ_MUST_USE bool append(Latin1Char c) {
         return isLatin1() ? latin1Chars().append(c) : twoByteChars().append(c);
     }
-    MOZ_WARN_UNUSED_RESULT bool append(char c) {
+    MOZ_MUST_USE bool append(char c) {
         return append(Latin1Char(c));
     }
 
-    inline MOZ_WARN_UNUSED_RESULT bool append(const char16_t* begin, const char16_t* end);
+    inline MOZ_MUST_USE bool append(const char16_t* begin, const char16_t* end);
 
-    MOZ_WARN_UNUSED_RESULT bool append(const char16_t* chars, size_t len) {
+    MOZ_MUST_USE bool append(const char16_t* chars, size_t len) {
         return append(chars, chars + len);
     }
 
-    MOZ_WARN_UNUSED_RESULT bool append(const Latin1Char* begin, const Latin1Char* end) {
+    MOZ_MUST_USE bool append(const Latin1Char* begin, const Latin1Char* end) {
         return isLatin1() ? latin1Chars().append(begin, end) : twoByteChars().append(begin, end);
     }
-    MOZ_WARN_UNUSED_RESULT bool append(const Latin1Char* chars, size_t len) {
+    MOZ_MUST_USE bool append(const Latin1Char* chars, size_t len) {
         return append(chars, chars + len);
     }
 
-    MOZ_WARN_UNUSED_RESULT bool append(const JS::ConstCharPtr chars, size_t len) {
+    MOZ_MUST_USE bool append(const JS::ConstCharPtr chars, size_t len) {
         return append(chars.get(), chars.get() + len);
     }
-    MOZ_WARN_UNUSED_RESULT bool appendN(Latin1Char c, size_t n) {
+    MOZ_MUST_USE bool appendN(Latin1Char c, size_t n) {
         return isLatin1() ? latin1Chars().appendN(c, n) : twoByteChars().appendN(c, n);
     }
 
-    inline MOZ_WARN_UNUSED_RESULT bool append(JSString* str);
-    inline MOZ_WARN_UNUSED_RESULT bool append(JSLinearString* str);
-    inline MOZ_WARN_UNUSED_RESULT bool appendSubstring(JSString* base, size_t off, size_t len);
-    inline MOZ_WARN_UNUSED_RESULT bool appendSubstring(JSLinearString* base, size_t off, size_t len);
+    inline MOZ_MUST_USE bool append(JSString* str);
+    inline MOZ_MUST_USE bool append(JSLinearString* str);
+    inline MOZ_MUST_USE bool appendSubstring(JSString* base, size_t off, size_t len);
+    inline MOZ_MUST_USE bool appendSubstring(JSLinearString* base, size_t off, size_t len);
 
-    MOZ_WARN_UNUSED_RESULT bool append(const char* chars, size_t len) {
+    MOZ_MUST_USE bool append(const char* chars, size_t len) {
         return append(reinterpret_cast<const Latin1Char*>(chars), len);
     }
 
     template <size_t ArrayLength>
-    MOZ_WARN_UNUSED_RESULT bool append(const char (&array)[ArrayLength]) {
+    MOZ_MUST_USE bool append(const char (&array)[ArrayLength]) {
         return append(array, ArrayLength - 1); /* No trailing '\0'. */
     }
 
     /* Infallible variants usable when the corresponding space is reserved. */
     void infallibleAppend(Latin1Char c) {
         if (isLatin1())
             latin1Chars().infallibleAppend(c);
         else
--- a/layout/svg/AutoReferenceLimiter.h
+++ b/layout/svg/AutoReferenceLimiter.h
@@ -91,17 +91,17 @@ public:
     }
   }
 
   /**
    * Returns true on success (no reference loop/reference chain length is
    * within the specified limits), else returns false on failure (there is a
    * reference loop/the reference chain has exceeded the specified limits).
    */
-  MOZ_WARN_UNUSED_RESULT bool Reference() {
+  MOZ_MUST_USE bool Reference() {
     // If we fail this assertion then either a consumer failed to break a
     // reference loop/chain, or else they called Reference() more than once
     MOZ_ASSERT(*mRefCounter >= 0);
 
     (*mRefCounter)--;
 
     if (*mRefCounter < 0) {
       // TODO: This is an issue with the document, not with Mozilla code. We
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -32,18 +32,18 @@
 #elif defined(HAVE_FORCEINLINE)
 #  define MOZALLOC_INLINE __forceinline
 #else
 #  define MOZALLOC_INLINE inline
 #endif
 
 /* Workaround build problem with Sun Studio 12 */
 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#  undef MOZ_WARN_UNUSED_RESULT
-#  define MOZ_WARN_UNUSED_RESULT
+#  undef MOZ_MUST_USE
+#  define MOZ_MUST_USE
 #  undef MOZ_ALLOCATOR
 #  define MOZ_ALLOCATOR
 #endif
 
 #if defined(__cplusplus)
 extern "C" {
 #endif /* ifdef __cplusplus */
 
@@ -92,20 +92,20 @@ MFBT_API size_t moz_malloc_size_of(const
 
 #if defined(HAVE_STRNDUP)
 MFBT_API char* moz_xstrndup(const char* str, size_t strsize)
     MOZ_ALLOCATOR;
 #endif /* if defined(HAVE_STRNDUP) */
 
 
 #if defined(HAVE_POSIX_MEMALIGN)
-MFBT_API MOZ_WARN_UNUSED_RESULT
+MFBT_API MOZ_MUST_USE
 int moz_xposix_memalign(void **ptr, size_t alignment, size_t size);
 
-MFBT_API MOZ_WARN_UNUSED_RESULT
+MFBT_API MOZ_MUST_USE
 int moz_posix_memalign(void **ptr, size_t alignment, size_t size);
 #endif /* if defined(HAVE_POSIX_MEMALIGN) */
 
 
 #if defined(HAVE_MEMALIGN)
 MFBT_API void* moz_xmemalign(size_t boundary, size_t size)
     MOZ_ALLOCATOR;
 #endif /* if defined(HAVE_MEMALIGN) */
--- a/mfbt/AlreadyAddRefed.h
+++ b/mfbt/AlreadyAddRefed.h
@@ -106,17 +106,17 @@ struct MOZ_MUST_USE_TYPE MOZ_NON_AUTOABL
   // Note that nsCOMPtr is the XPCOM reference counting smart pointer class.
   friend void operator<<(const mozilla::unused_t& aUnused,
                          const already_AddRefed<T>& aRhs)
   {
     auto mutableAlreadyAddRefed = const_cast<already_AddRefed<T>*>(&aRhs);
     aUnused << mutableAlreadyAddRefed->take();
   }
 
-  MOZ_WARN_UNUSED_RESULT T* take()
+  MOZ_MUST_USE T* take()
   {
     T* rawPtr = mRawPtr;
     mRawPtr = nullptr;
     return rawPtr;
   }
 
   /**
    * This helper provides a static_cast replacement for already_AddRefed, so
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -542,24 +542,24 @@ struct AssertionConditionType
  * using MOZ_ASSERT.
  */
 #ifdef DEBUG
 #  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))
 #  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))
 #else
 #  define MOZ_ALWAYS_TRUE(expr) \
   do { \
-    if ( ( expr ) ) {                       \
-      /* Silence MOZ_WARN_UNUSED_RESULT. */ \
+    if ( ( expr ) ) { \
+      /* Silence MOZ_MUST_USE. */ \
     } \
   } while (0)
 #  define MOZ_ALWAYS_FALSE(expr) \
   do { \
-    if ( ( expr ) ) {                       \
-      /* Silence MOZ_WARN_UNUSED_RESULT. */ \
+    if ( ( expr ) ) { \
+      /* Silence MOZ_MUST_USE. */ \
     } \
   } while (0)
 #endif
 
 #undef MOZ_DUMP_ASSERTION_STACK
 #undef MOZ_CRASH_CRASHREPORT
 
 #endif /* mozilla_Assertions_h */
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -308,32 +308,32 @@
  */
 #if defined(__GNUC__) || defined(__clang__)
 #  define MOZ_ALLOCATOR __attribute__ ((malloc, warn_unused_result))
 #else
 #  define MOZ_ALLOCATOR
 #endif
 
 /**
- * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's
+ * MOZ_MUST_USE tells the compiler to emit a warning if a function's
  * return value is not used by the caller.
  *
- * Place this attribute at the very beginning of a function definition. For
+ * Place this attribute at the very beginning of a function declaration. For
  * example, write
  *
- *   MOZ_WARN_UNUSED_RESULT int foo();
+ *   MOZ_MUST_USE int foo();
  *
  * or
  *
- *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }
+ *   MOZ_MUST_USE int foo() { return 42; }
  */
 #if defined(__GNUC__) || defined(__clang__)
-#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
+#  define MOZ_MUST_USE __attribute__ ((warn_unused_result))
 #else
-#  define MOZ_WARN_UNUSED_RESULT
+#  define MOZ_MUST_USE
 #endif
 
 /**
  * MOZ_FALLTHROUGH is an annotation to suppress compiler warnings about switch
  * cases that fall through without a break or return statement. MOZ_FALLTHROUGH
  * is only needed on cases that have code.
  *
  * MOZ_FALLTHROUGH_ASSERT is an annotation to suppress compiler warnings about
--- a/mfbt/Endian.h
+++ b/mfbt/Endian.h
@@ -339,47 +339,47 @@ protected:
   }
 };
 
 template<Endianness ThisEndian>
 class Endian : private EndianUtils
 {
 protected:
   /** Read a uint16_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* aPtr)
+  static MOZ_MUST_USE uint16_t readUint16(const void* aPtr)
   {
     return read<uint16_t>(aPtr);
   }
 
   /** Read a uint32_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* aPtr)
+  static MOZ_MUST_USE uint32_t readUint32(const void* aPtr)
   {
     return read<uint32_t>(aPtr);
   }
 
   /** Read a uint64_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* aPtr)
+  static MOZ_MUST_USE uint64_t readUint64(const void* aPtr)
   {
     return read<uint64_t>(aPtr);
   }
 
   /** Read an int16_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* aPtr)
+  static MOZ_MUST_USE int16_t readInt16(const void* aPtr)
   {
     return read<int16_t>(aPtr);
   }
 
   /** Read an int32_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* aPtr)
+  static MOZ_MUST_USE int32_t readInt32(const void* aPtr)
   {
     return read<uint32_t>(aPtr);
   }
 
   /** Read an int64_t in ThisEndian endianness from |aPtr| and return it. */
-  static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* aPtr)
+  static MOZ_MUST_USE int64_t readInt64(const void* aPtr)
   {
     return read<int64_t>(aPtr);
   }
 
   /** Write |aValue| to |aPtr| using ThisEndian endianness. */
   static void writeUint16(void* aPtr, uint16_t aValue)
   {
     write(aPtr, aValue);
@@ -418,17 +418,17 @@ protected:
   /*
    * Converts a value of type T to little-endian format.
    *
    * This function is intended for cases where you have data in your
    * native-endian format and you need it to appear in little-endian
    * format for transmission.
    */
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T aValue)
+  MOZ_MUST_USE static T swapToLittleEndian(T aValue)
   {
     return maybeSwap<ThisEndian, Little>(aValue);
   }
 
   /*
    * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
    * them to little-endian format if ThisEndian is Big.
    * As with memcpy, |aDest| and |aSrc| must not overlap.
@@ -448,17 +448,17 @@ protected:
   {
     maybeSwapInPlace<ThisEndian, Little>(aPtr, aCount);
   }
 
   /*
    * Converts a value of type T to big-endian format.
    */
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T aValue)
+  MOZ_MUST_USE static T swapToBigEndian(T aValue)
   {
     return maybeSwap<ThisEndian, Big>(aValue);
   }
 
   /*
    * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
    * them to big-endian format if ThisEndian is Little.
    * As with memcpy, |aDest| and |aSrc| must not overlap.
@@ -480,17 +480,17 @@ protected:
   }
 
   /*
    * Synonyms for the big-endian functions, for better readability
    * in network code.
    */
 
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T aValue)
+  MOZ_MUST_USE static T swapToNetworkOrder(T aValue)
   {
     return swapToBigEndian(aValue);
   }
 
   template<typename T>
   static void
   copyAndSwapToNetworkOrder(void* aDest, const T* aSrc, size_t aCount)
   {
@@ -503,17 +503,17 @@ protected:
   {
     swapToBigEndianInPlace(aPtr, aCount);
   }
 
   /*
    * Converts a value of type T from little-endian format.
    */
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T aValue)
+  MOZ_MUST_USE static T swapFromLittleEndian(T aValue)
   {
     return maybeSwap<Little, ThisEndian>(aValue);
   }
 
   /*
    * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
    * them to little-endian format if ThisEndian is Big.
    * As with memcpy, |aDest| and |aSrc| must not overlap.
@@ -533,17 +533,17 @@ protected:
   {
     maybeSwapInPlace<Little, ThisEndian>(aPtr, aCount);
   }
 
   /*
    * Converts a value of type T from big-endian format.
    */
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T aValue)
+  MOZ_MUST_USE static T swapFromBigEndian(T aValue)
   {
     return maybeSwap<Big, ThisEndian>(aValue);
   }
 
   /*
    * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
    * them to big-endian format if ThisEndian is Little.
    * As with memcpy, |aDest| and |aSrc| must not overlap.
@@ -564,17 +564,17 @@ protected:
     maybeSwapInPlace<Big, ThisEndian>(aPtr, aCount);
   }
 
   /*
    * Synonyms for the big-endian functions, for better readability
    * in network code.
    */
   template<typename T>
-  MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T aValue)
+  MOZ_MUST_USE static T swapFromNetworkOrder(T aValue)
   {
     return swapFromBigEndian(aValue);
   }
 
   template<typename T>
   static void copyAndSwapFromNetworkOrder(T* aDest, const void* aSrc,
                                           size_t aCount)
   {
--- a/mfbt/FloatingPoint.h
+++ b/mfbt/FloatingPoint.h
@@ -409,15 +409,15 @@ FuzzyEqualsMultiplicative(T aValue1, T a
 /**
  * Returns true if the given value can be losslessly represented as an IEEE-754
  * single format number, false otherwise.  All NaN values are considered
  * representable (notwithstanding that the exact bit pattern of a double format
  * NaN value can't be exactly represented in single format).
  *
  * This function isn't inlined to avoid buggy optimizations by MSVC.
  */
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 extern MFBT_API bool
 IsFloat32Representable(double aFloat32);
 
 } /* namespace mozilla */
 
 #endif /* mozilla_FloatingPoint_h */
--- a/mfbt/HashFunctions.h
+++ b/mfbt/HashFunctions.h
@@ -151,63 +151,63 @@ AddUintptrToHash<8>(uint32_t aHash, uint
 /**
  * AddToHash takes a hash and some values and returns a new hash based on the
  * inputs.
  *
  * Currently, we support hashing uint32_t's, values which we can implicitly
  * convert to uint32_t, data pointers, and function pointers.
  */
 template<typename A>
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 AddToHash(uint32_t aHash, A aA)
 {
   /*
    * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,
    * we'll error out.
    */
   return detail::AddU32ToHash(aHash, aA);
 }
 
 template<typename A>
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 AddToHash(uint32_t aHash, A* aA)
 {
   /*
    * You might think this function should just take a void*.  But then we'd only
    * catch data pointers and couldn't handle function pointers.
    */
 
   static_assert(sizeof(aA) == sizeof(uintptr_t), "Strange pointer!");
 
   return detail::AddUintptrToHash<sizeof(uintptr_t)>(aHash, uintptr_t(aA));
 }
 
 template<>
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 AddToHash(uint32_t aHash, uintptr_t aA)
 {
   return detail::AddUintptrToHash<sizeof(uintptr_t)>(aHash, aA);
 }
 
 template<typename A, typename... Args>
-MOZ_WARN_UNUSED_RESULT uint32_t
+MOZ_MUST_USE uint32_t
 AddToHash(uint32_t aHash, A aArg, Args... aArgs)
 {
   return AddToHash(AddToHash(aHash, aArg), aArgs...);
 }
 
 /**
  * The HashGeneric class of functions let you hash one or more values.
  *
  * If you want to hash together two values x and y, calling HashGeneric(x, y) is
  * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes
  * that x has already been hashed.
  */
 template<typename... Args>
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashGeneric(Args... aArgs)
 {
   return AddToHash(0, aArgs...);
 }
 
 namespace detail {
 
 template<typename T>
@@ -235,84 +235,84 @@ HashKnownLength(const T* aStr, size_t aL
 } /* namespace detail */
 
 /**
  * The HashString overloads below do just what you'd expect.
  *
  * If you have the string's length, you might as well call the overload which
  * includes the length.  It may be marginally faster.
  */
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const char* aStr)
 {
   return detail::HashUntilZero(reinterpret_cast<const unsigned char*>(aStr));
 }
 
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const char* aStr, size_t aLength)
 {
   return detail::HashKnownLength(reinterpret_cast<const unsigned char*>(aStr), aLength);
 }
 
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 inline uint32_t
 HashString(const unsigned char* aStr, size_t aLength)
 {
   return detail::HashKnownLength(aStr, aLength);
 }
 
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const uint16_t* aStr)
 {
   return detail::HashUntilZero(aStr);
 }
 
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const uint16_t* aStr, size_t aLength)
 {
   return detail::HashKnownLength(aStr, aLength);
 }
 
 #ifdef MOZ_CHAR16_IS_NOT_WCHAR
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const char16_t* aStr)
 {
   return detail::HashUntilZero(aStr);
 }
 
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const char16_t* aStr, size_t aLength)
 {
   return detail::HashKnownLength(aStr, aLength);
 }
 #endif
 
 /*
  * On Windows, wchar_t (char16_t) is not the same as uint16_t, even though it's
  * the same width!
  */
 #ifdef WIN32
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const wchar_t* aStr)
 {
   return detail::HashUntilZero(aStr);
 }
 
-MOZ_WARN_UNUSED_RESULT inline uint32_t
+MOZ_MUST_USE inline uint32_t
 HashString(const wchar_t* aStr, size_t aLength)
 {
   return detail::HashKnownLength(aStr, aLength);
 }
 #endif
 
 /**
  * Hash some number of bytes.
  *
  * This hash walks word-by-word, rather than byte-by-byte, so you won't get the
  * same result out of HashBytes as you would out of HashString.
  */
-MOZ_WARN_UNUSED_RESULT extern MFBT_API uint32_t
+MOZ_MUST_USE extern MFBT_API uint32_t
 HashBytes(const void* bytes, size_t aLength);
 
 } /* namespace mozilla */
 #endif /* __cplusplus */
 
 #endif /* mozilla_HashFunctions_h */
--- a/mfbt/SegmentedVector.h
+++ b/mfbt/SegmentedVector.h
@@ -154,17 +154,17 @@ public:
       n += segment->Length();
     }
     return n;
   }
 
   // Returns false if the allocation failed. (If you are using an infallible
   // allocation policy, use InfallibleAppend() instead.)
   template<typename U>
-  MOZ_WARN_UNUSED_RESULT bool Append(U&& aU)
+  MOZ_MUST_USE bool Append(U&& aU)
   {
     Segment* last = mSegments.getLast();
     if (!last || last->Length() == kSegmentCapacity) {
       last = this->template pod_malloc<Segment>(1);
       if (!last) {
         return false;
       }
       new (last) Segment();
--- a/mfbt/ThreadLocal.h
+++ b/mfbt/ThreadLocal.h
@@ -126,17 +126,17 @@ public:
   // __thread does not allow non-trivial constructors, but we can
   // instead rely on zero-initialization.
 #ifndef MOZ_HAS_THREAD_LOCAL
   ThreadLocal()
     : mKey(0), mInited(false)
   {}
 #endif
 
-  MOZ_WARN_UNUSED_RESULT inline bool init();
+  MOZ_MUST_USE inline bool init();
 
   inline T get() const;
 
   inline void set(const T aValue);
 
 private:
 #ifdef MOZ_HAS_THREAD_LOCAL
   T mValue;
--- a/mfbt/UniquePtr.h
+++ b/mfbt/UniquePtr.h
@@ -323,17 +323,17 @@ public:
 
   explicit operator bool() const { return get() != nullptr; }
 
   Pointer get() const { return ptr(); }
 
   DeleterType& get_deleter() { return del(); }
   const DeleterType& get_deleter() const { return del(); }
 
-  MOZ_WARN_UNUSED_RESULT Pointer release()
+  MOZ_MUST_USE Pointer release()
   {
     Pointer p = ptr();
     ptr() = nullptr;
     return p;
   }
 
   void reset(Pointer aPtr = Pointer())
   {
@@ -458,17 +458,17 @@ public:
   explicit operator bool() const { return get() != nullptr; }
 
   T& operator[](decltype(sizeof(int)) aIndex) const { return get()[aIndex]; }
   Pointer get() const { return mTuple.first(); }
 
   DeleterType& get_deleter() { return mTuple.second(); }
   const DeleterType& get_deleter() const { return mTuple.second(); }
 
-  MOZ_WARN_UNUSED_RESULT Pointer release()
+  MOZ_MUST_USE Pointer release()
   {
     Pointer p = mTuple.first();
     mTuple.first() = nullptr;
     return p;
   }
 
   void reset(Pointer aPtr = Pointer())
   {
--- a/mfbt/Vector.h
+++ b/mfbt/Vector.h
@@ -263,19 +263,19 @@ class Vector final : private AllocPolicy
   /* utilities */
 
   static const bool kElemIsPod = IsPod<T>::value;
   typedef detail::VectorImpl<T, MinInlineCapacity, AllocPolicy, kElemIsPod> Impl;
   friend struct detail::VectorImpl<T, MinInlineCapacity, AllocPolicy, kElemIsPod>;
 
   friend struct detail::VectorTesting;
 
-  MOZ_WARN_UNUSED_RESULT bool growStorageBy(size_t aIncr);
-  MOZ_WARN_UNUSED_RESULT bool convertToHeapStorage(size_t aNewCap);
-  MOZ_WARN_UNUSED_RESULT bool maybeCheckSimulatedOOM(size_t aRequestedSize);
+  MOZ_MUST_USE bool growStorageBy(size_t aIncr);
+  MOZ_MUST_USE bool convertToHeapStorage(size_t aNewCap);
+  MOZ_MUST_USE bool maybeCheckSimulatedOOM(size_t aRequestedSize);
 
   /* magic constants */
 
   static const int kMaxInlineBytes = 1024;
 
   /* compute constants */
 
   /*
@@ -510,53 +510,53 @@ public:
    * Reverse the order of the elements in the vector in place.
    */
   void reverse();
 
   /**
    * Given that the vector is empty and has no inline storage, grow to
    * |capacity|.
    */
-  MOZ_WARN_UNUSED_RESULT bool initCapacity(size_t aRequest);
+  MOZ_MUST_USE bool initCapacity(size_t aRequest);
 
   /**
    * If reserve(aRequest) succeeds and |aRequest >= length()|, then appending
    * |aRequest - length()| elements, in any sequence of append/appendAll calls,
    * is guaranteed to succeed.
    *
    * A request to reserve an amount less than the current length does not affect
    * reserved space.
    */
-  MOZ_WARN_UNUSED_RESULT bool reserve(size_t aRequest);
+  MOZ_MUST_USE bool reserve(size_t aRequest);
 
   /**
    * Destroy elements in the range [end() - aIncr, end()). Does not deallocate
    * or unreserve storage for those elements.
    */
   void shrinkBy(size_t aIncr);
 
   /**
    * Destroy elements in the range [aNewLength, end()). Does not deallocate
    * or unreserve storage for those elements.
    */
   void shrinkTo(size_t aNewLength);
 
   /** Grow the vector by aIncr elements. */
-  MOZ_WARN_UNUSED_RESULT bool growBy(size_t aIncr);
+  MOZ_MUST_USE bool growBy(size_t aIncr);
 
   /** Call shrinkBy or growBy based on whether newSize > length(). */
-  MOZ_WARN_UNUSED_RESULT bool resize(size_t aNewLength);
+  MOZ_MUST_USE bool resize(size_t aNewLength);
 
   /**
    * Increase the length of the vector, but don't initialize the new elements
    * -- leave them as uninitialized memory.
    */
-  MOZ_WARN_UNUSED_RESULT bool growByUninitialized(size_t aIncr);
+  MOZ_MUST_USE bool growByUninitialized(size_t aIncr);
   void infallibleGrowByUninitialized(size_t aIncr);
-  MOZ_WARN_UNUSED_RESULT bool resizeUninitialized(size_t aNewLength);
+  MOZ_MUST_USE bool resizeUninitialized(size_t aNewLength);
 
   /** Shorthand for shrinkBy(length()). */
   void clear();
 
   /** Clears and releases any heap-allocated storage. */
   void clearAndFree();
 
   /**
@@ -569,35 +569,35 @@ public:
 
   /** Potentially fallible append operations. */
 
   /**
    * This can take either a T& or a T&&. Given a T&&, it moves |aU| into the
    * vector, instead of copying it. If it fails, |aU| is left unmoved. ("We are
    * not amused.")
    */
-  template<typename U> MOZ_WARN_UNUSED_RESULT bool append(U&& aU);
+  template<typename U> MOZ_MUST_USE bool append(U&& aU);
 
   /**
    * Construct a T in-place as a new entry at the end of this vector.
    */
   template<typename... Args>
-  MOZ_WARN_UNUSED_RESULT bool emplaceBack(Args&&... aArgs)
+  MOZ_MUST_USE bool emplaceBack(Args&&... aArgs)
   {
     if (!growByUninitialized(1))
       return false;
     Impl::new_(&back(), Forward<Args>(aArgs)...);
     return true;
   }
 
   template<typename U, size_t O, class BP>
-  MOZ_WARN_UNUSED_RESULT bool appendAll(const Vector<U, O, BP>& aU);
-  MOZ_WARN_UNUSED_RESULT bool appendN(const T& aT, size_t aN);
-  template<typename U> MOZ_WARN_UNUSED_RESULT bool append(const U* aBegin, const U* aEnd);
-  template<typename U> MOZ_WARN_UNUSED_RESULT bool append(const U* aBegin, size_t aLength);
+  MOZ_MUST_USE bool appendAll(const Vector<U, O, BP>& aU);
+  MOZ_MUST_USE bool appendN(const T& aT, size_t aN);
+  template<typename U> MOZ_MUST_USE bool append(const U* aBegin, const U* aEnd);
+  template<typename U> MOZ_MUST_USE bool append(const U* aBegin, size_t aLength);
 
   /*
    * Guaranteed-infallible append operations for use upon vectors whose
    * memory has been pre-reserved.  Don't use this if you haven't reserved the
    * memory!
    */
   template<typename U> void infallibleAppend(U&& aU)
   {
@@ -631,17 +631,17 @@ public:
    * unmodified.
    *
    * Otherwise return this vector's elements buffer, and clear this vector as if
    * by clearAndFree(). The caller now owns the buffer and is responsible for
    * deallocating it consistent with this vector's AllocPolicy.
    *
    * N.B. Although a T*, only the range [0, length()) is constructed.
    */
-  MOZ_WARN_UNUSED_RESULT T* extractRawBuffer();
+  MOZ_MUST_USE T* extractRawBuffer();
 
   /**
    * If elements are stored in-place, allocate a new buffer, move this vector's
    * elements into it, and return that buffer.
    *
    * Otherwise return this vector's elements buffer. The caller now owns the
    * buffer and is responsible for deallocating it consistent with this vector's
    * AllocPolicy.
@@ -649,17 +649,17 @@ public:
    * This vector is cleared, as if by clearAndFree(), when this method
    * succeeds. This method fails and returns nullptr only if new elements buffer
    * allocation fails.
    *
    * N.B. Only the range [0, length()) of the returned buffer is constructed.
    * If any of these elements are uninitialized (as growByUninitialized
    * enables), behavior is undefined.
    */
-  MOZ_WARN_UNUSED_RESULT T* extractOrCopyRawBuffer();
+  MOZ_MUST_USE T* extractOrCopyRawBuffer();
 
   /**
    * Transfer ownership of an array of objects into the vector.  The caller
    * must have allocated the array in accordance with this vector's
    * AllocPolicy.
    *
    * N.B. This call assumes that there are no uninitialized elements in the
    *      passed array.
@@ -677,17 +677,17 @@ public:
    *   if (!(p = vec.insert(p, val))) {
    *     <handle failure>
    *   }
    *   <keep working with p>
    *
    * This is inherently a linear-time operation.  Be careful!
    */
   template<typename U>
-  MOZ_WARN_UNUSED_RESULT T* insert(T* aP, U&& aVal);
+  MOZ_MUST_USE T* insert(T* aP, U&& aVal);
 
   /**
    * Removes the element |aT|, which must fall in the bounds [begin, end),
    * shifting existing elements from |aT + 1| onward one position lower.
    */
   void erase(T* aT);
 
   /**
--- a/mfbt/tests/TestSegmentedVector.cpp
+++ b/mfbt/tests/TestSegmentedVector.cpp
@@ -30,17 +30,17 @@ public:
     }
     return rv;
   }
 
   void free_(void* aPtr) { free(aPtr); }
 };
 
 // We want to test Append(), which is fallible and marked with
-// MOZ_WARN_UNUSED_RESULT. But we're using an infallible alloc policy, and so
+// MOZ_MUST_USE. But we're using an infallible alloc policy, and so
 // don't really need to check the result. Casting to |void| works with clang
 // but not GCC, so we instead use this dummy variable which works with both
 // compilers.
 static int gDummy;
 
 // This tests basic segmented vector construction and iteration.
 void TestBasics()
 {
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -564,17 +564,17 @@ nsresult NS_BackgroundInputStream(nsIInp
 // returns the output end of a pipe.  the input end of the pipe
 // is attached to the original stream.  data written to the pipe
 // is copied to the original stream on a background thread.
 nsresult NS_BackgroundOutputStream(nsIOutputStream **result,
                                    nsIOutputStream  *stream,
                                    uint32_t          segmentSize  = 0,
                                    uint32_t          segmentCount = 0);
 
-MOZ_WARN_UNUSED_RESULT nsresult
+MOZ_MUST_USE nsresult
 NS_NewBufferedInputStream(nsIInputStream **result,
                           nsIInputStream  *str,
                           uint32_t         bufferSize);
 
 // note: the resulting stream can be QI'ed to nsISafeOutputStream iff the
 // provided stream supports it.
 nsresult NS_NewBufferedOutputStream(nsIOutputStream **result,
                                     nsIOutputStream  *str,
--- a/netwerk/base/nsNetUtilInlines.h
+++ b/netwerk/base/nsNetUtilInlines.h
@@ -321,17 +321,17 @@ NS_NewLocalFileOutputStream(nsIOutputStr
     if (NS_SUCCEEDED(rv)) {
         rv = out->Init(file, ioFlags, perm, behaviorFlags);
         if (NS_SUCCEEDED(rv))
             out.forget(result);
     }
     return rv;
 }
 
-INLINE_IF_EXTERN MOZ_WARN_UNUSED_RESULT nsresult
+INLINE_IF_EXTERN MOZ_MUST_USE nsresult
 NS_NewBufferedInputStream(nsIInputStream **result,
                           nsIInputStream  *str,
                           uint32_t         bufferSize)
 {
     nsresult rv;
     nsCOMPtr<nsIBufferedInputStream> in =
         do_CreateInstance(NS_BUFFEREDINPUTSTREAM_CONTRACTID, &rv);
     if (NS_SUCCEEDED(rv)) {
--- a/netwerk/cache2/CacheFileChunk.cpp
+++ b/netwerk/cache2/CacheFileChunk.cpp
@@ -656,17 +656,17 @@ CacheFileChunk::BufForReading() const
   mFile->AssertOwnsLock();
 
   MOZ_ASSERT((mState == READY && mBuf && !mRWBuf) ||
              (mState == WRITING && mRWBuf));
 
   return mBuf ? mBuf : mRWBuf;
 }
 
-MOZ_WARN_UNUSED_RESULT nsresult
+MOZ_MUST_USE nsresult
 CacheFileChunk::EnsureBufSize(uint32_t aBufSize)
 {
   mFile->AssertOwnsLock();
 
   // EnsureBufSize() is called only when we want to write some data to the chunk
   // and we never write data anymore once some error occurs.
   MOZ_ASSERT(NS_SUCCEEDED(mStatus));
 
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -65,17 +65,17 @@ CreateDummyChannel(nsIURI* aHostURI, Nec
   return;
 }
 
 }
 
 namespace mozilla {
 namespace net {
 
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
 bool
 CookieServiceParent::GetOriginAttributesFromParams(const IPC::SerializedLoadContext &aLoadContext,
                                                    NeckoOriginAttributes& aAttrs,
                                                    bool& aIsPrivate)
 {
   aIsPrivate = false;
 
   DocShellOriginAttributes docShellAttrs;
--- a/netwerk/cookie/CookieServiceParent.h
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -17,17 +17,17 @@ namespace net {
 
 class CookieServiceParent : public PCookieServiceParent
 {
 public:
   CookieServiceParent();
   virtual ~CookieServiceParent();
 
 protected:
-  MOZ_WARN_UNUSED_RESULT bool
+  MOZ_MUST_USE bool
   GetOriginAttributesFromParams(const IPC::SerializedLoadContext &aLoadContext,
                                 NeckoOriginAttributes& aAttrs,
                                 bool& aIsPrivate);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   virtual bool RecvGetCookieString(const URIParams& aHost,
                                    const bool& aIsForeign,
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -30,30 +30,30 @@ enum PBOverrideStatus {
 class NeckoParent
   : public PNeckoParent
   , public DisconnectableParent
 {
 public:
   NeckoParent();
   virtual ~NeckoParent();
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static const char *
   GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
                       PContentParent* aBrowser,
                       mozilla::DocShellOriginAttributes& aAttrs);
 
   /*
    * Creates LoadContext for parent-side of an e10s channel.
    *
    * PContentParent corresponds to the process that is requesting the load.
    *
    * Returns null if successful, or an error string if failed.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   static const char*
   CreateChannelLoadContext(const PBrowserOrId& aBrowser,
                            PContentParent* aContent,
                            const SerializedLoadContext& aSerialized,
                            nsCOMPtr<nsILoadContext> &aResult);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
   virtual nsresult OfflineNotification(nsISupports *) override;
--- a/netwerk/sctp/datachannel/DataChannel.h
+++ b/netwerk/sctp/datachannel/DataChannel.h
@@ -138,17 +138,17 @@ public:
 #endif
 
   typedef enum {
     RELIABLE=0,
     PARTIAL_RELIABLE_REXMIT = 1,
     PARTIAL_RELIABLE_TIMED = 2
   } Type;
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   already_AddRefed<DataChannel> Open(const nsACString& label,
                                      const nsACString& protocol,
                                      Type type, bool inOrder,
                                      uint32_t prValue,
                                      DataChannelListener *aListener,
                                      nsISupports *aContext,
                                      bool aExternalNegotiated,
                                      uint16_t aStream);
--- a/security/manager/ssl/nsNSSComponent.h
+++ b/security/manager/ssl/nsNSSComponent.h
@@ -19,17 +19,17 @@
 #include "sslt.h"
 
 class nsIDOMWindow;
 class nsIPrompt;
 class SmartCardThreadList;
 
 namespace mozilla { namespace psm {
 
-MOZ_WARN_UNUSED_RESULT
+MOZ_MUST_USE
   ::already_AddRefed<mozilla::psm::SharedCertVerifier>
   GetDefaultCertVerifier();
 
 } } // namespace mozilla::psm
 
 
 #define NS_NSSCOMPONENT_CID \
 {0x4cb64dfd, 0xca98, 0x4e24, {0xbe, 0xfd, 0x0d, 0x92, 0x85, 0xa3, 0x3b, 0xcb}}
--- a/security/sandbox/linux/Sandbox.cpp
+++ b/security/sandbox/linux/Sandbox.cpp
@@ -207,17 +207,17 @@ InstallSigSysHandler(void)
  * program).  The kernel won't allow seccomp-bpf without doing this,
  * because otherwise it could be used for privilege escalation attacks.
  *
  * Returns false (and sets errno) on failure.
  *
  * @see SandboxInfo
  * @see BroadcastSetThreadSandbox
  */
-static bool MOZ_WARN_UNUSED_RESULT
+static bool MOZ_MUST_USE
 InstallSyscallFilter(const sock_fprog *aProg, bool aUseTSync)
 {
   if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
     SANDBOX_LOG_ERROR("prctl(PR_SET_NO_NEW_PRIVS) failed: %s", strerror(errno));
     MOZ_CRASH("prctl(PR_SET_NO_NEW_PRIVS)");
   }
 
   if (aUseTSync) {
--- a/toolkit/components/url-classifier/HashStore.h
+++ b/toolkit/components/url-classifier/HashStore.h
@@ -34,38 +34,37 @@ public:
       mAddPrefixes.Length() == 0 &&
       mSubPrefixes.Length() == 0 &&
       mAddCompletes.Length() == 0 &&
       mSubCompletes.Length() == 0;
   }
 
   // Throughout, uint32_t aChunk refers only to the chunk number. Chunk data is
   // stored in the Prefix structures.
-  MOZ_WARN_UNUSED_RESULT nsresult NewAddChunk(uint32_t aChunk) {
+  MOZ_MUST_USE nsresult NewAddChunk(uint32_t aChunk) {
     return mAddChunks.Set(aChunk);
   };
-  MOZ_WARN_UNUSED_RESULT nsresult NewSubChunk(uint32_t aChunk) {
+  MOZ_MUST_USE nsresult NewSubChunk(uint32_t aChunk) {
     return mSubChunks.Set(aChunk);
   };
-  MOZ_WARN_UNUSED_RESULT nsresult NewAddExpiration(uint32_t aChunk) {
+  MOZ_MUST_USE nsresult NewAddExpiration(uint32_t aChunk) {
     return mAddExpirations.Set(aChunk);
   };
-  MOZ_WARN_UNUSED_RESULT nsresult NewSubExpiration(uint32_t aChunk) {
+  MOZ_MUST_USE nsresult NewSubExpiration(uint32_t aChunk) {
     return mSubExpirations.Set(aChunk);
   };
-  MOZ_WARN_UNUSED_RESULT nsresult NewAddPrefix(uint32_t aAddChunk,
-                                               const Prefix& aPrefix);
-  MOZ_WARN_UNUSED_RESULT nsresult NewSubPrefix(uint32_t aAddChunk,
-                                               const Prefix& aPrefix,
-                                               uint32_t aSubChunk);
-  MOZ_WARN_UNUSED_RESULT nsresult NewAddComplete(uint32_t aChunk,
-                                                 const Completion& aCompletion);
-  MOZ_WARN_UNUSED_RESULT nsresult NewSubComplete(uint32_t aAddChunk,
-                                                 const Completion& aCompletion,
-                                                 uint32_t aSubChunk);
+  MOZ_MUST_USE nsresult NewAddPrefix(uint32_t aAddChunk, const Prefix& aPrefix);
+  MOZ_MUST_USE nsresult NewSubPrefix(uint32_t aAddChunk,
+                                     const Prefix& aPrefix,
+                                     uint32_t aSubChunk);
+  MOZ_MUST_USE nsresult NewAddComplete(uint32_t aChunk,
+                                       const Completion& aCompletion);
+  MOZ_MUST_USE nsresult NewSubComplete(uint32_t aAddChunk,
+                                       const Completion& aCompletion,
+                                       uint32_t aSubChunk);
   void SetLocalUpdate(void) { mLocalUpdate = true; }
   bool IsLocalUpdate(void) { return mLocalUpdate; }
 
   ChunkSet& AddChunks() { return mAddChunks; }
   ChunkSet& SubChunks() { return mSubChunks; }
 
   // Expirations for chunks.
   ChunkSet& AddExpirations() { return mAddExpirations; }
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ b/toolkit/identity/IdentityCryptoService.cpp
@@ -316,17 +316,17 @@ KeyPair::Sign(const nsACString & textToS
 KeyGenRunnable::KeyGenRunnable(KeyType keyType,
                                nsIIdentityKeyGenCallback * callback)
   : mKeyType(keyType)
   , mCallback(new nsMainThreadPtrHolder<nsIIdentityKeyGenCallback>(callback))
   , mRv(NS_ERROR_NOT_INITIALIZED)
 {
 }
 
-MOZ_WARN_UNUSED_RESULT nsresult
+MOZ_MUST_USE nsresult
 GenerateKeyPair(PK11SlotInfo * slot,
                 SECKEYPrivateKey ** privateKey,
                 SECKEYPublicKey ** publicKey,
                 CK_MECHANISM_TYPE mechanism,
                 void * params)
 {
   *publicKey = nullptr;
   *privateKey = PK11_GenerateKeyPair(slot, mechanism, params, publicKey,
@@ -342,31 +342,31 @@ GenerateKeyPair(PK11SlotInfo * slot,
 	  *privateKey = nullptr;
     MOZ_CRASH("PK11_GnerateKeyPair returned private key without public key");
   }
 
   return NS_OK;
 }
 
 
-MOZ_WARN_UNUSED_RESULT nsresult
+MOZ_MUST_USE nsresult
 GenerateRSAKeyPair(PK11SlotInfo * slot,
                    SECKEYPrivateKey ** privateKey,
                    SECKEYPublicKey ** publicKey)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   PK11RSAGenParams rsaParams;
   rsaParams.keySizeInBits = 2048;
   rsaParams.pe = 0x10001;
   return GenerateKeyPair(slot, privateKey, publicKey, CKM_RSA_PKCS_KEY_PAIR_GEN,
                          &rsaParams);
 }
 
-MOZ_WARN_UNUSED_RESULT nsresult
+MOZ_MUST_USE nsresult
 GenerateDSAKeyPair(PK11SlotInfo * slot,
                    SECKEYPrivateKey ** privateKey,
                    SECKEYPublicKey ** publicKey)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   // XXX: These could probably be static const arrays, but this way we avoid
   // compiler warnings and also we avoid having to worry much about whether the
--- a/xpcom/ds/Tokenizer.h
+++ b/xpcom/ds/Tokenizer.h
@@ -110,39 +110,39 @@ public:
                      const char* aAdditionalWordChars = nullptr);
 
   /**
    * When there is still anything to read from the input, tokenize it, store the token type
    * and value to aToken result and shift the cursor past this just parsed token.  Each call
    * to Next() reads another token from the input and shifts the cursor.
    * Returns false if we have passed the end of the input.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool Next(Token& aToken);
 
   /**
    * Parse the token on the input read cursor position, check its type is equal to aTokenType
    * and if so, put it into aResult, shift the cursor and return true.  Otherwise, leave
    * the input read cursor position intact and return false.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool Check(const TokenType aTokenType, Token& aResult);
   /**
    * Same as above method, just compares both token type and token value passed in aToken.
    * When both the type and the value equals, shift the cursor and return true.  Otherwise
    * return false.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool Check(const Token& aToken);
 
   /**
    * Return false iff the last Check*() call has returned false or when we've read past
    * the end of the input string.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool HasFailed() const;
 
   /**
    * SkipWhites method (below) may also skip new line characters automatically.
    */
   enum WhiteSkipping {
     /**
      * SkipWhites will only skip what is defined as a white space (default).
@@ -161,54 +161,54 @@ public:
    */
   void SkipWhites(WhiteSkipping aIncludeNewLines = DONT_INCLUDE_NEW_LINE);
 
   // These are mostly shortcuts for the Check() methods above.
 
   /**
    * Check whitespace character is present.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckWhite() { return Check(Token::Whitespace()); }
   /**
    * Check there is a single character on the read cursor position.  If so, shift the read
    * cursor position and return true.  Otherwise false.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckChar(const char aChar) { return Check(Token::Char(aChar)); }
   /**
    * This is a customizable version of CheckChar.  aClassifier is a function called with
    * value of the character on the current input read position.  If this user function
    * returns true, read cursor is shifted and true returned.  Otherwise false.
    * The user classifiction function is not called when we are at or past the end and
    * false is immediately returned.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckChar(bool (*aClassifier)(const char aChar));
   /**
    * Check for a whole expected word.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckWord(const nsACString& aWord) { return Check(Token::Word(aWord)); }
   /**
    * Shortcut for literal const word check with compile time length calculation.
    */
   template <uint32_t N>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckWord(const char (&aWord)[N]) { return Check(Token::Word(nsDependentCString(aWord, N - 1))); }
   /**
    * Checks \r, \n or \r\n.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckEOL() { return Check(Token::NewLine()); }
   /**
    * Checks we are at the end of the input string reading.  If so, shift past the end
    * and returns true.  Otherwise does nothing and returns false.
    */
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool CheckEOF() { return Check(Token::EndOfFile()); }
 
   /**
    * These are shortcuts to obtain the value immediately when the token type matches.
    */
   bool ReadChar(char* aValue);
   bool ReadChar(bool (*aClassifier)(const char aChar), char* aValue);
   bool ReadWord(nsACString& aValue);
--- a/xpcom/glue/nsBaseHashtable.h
+++ b/xpcom/glue/nsBaseHashtable.h
@@ -122,18 +122,18 @@ public:
    */
   void Put(KeyType aKey, const UserDataType& aData)
   {
     if (!Put(aKey, aData, mozilla::fallible)) {
       NS_ABORT_OOM(this->mTable.EntrySize() * this->mTable.EntryCount());
     }
   }
 
-  MOZ_WARN_UNUSED_RESULT bool Put(KeyType aKey, const UserDataType& aData,
-                                  const fallible_t&)
+  MOZ_MUST_USE bool Put(KeyType aKey, const UserDataType& aData,
+                        const fallible_t&)
   {
     EntryType* ent = this->PutEntry(aKey);
     if (!ent) {
       return false;
     }
 
     ent->mData = aData;
 
--- a/xpcom/glue/nsDeque.h
+++ b/xpcom/glue/nsDeque.h
@@ -83,31 +83,31 @@ public:
    */
   void Push(void* aItem)
   {
     if (!Push(aItem, mozilla::fallible)) {
       NS_ABORT_OOM(mSize * sizeof(void*));
     }
   }
 
-  MOZ_WARN_UNUSED_RESULT bool Push(void* aItem, const fallible_t&);
+  MOZ_MUST_USE bool Push(void* aItem, const fallible_t&);
 
   /**
    * Inserts new member at the front of the deque.
    *
    * @param   item to store in deque
    */
   void PushFront(void* aItem)
   {
     if (!PushFront(aItem, mozilla::fallible)) {
       NS_ABORT_OOM(mSize * sizeof(void*));
     }
   }
 
-  MOZ_WARN_UNUSED_RESULT bool PushFront(void* aItem, const fallible_t&);
+  MOZ_MUST_USE bool PushFront(void* aItem, const fallible_t&);
 
   /**
    * Remove and return the last item in the container.
    *
    * @return  the item that was the last item in container
    */
   void* Pop();
 
--- a/xpcom/glue/nsRefPtrHashtable.h
+++ b/xpcom/glue/nsRefPtrHashtable.h
@@ -49,18 +49,18 @@ public:
    */
   PtrType* GetWeak(KeyType aKey, bool* aFound = nullptr) const;
 
   // Overload Put, rather than overriding it.
   using base_type::Put;
 
   void Put(KeyType aKey, already_AddRefed<PtrType> aData);
 
-  MOZ_WARN_UNUSED_RESULT bool Put(KeyType aKey, already_AddRefed<PtrType> aData,
-                                  const mozilla::fallible_t&);
+  MOZ_MUST_USE bool Put(KeyType aKey, already_AddRefed<PtrType> aData,
+                        const mozilla::fallible_t&);
 
   // Overload Remove, rather than overriding it.
   using base_type::Remove;
 
   /**
    * Remove the data for the associated key, swapping the current value into
    * pData, thereby avoiding calls to AddRef and Release.
    * @param aKey the key to remove from the hashtable
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -1191,17 +1191,17 @@ public:
       const nsTArray_Impl<E, Allocator>& aOther)
   {
     return ActualAlloc::ConvertBoolToResultType(
       !!ReplaceElementsAt<E, ActualAlloc>(0, Length(),
                                           aOther.Elements(), aOther.Length()));
   }
 
   template<class Allocator>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool Assign(const nsTArray_Impl<E, Allocator>& aOther,
               const mozilla::fallible_t&)
   {
     return Assign<Allocator, FallibleAlloc>(aOther);
   }
 
   template<class Allocator>
   void Assign(nsTArray_Impl<E, Allocator>&& aOther)
@@ -1272,17 +1272,17 @@ protected:
                                           sizeof(elem_type),
                                           MOZ_ALIGNOF(elem_type));
     AssignRange(aStart, aArrayLen, aArray);
     return Elements() + aStart;
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                                const Item* aArray, size_type aArrayLen,
                                const mozilla::fallible_t&)
   {
     return ReplaceElementsAt<Item, FallibleAlloc>(aStart, aCount,
                                                   aArray, aArrayLen);
   }
 
@@ -1293,17 +1293,17 @@ protected:
                                const nsTArray<Item>& aArray)
   {
     return ReplaceElementsAt<Item, ActualAlloc>(
       aStart, aCount, aArray.Elements(), aArray.Length());
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                                const nsTArray<Item>& aArray,
                                const mozilla::fallible_t&)
   {
     return ReplaceElementsAt<Item, FallibleAlloc>(aStart, aCount, aArray);
   }
 
   // A variation on the ReplaceElementsAt method defined above.
@@ -1312,17 +1312,17 @@ protected:
   elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                                const Item& aItem)
   {
     return ReplaceElementsAt<Item, ActualAlloc>(aStart, aCount, &aItem, 1);
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                                const Item& aItem, const mozilla::fallible_t&)
   {
     return ReplaceElementsAt<Item, FallibleAlloc>(aStart, aCount, aItem);
   }
 
   // A variation on the ReplaceElementsAt method defined above.
   template<class Item>
@@ -1337,17 +1337,17 @@ protected:
   elem_type* InsertElementsAt(index_type aIndex, const Item* aArray,
                               size_type aArrayLen)
   {
     return ReplaceElementsAt<Item, ActualAlloc>(aIndex, 0, aArray, aArrayLen);
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementsAt(index_type aIndex, const Item* aArray,
                               size_type aArrayLen, const mozilla::fallible_t&)
   {
     return InsertElementsAt<Item, FallibleAlloc>(aIndex, aArray, aArrayLen);
   }
 
   // A variation on the ReplaceElementsAt method defined above.
 protected:
@@ -1356,17 +1356,17 @@ protected:
                               const nsTArray_Impl<Item, Allocator>& aArray)
   {
     return ReplaceElementsAt<Item, ActualAlloc>(
       aIndex, 0, aArray.Elements(), aArray.Length());
   }
 public:
 
   template<class Item, class Allocator>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementsAt(index_type aIndex,
                               const nsTArray_Impl<Item, Allocator>& aArray,
                               const mozilla::fallible_t&)
   {
     return InsertElementsAt<Item, Allocator, FallibleAlloc>(aIndex, aArray);
   }
 
   // Insert a new element without copy-constructing. This is useful to avoid
@@ -1383,17 +1383,17 @@ protected:
     this->template ShiftData<ActualAlloc>(aIndex, 0, 1, sizeof(elem_type),
                                           MOZ_ALIGNOF(elem_type));
     elem_type* elem = Elements() + aIndex;
     elem_traits::Construct(elem);
     return elem;
   }
 public:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementAt(index_type aIndex, const mozilla::fallible_t&)
   {
     return InsertElementAt<FallibleAlloc>(aIndex);
   }
 
   // Insert a new element, move constructing if possible.
 protected:
   template<class Item, typename ActualAlloc = Alloc>
@@ -1407,17 +1407,17 @@ protected:
                                           MOZ_ALIGNOF(elem_type));
     elem_type* elem = Elements() + aIndex;
     elem_traits::Construct(elem, mozilla::Forward<Item>(aItem));
     return elem;
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementAt(index_type aIndex, Item&& aItem,
                              const mozilla::fallible_t&)
   {
     return InsertElementAt<Item, FallibleAlloc>(aIndex,
                                                 mozilla::Forward<Item>(aItem));
   }
 
   // This method searches for the smallest index of an element that is strictly
@@ -1464,17 +1464,17 @@ protected:
   {
     index_type index = IndexOfFirstElementGt<Item, Comparator>(aItem, aComp);
     return InsertElementAt<Item, ActualAlloc>(
       index, mozilla::Forward<Item>(aItem));
   }
 public:
 
   template<class Item, class Comparator>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementSorted(Item&& aItem, const Comparator& aComp,
                                  const mozilla::fallible_t&)
   {
     return InsertElementSorted<Item, Comparator, FallibleAlloc>(
       mozilla::Forward<Item>(aItem), aComp);
   }
 
   // A variation on the InsertElementSorted method defined above.
@@ -1484,17 +1484,17 @@ protected:
   {
     nsDefaultComparator<elem_type, Item> comp;
     return InsertElementSorted<Item, decltype(comp), ActualAlloc>(
       mozilla::Forward<Item>(aItem), comp);
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementSorted(Item&& aItem, const mozilla::fallible_t&)
   {
     return InsertElementSorted<Item, FallibleAlloc>(
       mozilla::Forward<Item>(aItem));
   }
 
   // This method appends elements to the end of this array.
   // @param aArray    The elements to append to this array.
@@ -1512,34 +1512,34 @@ protected:
     index_type len = Length();
     AssignRange(len, aArrayLen, aArray);
     this->IncrementLength(aArrayLen);
     return Elements() + len;
   }
 public:
 
   template<class Item>
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElements(const Item* aArray, size_type aArrayLen,
                             const mozilla::fallible_t&)
   {
     return AppendElements<Item, FallibleAlloc>(aArray, aArrayLen);
   }
 
   // A variation on the AppendElements method defined above.
 protected:
   template<class Item, class Allocator, typename ActualAlloc = Alloc>
   elem_type* AppendElements(const nsTArray_Impl<Item, Allocator>& aArray)
   {
     return AppendElements<Item, ActualAlloc>(aArray.Elements(), aArray.Length());
   }
 public:
 
   template<class Item, class Allocator>
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElements(const nsTArray_Impl<Item, Allocator>& aArray,
                             const mozilla::fallible_t&)
   {
     return AppendElements<Item, Allocator, FallibleAlloc>(aArray);
   }
 
   // Move all elements from another array to the end of this array.
   // @return A pointer to the newly appended elements, or null on OOM.
@@ -1564,17 +1564,17 @@ protected:
     this->IncrementLength(otherLen);
     aArray.template ShiftData<Alloc>(0, otherLen, 0, sizeof(elem_type),
                                      MOZ_ALIGNOF(elem_type));
     return Elements() + len;
   }
 public:
 
   template<class Item, class Allocator, typename ActualAlloc = Alloc>
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElements(nsTArray_Impl<Item, Allocator>&& aArray,
                             const mozilla::fallible_t&)
   {
     return AppendElements<Item, Allocator>(mozilla::Move(aArray));
   }
 
   // Append a new element, move constructing if possible.
 protected:
@@ -1588,17 +1588,17 @@ protected:
     elem_type* elem = Elements() + Length();
     elem_traits::Construct(elem, mozilla::Forward<Item>(aItem));
     this->IncrementLength(1);
     return elem;
   }
 public:
 
   template<class Item>
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElement(Item&& aItem,
                            const mozilla::fallible_t&)
   {
     return AppendElement<Item, FallibleAlloc>(mozilla::Forward<Item>(aItem));
   }
 
   // Append new elements without copy-constructing. This is useful to avoid
   // temporaries.
@@ -1615,17 +1615,17 @@ protected:
     for (i = 0; i < aCount; ++i) {
       elem_traits::Construct(elems + i);
     }
     this->IncrementLength(aCount);
     return elems;
   }
 public:
 
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElements(size_type aCount,
                             const mozilla::fallible_t&)
   {
     return AppendElements<FallibleAlloc>(aCount);
   }
 
   // Append a new element without copy-constructing. This is useful to avoid
   // temporaries.
@@ -1633,17 +1633,17 @@ public:
 protected:
   template<typename ActualAlloc = Alloc>
   elem_type* AppendElement()
   {
     return AppendElements<ActualAlloc>(1);
   }
 public:
 
-  /* MOZ_WARN_UNUSED_RESULT */
+  /* MOZ_MUST_USE */
   elem_type* AppendElement(const mozilla::fallible_t&)
   {
     return AppendElement<FallibleAlloc>();
   }
 
   // This method removes a range of elements from this array.
   // @param aStart The starting index of the elements to remove.
   // @param aCount The number of elements to remove.
@@ -1737,17 +1737,17 @@ protected:
   template<typename ActualAlloc = Alloc>
   typename ActualAlloc::ResultType SetCapacity(size_type aCapacity)
   {
     return ActualAlloc::Result(this->template EnsureCapacity<ActualAlloc>(
       aCapacity, sizeof(elem_type)));
   }
 public:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool SetCapacity(size_type aCapacity, const mozilla::fallible_t&)
   {
     return SetCapacity<FallibleAlloc>(aCapacity);
   }
 
   // This method modifies the length of the array.  If the new length is
   // larger than the existing length of the array, then new elements will be
   // constructed using elem_type's default constructor.  Otherwise, this call
@@ -1766,17 +1766,17 @@ protected:
         InsertElementsAt<ActualAlloc>(oldLen, aNewLen - oldLen) != nullptr);
     }
 
     TruncateLength(aNewLen);
     return ActualAlloc::ConvertBoolToResultType(true);
   }
 public:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool SetLength(size_type aNewLen, const mozilla::fallible_t&)
   {
     return SetLength<FallibleAlloc>(aNewLen);
   }
 
   // This method modifies the length of the array, but may only be
   // called when the new length is shorter than the old.  It can
   // therefore be called when elem_type has no default constructor,
@@ -1805,17 +1805,17 @@ protected:
     if (aMinLen > oldLen) {
       return ActualAlloc::ConvertBoolToResultType(
         !!InsertElementsAt<ActualAlloc>(oldLen, aMinLen - oldLen));
     }
     return ActualAlloc::ConvertBoolToResultType(true);
   }
 public:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   bool EnsureLengthAtLeast(size_type aMinLen, const mozilla::fallible_t&)
   {
     return EnsureLengthAtLeast<FallibleAlloc>(aMinLen);
   }
 
   // This method inserts elements into the array, constructing
   // them using elem_type's default constructor.
   // @param aIndex the place to insert the new elements. This must be no
@@ -1837,17 +1837,17 @@ protected:
     for (; iter != iend; ++iter) {
       elem_traits::Construct(iter);
     }
 
     return Elements() + aIndex;
   }
 public:
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementsAt(index_type aIndex, size_type aCount,
                               const mozilla::fallible_t&)
   {
     return InsertElementsAt<FallibleAlloc>(aIndex, aCount);
   }
 
   // This method inserts elements into the array, constructing them
   // elem_type's copy constructor (or whatever one-arg constructor
@@ -1874,17 +1874,17 @@ protected:
       elem_traits::Construct(iter, aItem);
     }
 
     return Elements() + aIndex;
   }
 public:
 
   template<class Item>
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   elem_type* InsertElementsAt(index_type aIndex, size_type aCount,
                               const Item& aItem, const mozilla::fallible_t&)
   {
     return InsertElementsAt<Item, FallibleAlloc>(aIndex, aCount, aItem);
   }
 
   // This method may be called to minimize the memory used by this array.
   void Compact()
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -148,17 +148,17 @@ public:
                 can't be allocated
    */
   EntryType* PutEntry(KeyType aKey)
   {
     // infallible add
     return static_cast<EntryType*>(mTable.Add(EntryType::KeyToPointer(aKey)));
   }
 
-  MOZ_WARN_UNUSED_RESULT
+  MOZ_MUST_USE
   EntryType* PutEntry(KeyType aKey, const fallible_t&)
   {
     return static_cast<EntryType*>(mTable.Add(EntryType::KeyToPointer(aKey),
                                               mozilla::fallible));
   }
 
   /**
    * Remove the entry associated with a key.
--- a/xpcom/string/nsReadableUtils.h
+++ b/xpcom/string/nsReadableUtils.h
@@ -35,44 +35,43 @@ Distance(const nsReadingIterator<char>& 
 
 void LossyCopyUTF16toASCII(const nsAString& aSource, nsACString& aDest);
 void CopyASCIItoUTF16(const nsACString& aSource, nsAString& aDest);
 
 void LossyCopyUTF16toASCII(const char16ptr_t aSource, nsACString& aDest);
 void CopyASCIItoUTF16(const char* aSource, nsAString& aDest);
 
 void CopyUTF16toUTF8(const nsAString& aSource, nsACString& aDest);
-MOZ_WARN_UNUSED_RESULT bool CopyUTF16toUTF8(const nsAString& aSource,
-                                            nsACString& aDest,
-                                            const mozilla::fallible_t&);
+MOZ_MUST_USE bool CopyUTF16toUTF8(const nsAString& aSource, nsACString& aDest,
+                                  const mozilla::fallible_t&);
 void CopyUTF8toUTF16(const nsACString& aSource, nsAString& aDest);
 
 void CopyUTF16toUTF8(const char16ptr_t aSource, nsACString& aDest);
 void CopyUTF8toUTF16(const char* aSource, nsAString& aDest);
 
 void LossyAppendUTF16toASCII(const nsAString& aSource, nsACString& aDest);
 void AppendASCIItoUTF16(const nsACString& aSource, nsAString& aDest);
-MOZ_WARN_UNUSED_RESULT bool AppendASCIItoUTF16(const nsACString& aSource,
-                                               nsAString& aDest,
-                                               const mozilla::fallible_t&);
+MOZ_MUST_USE bool AppendASCIItoUTF16(const nsACString& aSource,
+                                     nsAString& aDest,
+                                     const mozilla::fallible_t&);
 
 void LossyAppendUTF16toASCII(const char16ptr_t aSource, nsACString& aDest);
-MOZ_WARN_UNUSED_RESULT     bool AppendASCIItoUTF16(const char* aSource,
-                                              nsAString& aDest,
-                                              const mozilla::fallible_t&);
+MOZ_MUST_USE bool AppendASCIItoUTF16(const char* aSource,
+                                     nsAString& aDest,
+                                     const mozilla::fallible_t&);
 void AppendASCIItoUTF16(const char* aSource, nsAString& aDest);
 
 void AppendUTF16toUTF8(const nsAString& aSource, nsACString& aDest);
-MOZ_WARN_UNUSED_RESULT bool AppendUTF16toUTF8(const nsAString& aSource,
-                                              nsACString& aDest,
-                                              const mozilla::fallible_t&);
+MOZ_MUST_USE bool AppendUTF16toUTF8(const nsAString& aSource,
+                                    nsACString& aDest,
+                                    const mozilla::fallible_t&);
 void AppendUTF8toUTF16(const nsACString& aSource, nsAString& aDest);
-MOZ_WARN_UNUSED_RESULT bool AppendUTF8toUTF16(const nsACString& aSource,
-                                              nsAString& aDest,
-                                              const mozilla::fallible_t&);
+MOZ_MUST_USE bool AppendUTF8toUTF16(const nsACString& aSource,
+                                    nsAString& aDest,
+                                    const mozilla::fallible_t&);
 
 void AppendUTF16toUTF8(const char16ptr_t aSource, nsACString& aDest);
 void AppendUTF8toUTF16(const char* aSource, nsAString& aDest);
 
 /**
  * Returns a new |char| buffer containing a zero-terminated copy of |aSource|.
  *
  * Allocates and returns a new |char| buffer which you must free with |free|.
--- a/xpcom/string/nsTString.h
+++ b/xpcom/string/nsTString.h
@@ -388,22 +388,22 @@ public:
 #endif
   /**
    * Replace all occurrences of aTarget with aNewValue.
    * The complexity of this function is O(n+m), n being the length of the string
    * and m being the length of aNewValue.
    */
   void ReplaceSubstring(const self_type& aTarget, const self_type& aNewValue);
   void ReplaceSubstring(const char_type* aTarget, const char_type* aNewValue);
-  MOZ_WARN_UNUSED_RESULT bool ReplaceSubstring(const self_type& aTarget,
-                                               const self_type& aNewValue,
-                                               const fallible_t&);
-  MOZ_WARN_UNUSED_RESULT bool ReplaceSubstring(const char_type* aTarget,
-                                               const char_type* aNewValue,
-                                               const fallible_t&);
+  MOZ_MUST_USE bool ReplaceSubstring(const self_type& aTarget,
+                                     const self_type& aNewValue,
+                                     const fallible_t&);
+  MOZ_MUST_USE bool ReplaceSubstring(const char_type* aTarget,
+                                     const char_type* aNewValue,
+                                     const fallible_t&);
 
 
   /**
    *  This method trims characters found in aTrimSet from
    *  either end of the underlying string.
    *
    *  @param   aSet -- contains chars to be trimmed from both ends
    *  @param   aEliminateLeading
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -356,66 +356,63 @@ public:
     return LowerCaseEqualsASCII(aStr, N - 1);
   }
 
   /**
    * assignment
    */
 
   void NS_FASTCALL Assign(char_type aChar);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(char_type aChar,
-                                                 const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Assign(char_type aChar, const fallible_t&);
 
   void NS_FASTCALL Assign(const char_type* aData);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
-                                                 const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Assign(const char_type* aData,
+                                       const fallible_t&);
 
   void NS_FASTCALL Assign(const char_type* aData, size_type aLength);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
-                                                 size_type aLength,
-                                                 const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Assign(const char_type* aData,
+                                       size_type aLength, const fallible_t&);
 
   void NS_FASTCALL Assign(const self_type&);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const self_type&,
-                                                 const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Assign(const self_type&, const fallible_t&);
 
   void NS_FASTCALL Assign(const substring_tuple_type&);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const substring_tuple_type&,
-                                                 const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Assign(const substring_tuple_type&,
+                                       const fallible_t&);
 
 #if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
   void Assign(char16ptr_t aData)
   {
     Assign(static_cast<const char16_t*>(aData));
   }
 
   void Assign(char16ptr_t aData, size_type aLength)
   {
     Assign(static_cast<const char16_t*>(aData), aLength);
   }
 
-  MOZ_WARN_UNUSED_RESULT bool Assign(char16ptr_t aData, size_type aLength,
-                                     const fallible_t& aFallible)
+  MOZ_MUST_USE bool Assign(char16ptr_t aData, size_type aLength,
+                           const fallible_t& aFallible)
   {
     return Assign(static_cast<const char16_t*>(aData), aLength,
                   aFallible);
   }
 #endif
 
   void NS_FASTCALL AssignASCII(const char* aData, size_type aLength);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL AssignASCII(const char* aData,
-                                                      size_type aLength,
-                                                      const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL AssignASCII(const char* aData,
+                                            size_type aLength,
+                                            const fallible_t&);
 
   void NS_FASTCALL AssignASCII(const char* aData)
   {
     AssignASCII(aData, mozilla::AssertedCast<size_type, size_t>(strlen(aData)));
   }
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL AssignASCII(const char* aData,
-                                                      const fallible_t& aFallible)
+  MOZ_MUST_USE bool NS_FASTCALL AssignASCII(const char* aData,
+                                            const fallible_t& aFallible)
   {
     return AssignASCII(aData,
                        mozilla::AssertedCast<size_type, size_t>(strlen(aData)),
                        aFallible);
   }
 
   // AssignLiteral must ONLY be applied to an actual literal string, or
   // a char array *constant* declared without an explicit size.
@@ -468,113 +465,112 @@ public:
 
 
   /**
    * buffer manipulation
    */
 
   void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                            char_type aChar);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
-                                                  size_type aCutLength,
-                                                  char_type aChar,
-                                                  const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Replace(index_type aCutStart,
+                                        size_type aCutLength,
+                                        char_type aChar,
+                                        const fallible_t&);
   void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                            const char_type* aData,
                            size_type aLength = size_type(-1));
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
-                                                  size_type aCutLength,
-                                                  const char_type* aData,
-                                                  size_type aLength,
-                                                  const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL Replace(index_type aCutStart,
+                                        size_type aCutLength,
+                                        const char_type* aData,
+                                        size_type aLength,
+                                        const fallible_t&);
   void Replace(index_type aCutStart, size_type aCutLength,
                const self_type& aStr)
   {
     Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length());
   }
-  MOZ_WARN_UNUSED_RESULT bool Replace(index_type aCutStart,
-                                      size_type aCutLength,
-                                      const self_type& aStr,
-                                      const fallible_t& aFallible)
+  MOZ_MUST_USE bool Replace(index_type aCutStart,
+                            size_type aCutLength,
+                            const self_type& aStr,
+                            const fallible_t& aFallible)
   {
     return Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length(),
                    aFallible);
   }
   void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                            const substring_tuple_type& aTuple);
 
   void NS_FASTCALL ReplaceASCII(index_type aCutStart, size_type aCutLength,
                                 const char* aData,
                                 size_type aLength = size_type(-1));
 
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL ReplaceASCII(index_type aCutStart, size_type aCutLength,
-                                                       const char* aData,
-                                                       size_type aLength,
-                                                       const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL ReplaceASCII(index_type aCutStart, size_type aCutLength,
+                                             const char* aData,
+                                             size_type aLength,
+                                             const fallible_t&);
 
   // ReplaceLiteral must ONLY be applied to an actual literal string.
   // Do not attempt to use it with a regular char* pointer, or with a char
   // array variable. Use Replace or ReplaceASCII for those.
   template<int N>
   void ReplaceLiteral(index_type aCutStart, size_type aCutLength,
                       const char_type (&aStr)[N])
   {
     ReplaceLiteral(aCutStart, aCutLength, aStr, N - 1);
   }
 
   void Append(char_type aChar)
   {
     Replace(mLength, 0, aChar);
   }
-  MOZ_WARN_UNUSED_RESULT bool Append(char_type aChar,
-                                     const fallible_t& aFallible)
+  MOZ_MUST_USE bool Append(char_type aChar, const fallible_t& aFallible)
   {
     return Replace(mLength, 0, aChar, aFallible);
   }
   void Append(const char_type* aData, size_type aLength = size_type(-1))
   {
     Replace(mLength, 0, aData, aLength);
   }
-  MOZ_WARN_UNUSED_RESULT bool Append(const char_type* aData, size_type aLength,
-                                     const fallible_t& aFallible)
+  MOZ_MUST_USE bool Append(const char_type* aData, size_type aLength,
+                           const fallible_t& aFallible)
   {
     return Replace(mLength, 0, aData, aLength, aFallible);
   }
 
 #if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
   void Append(char16ptr_t aData, size_type aLength = size_type(-1))
   {
     Append(static_cast<const char16_t*>(aData), aLength);
   }
 #endif
 
   void Append(const self_type& aStr)
   {
     Replace(mLength, 0, aStr);
   }
-  MOZ_WARN_UNUSED_RESULT bool Append(const self_type& aStr, const fallible_t& aFallible)
+  MOZ_MUST_USE bool Append(const self_type& aStr, const fallible_t& aFallible)
   {
     return Replace(mLength, 0, aStr, aFallible);
   }
   void Append(const substring_tuple_type& aTuple)
   {
     Replace(mLength, 0, aTuple);
   }
 
   void AppendASCII(const char* aData, size_type aLength = size_type(-1))
   {
     ReplaceASCII(mLength, 0, aData, aLength);
   }
 
-  MOZ_WARN_UNUSED_RESULT bool AppendASCII(const char* aData, const fallible_t& aFallible)
+  MOZ_MUST_USE bool AppendASCII(const char* aData, const fallible_t& aFallible)
   {
     return ReplaceASCII(mLength, 0, aData, size_type(-1), aFallible);
   }
 
-  MOZ_WARN_UNUSED_RESULT bool AppendASCII(const char* aData, size_type aLength, const fallible_t& aFallible)
+  MOZ_MUST_USE bool AppendASCII(const char* aData, size_type aLength, const fallible_t& aFallible)
   {
     return ReplaceASCII(mLength, 0, aData, aLength, aFallible);
   }
 
   /**
    * Append a formatted string to the current string. Uses the format
    * codes documented in prprf.h
    */
@@ -635,17 +631,17 @@ public:
 #ifdef CharT_is_PRUnichar
   template<int N>
   void AppendLiteral(const char (&aStr)[N])
   {
     AppendASCII(aStr, N - 1);
   }
 
   template<int N>
-  MOZ_WARN_UNUSED_RESULT     bool AppendLiteral(const char (&aStr)[N], const fallible_t& aFallible)
+  MOZ_MUST_USE bool AppendLiteral(const char (&aStr)[N], const fallible_t& aFallible)
   {
     return AppendASCII(aStr, N - 1, aFallible);
   }
 #endif
 
   self_type& operator+=(char_type aChar)
   {
     Append(aChar);
@@ -721,22 +717,22 @@ public:
   /**
    * Attempts to set the capacity to the given size in number of
    * characters, without affecting the length of the string.
    * There is no need to include room for the null terminator: it is
    * the job of the string class.
    * Also ensures that the buffer is mutable.
    */
   void NS_FASTCALL SetCapacity(size_type aNewCapacity);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL SetCapacity(size_type aNewCapacity,
-                                                      const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL SetCapacity(size_type aNewCapacity,
+                                            const fallible_t&);
 
   void NS_FASTCALL SetLength(size_type aNewLength);
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL SetLength(size_type aNewLength,
-                                                    const fallible_t&);
+  MOZ_MUST_USE bool NS_FASTCALL SetLength(size_type aNewLength,
+                                          const fallible_t&);
 
   void Truncate(size_type aNewLength = 0)
   {
     NS_ASSERTION(aNewLength <= mLength, "Truncate cannot make string longer");
     SetLength(aNewLength);
   }
 
 
@@ -986,21 +982,21 @@ protected:
    *
    * would cause mData to look like "ab____f" where the characters
    * indicated by '_' have an unspecified value and can be freely
    * modified.  this function will null-terminate mData upon return.
    *
    * this function returns false if is unable to allocate sufficient
    * memory.
    */
-  MOZ_WARN_UNUSED_RESULT bool ReplacePrep(index_type aCutStart,
-                                          size_type aCutLength,
-                                          size_type aNewLength);
+  MOZ_MUST_USE bool ReplacePrep(index_type aCutStart,
+                                size_type aCutLength,
+                                size_type aNewLength);
 
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL ReplacePrepInternal(
+  MOZ_MUST_USE bool NS_FASTCALL ReplacePrepInternal(
     index_type aCutStart,
     size_type aCutLength,
     size_type aNewFragLength,
     size_type aNewTotalLength);
 
   /**
    * returns the number of writable storage units starting at mData.
    * the value does not include space for the null-terminator character.
@@ -1009,17 +1005,17 @@ protected:
    *       is 0-sized).
    */
   size_type NS_FASTCALL Capacity() const;
 
   /**
    * this helper function can be called prior to directly manipulating
    * the contents of mData.  see, for example, BeginWriting.
    */
-  MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL EnsureMutable(
+  MOZ_MUST_USE bool NS_FASTCALL EnsureMutable(
     size_type aNewLen = size_type(-1));
 
   /**
    * returns true if this string overlaps with the given string fragment.
    */
   bool IsDependentOn(const char_type* aStart, const char_type* aEnd) const
   {
     /**