The type is internal to the generated code/runtime and isn't exposed
in any public api, so go ahead and move it into the Descriptor private
header.
PiperOrigin-RevId: 718383227
The type is internal to the generated code/runtime and isn't exposed
in any public api, so go ahead and move it into the Utilies private
header.
PiperOrigin-RevId: 718032947
The compiler can merge all the different switch cases for all the message alternatives and generates O(1) accessors instead. The switch dispatch is effectively replaced with a virtual function dispatch.
This can significantly reduce code size for oneofs with a lot of message alternatives, specially if it _only_ has message alternatives.
PiperOrigin-RevId: 718025165
It uses the same nodes that Map<> would use for the respectice types.
This makes the type compatible with visitation and removes some custom types
supporting DynamicMapField.
Remove most of the vtable, since this can now be done directly in MapFieldBase without derived type support.
PiperOrigin-RevId: 717984824
Since protobuf codegen is not no-std compatible today (due to usage of std::sync::OnceLock), we should use ::std rather than ::core to slightly reduce our surface area for naming based breakages, including proto_library(name="core"). Only this one spot in the codegen didn't already match that.
PiperOrigin-RevId: 717892640
Each call to `unittest.TestResult.addDuration` increases the total refcount.
The refleak checker now mocks this function to get consistent values.
PiperOrigin-RevId: 717548068
Use popcount with a mask on the has bits to count the number of present fields
instead of checking fields one by one with a conditional.
PiperOrigin-RevId: 716692546
Duration already has a care or two where there are just nanos, but Timestamp doesn't
and the handing of negative values in Timestamp can be a little strange, so this
should probably get a conformance test.
PiperOrigin-RevId: 716668059
We need the minitable plugin to use the C++ plugin framework because it's soon
going to live in the same binary as the Rust code generator. The other plugins
we might as well move just for consistency, and this allows us to delete the
`upb::Plugin` class as well.
PiperOrigin-RevId: 716234662
Remove the naming warnings that would be considered noisy if they were suddenly enabled with no easy way to disable the warnings. The upcoming Edition 2024 naming style enforcement feature and a planned corresponding change to the linter which respects NOLINT comments will cover the cases that these warnings would.
The parser appears to have been accidentally silently suppressed on the CLI path all along; while they were reachable on other usages of the parser, those cases are secondary compared to what we consider the main entry point and so no longer having the naming warnings on those should not locally be a major loss.
PiperOrigin-RevId: 716223703
rules_python recommends not using "pip_deps" as a hub name unless the module is guaranteed to always be the root module, as the name must be unique between modules.
PiperOrigin-RevId: 715435028
implemented on top of `UntypedMapBase` visitation.
Reduces code duplication in large binaries.
More to come in future changes.
PiperOrigin-RevId: 715380851
The symbol has been removed from Bazel 8, so any reference to it results in an error.
Using bazel_features, a bzl file with a reference is generated, based on Bazel version.
Protobuf 29.x doesn't have this problem because cc_proto_aspect wasn't exposed. But we should still cherry-pick exposing the aspect and this change to 29.x line, to make transition of rules_rust easier.
Closes: https://github.com/protocolbuffers/protobuf/pull/19576
PiperOrigin-RevId: 715064854
This includes (but not limited to) `MessageLite::GetTypeName`, `UnknownField::length_delimited`, and
all the name functions in descriptors like `FieldDescriptor::full_name`.
Part of the changes announced in
https://protobuf.dev/news/2024-10-02/#descriptor-apis
PiperOrigin-RevId: 715013326
Given:
oneof hello_world {}
We now generate:
fn hello_world(&self) -> HelloWorldOneof
fn hello_world_case(&self) -> HelloWorldCase
This change is to help mitigate a realistic risk of collisions in cases like:
message M {
oneof x { ... }
enum X { ... }
}
PiperOrigin-RevId: 714998247
`pbi` where appropriate.
The `proto_ns` variable not fully qualified and risks forgetting the prefix
`::` which could potentially break codegen if user namespace has a matching
subnamespace.
PiperOrigin-RevId: 714982016
Since adding a new feature for a new Edition involves having a value set for Proto2/Proto3 which does not change the semantics of those files, the current test becomes a change detector test against new features being added.
PiperOrigin-RevId: 714851850
This should silence the DEBUG warning
```
DEBUG: Rule 'com_google_protobuf_v25.0' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-e+7ZxRHWMs/3wirACU3Xcg5VAVMDnV2n4Fm8zrSIR0o="
```
PiperOrigin-RevId: 714142857