Commit graph

8 commits

Author SHA1 Message Date
Adam Cozzette
3ff832936e Start testing against Rust edition 2024
This change also makes all the necessary fixes to get us compatible with
edition 2024.

I set things up so that we test edition 2024 with Bazel but keep Cargo on
edition 2021. This seems like a nice way to go since it allows us to get full
test coverage of both editions without us having to increment our minimum
supported Rust version.

PiperOrigin-RevId: 816241556
2025-10-07 09:21:51 -07:00
Protobuf Team Bot
c07de7c9df Change to proto2_rust C prefix and proto2::rust C++ namespace
PiperOrigin-RevId: 648791688
2024-07-02 11:44:17 -07:00
Protobuf Team Bot
a9bc366522 Stop using double underscores for our C function names and standardize on the 'rust_proto_' prefix.
Besides unnecessary inconsistency on our C symbols, double underscores anywhere in the name are reserved for stdlib use.  In practice its unlikely these symbols would ever hit a collision problem (maybe the prior name 'utf8_debug_string' with no prefix as having some risk), but safer to just standardize on this and have no concerns going forward.

PiperOrigin-RevId: 648709299
2024-07-02 07:19:11 -07:00
Jakob Buchgraber
997281b5bb #protobuf #rust use align parameter in __pb_rust_alloc
PiperOrigin-RevId: 613181914
2024-03-06 05:42:01 -08:00
Protobuf Team Bot
e0942c8f29 Return a non_null::dangling() for 0-sized allocations.
PiperOrigin-RevId: 606980834
2024-02-14 07:44:27 -08:00
Joshua Haberman
db20f5ffc9 Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full.
PiperOrigin-RevId: 564013990
2023-09-09 09:01:30 -07:00
Hong Shin
4f20efbb78 Internal Change
PiperOrigin-RevId: 546867607
2023-07-10 07:37:00 -07:00
Marcel Hlopko
5814f6c977 Generate C++ thunks for Rust protos
In this CL I'd like to call existing C++ Protobuf API from the V0 Rust API. Since parts of the C++ API are defined inline and using (obviously) C++ name mangling, we need to create a "thunks.cc" file that:

1) Generates code for C++ API function we use from Rust
2) Exposes these functions without any name mangling (meaning using `extern "C"`)

In this CL we add Bazel logic to generate "thunks" file, compile it, and propagate its object to linking. We also add logic to protoc to generate this "thunks" file.

The protoc logic is rather rudimentary still. I hope to focus on protoc code quality in my followup work on V0 Rust API using C++ kernel.

PiperOrigin-RevId: 523479839
2023-04-11 12:58:34 -07:00