Currently we're aliasing `each_index` to `each_with_index`, incorrectly passing both the index and the value of a repeated field to the block.
What we want is to just pass the index. Luckily this is a method on Ruby arrays, so we just wrap the native Ruby array method.
Fixes https://github.com/protocolbuffers/protobuf/issues/7806Closes#11767
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11767 from shaldengeki:shaldengeki-repeated-field-each-index-returns-actual-index 874916c21d
PiperOrigin-RevId: 593835025
This is based on the mangling Mercurial used in its fncache system, and leaves
us room to need to escape other symbols in the future.
PiperOrigin-RevId: 593048297
This was missed in the previous CL. DEL characters would be printed unescaped, which makes them more difficult to read but should still be data-preserving.
PiperOrigin-RevId: 592946127
These decoders have copied by default for a long time. There is no longer any need to copy anything.
This should reduce CPU and memory usage.
PiperOrigin-RevId: 592859621
Generic services have been deprecated for about 14 years. This is technically a
breaking change, but fortunately the `php_generic_services` option appears to
have little or no usage. I could not find any examples of open source code
using it.
PiperOrigin-RevId: 592677762
The `VarintParse()` function is ordinarily called only by the proto parser,
which always provides 16 bytes of "slop" space at the end of the buffer. The
ARM-specific optimized path takes advantage of this by always reading at least
8 bytes. However, this caused some test failures in msan due to unit tests not
providing a sufficient amount of initialized padding. This CL fixes the problem
by making sure the unit tests initialize the full 10-byte buffer and adding a
comment stating that this is a precondition of the function.
PiperOrigin-RevId: 592366291
This CL collapses (strings, bytes) into primitives for message.cc::GetterForViewOrMut.
Strings, bytes, and all primitives have been unified, properly parameterized based on RsType.
Returning $pb$::Mut<$RsType$> and $pb$::View<$RsType$> made this possible.
Note that the vtables for primitives take in an additional type arg, so we've added that.
In addition, strings / bytes (aka stringlikes) require a transform, so that'll be invoked on an as-needed basis.
PiperOrigin-RevId: 592328216
There is a new trimming/AOT warning in JSON formatter enum handling. I have fixed it by suppressing the value.
I also tested the solution with the .NET 8 SDK and suppressed some other warnings that came up (they're already handled).
It would be great to include this fix in a 25.x release.
Closes#14789
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14789 from JamesNK:jamesnk/enum-trimming-warning d64dda15f0
PiperOrigin-RevId: 592306588
Now that Bazel 7.0 has been released, it's time to remove this tech debt.
This has been a no-op since Bazel 5.0, I've been waiting to remove the code for
two years, it's time.
Part of https://github.com/bazelbuild/bazel/issues/14127.
PiperOrigin-RevId: 592219242
Without this it shows up as a spurious warning of dead code from never constructed enum cases (rustc can't 'see' that the value can come across from C++)
PiperOrigin-RevId: 592209619