docs: remove workarounds for `#[doc = concat!(...)]` following msrv bump

This commit is contained in:
David Hewitt 2023-06-08 21:04:49 +01:00
parent d3bd82c6f2
commit 46942b9a14
12 changed files with 14 additions and 62 deletions

View File

@ -75,9 +75,7 @@
//! crate-type = ["cdylib"] //! crate-type = ["cdylib"]
//! //!
//! [dependencies.pyo3-ffi] //! [dependencies.pyo3-ffi]
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
//! features = ["extension-module"] //! features = ["extension-module"]
//! ``` //! ```
//! //!

View File

@ -212,7 +212,7 @@ pub trait ToPyObject {
/// # } /// # }
/// ``` /// ```
/// Python code will see this as any of the `int`, `string` or `None` objects. /// Python code will see this as any of the `int`, `string` or `None` objects.
#[cfg_attr(docsrs, doc(alias = "IntoPyCallbackOutput"))] #[doc(alias = "IntoPyCallbackOutput")]
pub trait IntoPy<T>: Sized { pub trait IntoPy<T>: Sized {
/// Performs the conversion. /// Performs the conversion.
fn into_py(self, py: Python<'_>) -> T; fn into_py(self, py: Python<'_>) -> T;

View File

@ -25,12 +25,7 @@
//! [dependencies] //! [dependencies]
//! ## change * to the version you want to use, ideally the latest. //! ## change * to the version you want to use, ideally the latest.
//! anyhow = "*" //! anyhow = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"anyhow\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"anyhow\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"anyhow\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of anyhow and PyO3. //! Note that you must use compatible versions of anyhow and PyO3.

View File

@ -14,12 +14,7 @@
//! # change * to the latest versions //! # change * to the latest versions
//! pyo3 = { version = "*", features = ["chrono"] } //! pyo3 = { version = "*", features = ["chrono"] }
//! chrono = "0.4" //! chrono = "0.4"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"chrono\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"chrono\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"chrono\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of chrono and PyO3. //! Note that you must use compatible versions of chrono and PyO3.

View File

@ -24,9 +24,7 @@
//! [dependencies] //! [dependencies]
//! ## change * to the version you want to use, ideally the latest. //! ## change * to the version you want to use, ideally the latest.
//! eyre = "*" //! eyre = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"eyre\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"eyre\"] }")))]
#![cfg_attr(not(docsrs), doc = "pyo3 = { version = \"*\", features = [\"eyre\"] }")]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of eyre and PyO3. //! Note that you must use compatible versions of eyre and PyO3.

View File

@ -11,12 +11,7 @@
//! [dependencies] //! [dependencies]
//! # change * to the latest versions //! # change * to the latest versions
//! hashbrown = "*" //! hashbrown = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"hashbrown\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"hashbrown\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"hashbrown\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of hashbrown and PyO3. //! Note that you must use compatible versions of hashbrown and PyO3.

View File

@ -18,12 +18,7 @@
//! [dependencies] //! [dependencies]
//! # change * to the latest versions //! # change * to the latest versions
//! indexmap = "*" //! indexmap = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"indexmap\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"indexmap\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"indexmap\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of indexmap and PyO3. //! Note that you must use compatible versions of indexmap and PyO3.

View File

@ -10,12 +10,7 @@
//! ```toml //! ```toml
//! [dependencies] //! [dependencies]
//! num-bigint = "*" //! num-bigint = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-bigint\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-bigint\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"num-bigint\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of num-bigint and PyO3. //! Note that you must use compatible versions of num-bigint and PyO3.

View File

@ -14,12 +14,7 @@
//! [dependencies] //! [dependencies]
//! # change * to the latest versions //! # change * to the latest versions
//! num-complex = "*" //! num-complex = "*"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-complex\"] }")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-complex\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"num-complex\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use compatible versions of num-complex and PyO3. //! Note that you must use compatible versions of num-complex and PyO3.

View File

@ -9,13 +9,8 @@
//! //!
//! ```toml //! ```toml
//! [dependencies] //! [dependencies]
#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"rust_decimal\"] }")]
//! rust_decimal = "1.0" //! rust_decimal = "1.0"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"rust_decimal\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = ..., features = [\"rust_decimal\"] }"
)]
//! ``` //! ```
//! //!
//! Note that you must use a compatible version of rust_decimal and PyO3. //! Note that you must use a compatible version of rust_decimal and PyO3.

View File

@ -8,13 +8,8 @@
//! //!
//! ```toml //! ```toml
//! [dependencies] //! [dependencies]
#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"serde\"] }")]
//! serde = "1.0" //! serde = "1.0"
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"serde\"] }")))]
#![cfg_attr(
not(docsrs),
doc = "pyo3 = { version = \"*\", features = [\"serde\"] }"
)]
//! ``` //! ```
use crate::{Py, PyAny, PyClass, Python}; use crate::{Py, PyAny, PyClass, Python};

View File

@ -151,9 +151,7 @@
//! crate-type = ["cdylib"] //! crate-type = ["cdylib"]
//! //!
//! [dependencies.pyo3] //! [dependencies.pyo3]
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
//! features = ["extension-module"] //! features = ["extension-module"]
//! ``` //! ```
//! //!
@ -214,9 +212,7 @@
//! Start a new project with `cargo new` and add `pyo3` to the `Cargo.toml` like this: //! Start a new project with `cargo new` and add `pyo3` to the `Cargo.toml` like this:
//! ```toml //! ```toml
//! [dependencies.pyo3] //! [dependencies.pyo3]
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 #![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")]
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
//! # this is necessary to automatically initialize the Python interpreter //! # this is necessary to automatically initialize the Python interpreter
//! features = ["auto-initialize"] //! features = ["auto-initialize"]
//! ``` //! ```
@ -439,7 +435,7 @@ pub use pyo3_macros::{pyfunction, pymethods, pymodule, FromPyObject};
/// A proc macro used to expose Rust structs and fieldless enums as Python objects. /// A proc macro used to expose Rust structs and fieldless enums as Python objects.
/// ///
#[cfg_attr(docsrs, cfg_attr(docsrs, doc = include_str!("../guide/pyclass_parameters.md")))] #[doc = include_str!("../guide/pyclass_parameters.md")]
/// ///
/// For more on creating Python classes, /// For more on creating Python classes,
/// see the [class section of the guide][1]. /// see the [class section of the guide][1].