mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-19 07:38:02 +00:00
Switch to namespace = "quoted::path" in docs and tests
To preserve parity with item-level #[namespace = "..."] which is currently restricted by rustc to a quoted string.
This commit is contained in:
parent
f6fa7b1a22
commit
7907966838
@ -1,4 +1,4 @@
|
||||
#[cxx::bridge(namespace = org::example)]
|
||||
#[cxx::bridge(namespace = "org::example")]
|
||||
mod ffi {
|
||||
struct SharedThing {
|
||||
z: i32,
|
||||
|
@ -32,7 +32,7 @@ use syn::parse_macro_input;
|
||||
/// attribute macro.
|
||||
///
|
||||
/// ```
|
||||
/// #[cxx::bridge(namespace = mycompany::rust)]
|
||||
/// #[cxx::bridge(namespace = "mycompany::rust")]
|
||||
/// # mod ffi {}
|
||||
/// ```
|
||||
///
|
||||
|
@ -28,7 +28,7 @@ use self::kind::{Kind, Opaque, Trivial};
|
||||
/// ```no_run
|
||||
/// // file1.rs
|
||||
/// # mod file1 {
|
||||
/// #[cxx::bridge(namespace = example)]
|
||||
/// #[cxx::bridge(namespace = "example")]
|
||||
/// pub mod ffi {
|
||||
/// extern "C" {
|
||||
/// type Demo;
|
||||
@ -39,7 +39,7 @@ use self::kind::{Kind, Opaque, Trivial};
|
||||
/// # }
|
||||
///
|
||||
/// // file2.rs
|
||||
/// #[cxx::bridge(namespace = example)]
|
||||
/// #[cxx::bridge(namespace = "example")]
|
||||
/// pub mod ffi {
|
||||
/// extern "C" {
|
||||
/// type Demo = crate::file1::ffi::Demo;
|
||||
@ -78,7 +78,7 @@ use self::kind::{Kind, Opaque, Trivial};
|
||||
/// type Kind = cxx::kind::Opaque;
|
||||
/// }
|
||||
///
|
||||
/// #[cxx::bridge(namespace = folly)]
|
||||
/// #[cxx::bridge(namespace = "folly")]
|
||||
/// pub mod ffi {
|
||||
/// extern "C" {
|
||||
/// include!("rust_cxx_bindings.h");
|
||||
|
@ -8,7 +8,7 @@
|
||||
// Rustfmt mangles the extern type alias.
|
||||
// https://github.com/rust-lang/rustfmt/issues/4159
|
||||
#[rustfmt::skip]
|
||||
#[cxx::bridge(namespace = tests)]
|
||||
#[cxx::bridge(namespace = "tests")]
|
||||
pub mod ffi2 {
|
||||
impl UniquePtr<D> {}
|
||||
impl UniquePtr<E> {}
|
||||
|
@ -62,7 +62,7 @@ mod other {
|
||||
}
|
||||
}
|
||||
|
||||
#[cxx::bridge(namespace = tests)]
|
||||
#[cxx::bridge(namespace = "tests")]
|
||||
pub mod ffi {
|
||||
#[derive(Clone)]
|
||||
struct Shared {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Rustfmt mangles the extern type alias.
|
||||
// https://github.com/rust-lang/rustfmt/issues/4159
|
||||
#[rustfmt::skip]
|
||||
#[cxx::bridge(namespace = tests)]
|
||||
#[cxx::bridge(namespace = "tests")]
|
||||
pub mod ffi {
|
||||
extern "C" {
|
||||
include!("tests/ffi/tests.h");
|
||||
|
@ -1,11 +1,11 @@
|
||||
#[cxx::bridge(namespace = folly)]
|
||||
#[cxx::bridge(namespace = "folly")]
|
||||
mod here {
|
||||
extern "C" {
|
||||
type StringPiece;
|
||||
}
|
||||
}
|
||||
|
||||
#[cxx::bridge(namespace = folly)]
|
||||
#[cxx::bridge(namespace = "folly")]
|
||||
mod there {
|
||||
extern "C" {
|
||||
type ByteRange = crate::here::StringPiece;
|
||||
|
Loading…
x
Reference in New Issue
Block a user