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:
David Tolnay 2020-11-01 09:11:55 -08:00
parent f6fa7b1a22
commit 7907966838
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
7 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
#[cxx::bridge(namespace = org::example)]
#[cxx::bridge(namespace = "org::example")]
mod ffi {
struct SharedThing {
z: i32,

View File

@ -32,7 +32,7 @@ use syn::parse_macro_input;
/// attribute macro.
///
/// ```
/// #[cxx::bridge(namespace = mycompany::rust)]
/// #[cxx::bridge(namespace = "mycompany::rust")]
/// # mod ffi {}
/// ```
///

View File

@ -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");

View File

@ -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> {}

View File

@ -62,7 +62,7 @@ mod other {
}
}
#[cxx::bridge(namespace = tests)]
#[cxx::bridge(namespace = "tests")]
pub mod ffi {
#[derive(Clone)]
struct Shared {

View File

@ -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");

View File

@ -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;