cxx
cxx copied to clipboard
Support #![cxx::bridge] inner attribute
A common idiom in my codebase is:
// lib.rs
mod ffi;
/* ... */
// ffi.rs
pub use self::ffi::*;
#[cxx::bridge]
mod ffi {
/* ... */
}
// whatever.rs
use crate::ffi::Whatever;
/* ... */
It would be convenient for the ffi.rs to be expressible as:
// ffi.rs
#![cxx::bridge]
/* the usual contents of `mod ffi {...}` */
For now this would be blocked on https://github.com/rust-lang/rust/issues/54726.