mirror of
https://github.com/topjohnwu/cxx.git
synced 2024-10-07 00:53:28 +00:00
Rely on docs.rs to define --cfg=docsrs by default
This commit is contained in:
parent
953009edfb
commit
81404f2f49
@ -45,7 +45,7 @@ members = ["demo", "flags", "gen/build", "gen/cmd", "gen/lib", "macro", "tests/f
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
[package.metadata.bazel]
|
||||
additive_build_file_content = """
|
||||
|
1
build.rs
1
build.rs
@ -32,7 +32,6 @@ fn main() {
|
||||
println!("cargo:rustc-check-cfg=cfg(compile_error_if_alloc)");
|
||||
println!("cargo:rustc-check-cfg=cfg(compile_error_if_std)");
|
||||
println!("cargo:rustc-check-cfg=cfg(cxx_experimental_no_alloc)");
|
||||
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
|
||||
println!("cargo:rustc-check-cfg=cfg(no_core_ffi_c_char)");
|
||||
println!("cargo:rustc-check-cfg=cfg(skip_ui_tests)");
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ impl CxxString {
|
||||
///
|
||||
/// [replacement character]: https://doc.rust-lang.org/std/char/constant.REPLACEMENT_CHARACTER.html
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
|
||||
pub fn to_string_lossy(&self) -> Cow<str> {
|
||||
String::from_utf8_lossy(self.as_bytes())
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use alloc::boxed::Box;
|
||||
use core::fmt::{self, Display};
|
||||
|
||||
/// Exception thrown from an `extern "C++"` function.
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
|
||||
#[derive(Debug)]
|
||||
pub struct Exception {
|
||||
pub(crate) what: Box<str>,
|
||||
@ -17,7 +17,7 @@ impl Display for Exception {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
||||
impl std::error::Error for Exception {}
|
||||
|
||||
impl Exception {
|
||||
|
@ -217,7 +217,7 @@ impl_extern_type! {
|
||||
f64 = "double"
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
|
||||
String = "rust::String"
|
||||
|
||||
[Opaque]
|
||||
|
@ -365,7 +365,7 @@
|
||||
|
||||
#![no_std]
|
||||
#![doc(html_root_url = "https://docs.rs/cxx/1.0.122")]
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#![deny(
|
||||
improper_ctypes,
|
||||
improper_ctypes_definitions,
|
||||
@ -477,7 +477,7 @@ mod weak_ptr;
|
||||
|
||||
pub use crate::cxx_vector::CxxVector;
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
|
||||
pub use crate::exception::Exception;
|
||||
pub use crate::extern_type::{kind, ExternType};
|
||||
pub use crate::shared_ptr::SharedPtr;
|
||||
|
Loading…
Reference in New Issue
Block a user