capnproto / capnproto-rust

Cap'n Proto for Rust
MIT License
2.06k stars 222 forks source link

Using same schema file for both Rust and C++ #507

Closed compilerintrinsics closed 5 months ago

compilerintrinsics commented 5 months ago

I have a set of .capnp schema files that is being used by both the C++ capnp compiler and Rust capnp compiler. However, the rust compiler rejects annotations that is used by the c++ compiler.

Specifically, my .capnp schemas have these statements to export the types to a C++ namespace that the Rust capnpc rejects as Parse error:

using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("foo::bar::baz");

Is there anyway to get the Rust capnpc to ignore these statements?

compilerintrinsics commented 5 months ago

Nevermind, this is caused by errors in other parts of the schema.