@@ -84,7 +84,7 @@ class RustSymbolParser {
8484 // structure was not recognized or exceeded implementation limits, such as by
8585 // nesting structures too deep. In either case *this should not be used
8686 // again.
87- ABSL_MUST_USE_RESULT bool Parse () && {
87+ [[nodiscard]] bool Parse () && {
8888 // Recursively parses the grammar production named by callee, then resumes
8989 // execution at the next statement.
9090 //
@@ -564,7 +564,7 @@ class RustSymbolParser {
564564
565565 // If the next input character is the given character, consumes it and returns
566566 // true; otherwise returns false without consuming a character.
567- ABSL_MUST_USE_RESULT bool Eat (char want) {
567+ [[nodiscard]] bool Eat (char want) {
568568 if (encoding_[pos_] != want) return false ;
569569 ++pos_;
570570 return true ;
@@ -573,7 +573,7 @@ class RustSymbolParser {
573573 // Provided there is enough remaining output space, appends c to the output,
574574 // writing a fresh NUL terminator afterward, and returns true. Returns false
575575 // if the output buffer had less than two bytes free.
576- ABSL_MUST_USE_RESULT bool EmitChar (char c) {
576+ [[nodiscard]] bool EmitChar (char c) {
577577 if (silence_depth_ > 0 ) return true ;
578578 if (out_end_ - out_ < 2 ) return false ;
579579 *out_++ = c;
@@ -584,7 +584,7 @@ class RustSymbolParser {
584584 // Provided there is enough remaining output space, appends the C string token
585585 // to the output, followed by a NUL character, and returns true. Returns
586586 // false if not everything fit into the output buffer.
587- ABSL_MUST_USE_RESULT bool Emit (const char * token) {
587+ [[nodiscard]] bool Emit (const char * token) {
588588 if (silence_depth_ > 0 ) return true ;
589589 const size_t token_length = std::strlen (token);
590590 const size_t bytes_to_copy = token_length + 1 ; // token and final NUL
@@ -598,7 +598,7 @@ class RustSymbolParser {
598598 // of disambiguator (if it's nonnegative) or "?" (if it's negative) to the
599599 // output, followed by a NUL character, and returns true. Returns false if
600600 // not everything fit into the output buffer.
601- ABSL_MUST_USE_RESULT bool EmitDisambiguator (int disambiguator) {
601+ [[nodiscard]] bool EmitDisambiguator (int disambiguator) {
602602 if (disambiguator < 0 ) return EmitChar (' ?' ); // parsed but too large
603603 if (disambiguator == 0 ) return EmitChar (' 0' );
604604 // Convert disambiguator to decimal text. Three digits per byte is enough
@@ -618,7 +618,7 @@ class RustSymbolParser {
618618 // On success returns true and fills value with the encoded value if it was
619619 // not too big, otherwise with -1. If the optional disambiguator was omitted,
620620 // value is 0. On parse failure returns false and sets value to -1.
621- ABSL_MUST_USE_RESULT bool ParseDisambiguator (int & value) {
621+ [[nodiscard]] bool ParseDisambiguator (int & value) {
622622 value = -1 ;
623623
624624 // disambiguator = s base-62-number
@@ -639,7 +639,7 @@ class RustSymbolParser {
639639 // On success returns true and fills value with the encoded value if it was
640640 // not too big, otherwise with -1. On parse failure returns false and sets
641641 // value to -1.
642- ABSL_MUST_USE_RESULT bool ParseBase62Number (int & value) {
642+ [[nodiscard]] bool ParseBase62Number (int & value) {
643643 value = -1 ;
644644
645645 // base-62-number = (digit | lower | upper)* _
@@ -686,7 +686,7 @@ class RustSymbolParser {
686686 // A nonzero uppercase_namespace specifies the character after the N in a
687687 // nested-identifier, e.g., 'C' for a closure, allowing ParseIdentifier to
688688 // write out the name with the conventional decoration for that namespace.
689- ABSL_MUST_USE_RESULT bool ParseIdentifier (char uppercase_namespace = ' \0 ' ) {
689+ [[nodiscard]] bool ParseIdentifier (char uppercase_namespace = ' \0 ' ) {
690690 // identifier -> disambiguator? undisambiguated-identifier
691691 int disambiguator = 0 ;
692692 if (!ParseDisambiguator (disambiguator)) return false ;
@@ -703,7 +703,7 @@ class RustSymbolParser {
703703 //
704704 // At other appearances of undisambiguated-identifier in the grammar, this
705705 // treatment is not applicable, and the call site omits both arguments.
706- ABSL_MUST_USE_RESULT bool ParseUndisambiguatedIdentifier (
706+ [[nodiscard]] bool ParseUndisambiguatedIdentifier (
707707 char uppercase_namespace = ' \0 ' , int disambiguator = 0 ) {
708708 // undisambiguated-identifier -> u? decimal-number _? bytes
709709 const bool is_punycoded = Eat (' u' );
@@ -766,7 +766,7 @@ class RustSymbolParser {
766766 // Consumes a decimal number like 0 or 123 from the input. On success returns
767767 // true and fills value with the encoded value. If the encoded value is too
768768 // large or otherwise unparsable, returns false and sets value to -1.
769- ABSL_MUST_USE_RESULT bool ParseDecimalNumber (int & value) {
769+ [[nodiscard]] bool ParseDecimalNumber (int & value) {
770770 value = -1 ;
771771 if (!IsDigit (Peek ())) return false ;
772772 int encoded_number = Take () - ' 0' ;
@@ -788,7 +788,7 @@ class RustSymbolParser {
788788 // Consumes a binder of higher-ranked lifetimes if one is present. On success
789789 // returns true and discards the encoded lifetime count. On parse failure
790790 // returns false.
791- ABSL_MUST_USE_RESULT bool ParseOptionalBinder () {
791+ [[nodiscard]] bool ParseOptionalBinder () {
792792 // binder -> G base-62-number
793793 if (!Eat (' G' )) return true ;
794794 int ignored_binding_count;
@@ -802,7 +802,7 @@ class RustSymbolParser {
802802 // things we omit from output, such as the entire contents of generic-args.
803803 //
804804 // On parse failure returns false.
805- ABSL_MUST_USE_RESULT bool ParseOptionalLifetime () {
805+ [[nodiscard]] bool ParseOptionalLifetime () {
806806 // lifetime -> L base-62-number
807807 if (!Eat (' L' )) return true ;
808808 int ignored_de_bruijn_index;
@@ -811,14 +811,14 @@ class RustSymbolParser {
811811
812812 // Consumes a lifetime just like ParseOptionalLifetime, but returns false if
813813 // there is no lifetime here.
814- ABSL_MUST_USE_RESULT bool ParseRequiredLifetime () {
814+ [[nodiscard]] bool ParseRequiredLifetime () {
815815 if (Peek () != ' L' ) return false ;
816816 return ParseOptionalLifetime ();
817817 }
818818
819819 // Pushes ns onto the namespace stack and returns true if the stack is not
820820 // full, else returns false.
821- ABSL_MUST_USE_RESULT bool PushNamespace (char ns) {
821+ [[nodiscard]] bool PushNamespace (char ns) {
822822 if (namespace_depth_ == kNamespaceStackSize ) return false ;
823823 namespace_stack_[namespace_depth_++] = ns;
824824 return true ;
@@ -830,7 +830,7 @@ class RustSymbolParser {
830830
831831 // Pushes position onto the position stack and returns true if the stack is
832832 // not full, else returns false.
833- ABSL_MUST_USE_RESULT bool PushPosition (int position) {
833+ [[nodiscard]] bool PushPosition (int position) {
834834 if (position_depth_ == kPositionStackSize ) return false ;
835835 position_stack_[position_depth_++] = position;
836836 return true ;
@@ -845,7 +845,7 @@ class RustSymbolParser {
845845 // beginning of the backref target. Returns true on success. Returns false
846846 // if parsing failed, the stack is exhausted, or the backref target position
847847 // is out of range.
848- ABSL_MUST_USE_RESULT bool BeginBackref () {
848+ [[nodiscard]] bool BeginBackref () {
849849 // backref = B base-62-number (B already consumed)
850850 //
851851 // Reject backrefs that don't parse, overflow int, or don't point backward.
0 commit comments