Skip to content

Commit

Permalink
Work around ridiculous rust-analyzer behavior
Browse files Browse the repository at this point in the history
As far as I can tell there is still no way to keep it from autoimporting
the private macros and enum variants here: anyhow::__private::format,
anyhow::__private::Err.
  • Loading branch information
dtolnay committed Aug 17, 2023
1 parent cbade7d commit 238223a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use crate::StdError;

pub struct Adhoc;

#[doc(hidden)]
pub trait AdhocKind: Sized {
#[inline]
fn anyhow_kind(&self) -> Adhoc {
Expand All @@ -73,6 +74,7 @@ impl Adhoc {

pub struct Trait;

#[doc(hidden)]
pub trait TraitKind: Sized {
#[inline]
fn anyhow_kind(&self) -> Trait {
Expand All @@ -96,6 +98,7 @@ impl Trait {
pub struct Boxed;

#[cfg(feature = "std")]
#[doc(hidden)]
pub trait BoxedKind: Sized {
#[inline]
fn anyhow_kind(&self) -> Boxed {
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,22 @@ pub mod __private {
use alloc::fmt;
use core::fmt::Arguments;

#[doc(hidden)]
pub use crate::ensure::{BothDebug, NotBothDebug};
#[doc(hidden)]
pub use alloc::format;
#[doc(hidden)]
pub use core::result::Result::Err;
#[doc(hidden)]
pub use core::{concat, format_args, stringify};

#[doc(hidden)]
pub mod kind {
#[doc(hidden)]
pub use crate::kind::{AdhocKind, TraitKind};

#[cfg(feature = "std")]
#[doc(hidden)]
pub use crate::kind::BoxedKind;
}

Expand Down

0 comments on commit 238223a

Please sign in to comment.