Skip to content
Myr

Merge pull request #374 from dtolnay/docsrs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Rely on docs.rs to define --cfg=docsrs by default

authored by David Tolnay · committed by GitHub · parents 8ea1819, 004e701 · Browse files · 4 files+9 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+9 added−10 removed

  • other:+9 added−10 removed

4 files+9 added−10 removed

modified:src/error.rs+6 added-6 removed
24 unmodified lines
25 ///26 /// If the error type does not provide a backtrace, a backtrace will be27 /// created here to ensure that a backtrace exists.28 #[cfg(feature = "std")]29 #[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]29 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]30 #[cold]31 #[must_use]32 pub fn new<E>(error: E) -> Self33 where
365 unmodified lines
399 /// None400 /// }401 /// ```402 #[cfg(feature = "std")]403 #[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]403 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]404 #[cold]405 pub fn chain(&self) -> Chain {406 unsafe { ErrorImpl::chain(self.inner.by_ref()) }407 }
3 unmodified lines
411 ///412 /// The root cause is the last error in the iterator produced by413 /// [`chain()`][Error::chain].414 #[cfg(feature = "std")]415 #[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]415 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]416 pub fn root_cause(&self) -> &(dyn StdError + 'static) {417 self.chain().last().unwrap()418 }419
134 unmodified lines
554 }555}556557#[cfg(feature = "std")]558#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]558#[cfg_attr(docsrs, doc(cfg(feature = "std")))]559impl<E> From<E> for Error560where561 E: StdError + Send + Sync + 'static,562{
4 unmodified lines
567 }568}569570#[cfg(feature = "std")]571#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]571#[cfg_attr(docsrs, doc(cfg(feature = "std")))]572impl Deref for Error {573 type Target = dyn StdError + Send + Sync + 'static;574575 fn deref(&self) -> &Self::Target {
1 unmodified line
577 }578}579580#[cfg(feature = "std")]581#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]581#[cfg_attr(docsrs, doc(cfg(feature = "std")))]582impl DerefMut for Error {583 fn deref_mut(&mut self) -> &mut Self::Target {584 unsafe { ErrorImpl::error_mut(self.inner.by_mut()) }585 }
439 unmodified lines
modified:src/lib.rs+2 added-2 removed
206 unmodified lines
207//! non-Anyhow error type inside a function that returns Anyhow's error type.208209#![doc(html_root_url = "https://docs.rs/anyhow/1.0.85")]210#![cfg_attr(error_generic_member_access, feature(error_generic_member_access))]211#![cfg_attr(doc_cfg, feature(doc_cfg))]211#![cfg_attr(docsrs, feature(doc_cfg))]212#![no_std]213#![deny(dead_code, unused_imports, unused_mut)]214#![cfg_attr(215 not(anyhow_no_unsafe_op_in_unsafe_fn_lint),
191 unmodified lines
407/// None408/// }409/// ```410#[cfg(feature = "std")]411#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]411#[cfg_attr(docsrs, doc(cfg(feature = "std")))]412#[derive(Clone)]413pub struct Chain<'a> {414 state: crate::chain::ChainState<'a>,415}
315 unmodified lines
modified:build.rs-1 removed
68 unmodified lines
69 println!("cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)");70 println!("cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str)");71 println!("cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of)");72 println!("cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint)");73 println!("cargo:rustc-check-cfg=cfg(doc_cfg)");73 println!("cargo:rustc-check-cfg=cfg(error_generic_member_access)");74 println!("cargo:rustc-check-cfg=cfg(std_backtrace)");75 }76
102 unmodified lines
modified:Cargo.toml+1 added-1 removed