Skip to content

Commit

Permalink
Make _non_exhaustive markers public but hidden
Browse files Browse the repository at this point in the history
With an upcoming change we are going to factor out the functionality
making up the C API into a separate crate. Being in a separate crate,
access to our pub(crate) _non_exhaustive markers is no longer possible.
With this change we make these markers public. From an API contract
nothing changes, as affected types keep being documented as having
private fields. But it is now possible to check the source code for the
respective names and just initialize the members. While possible, this
is explicitly not a supported use case for the general public. The C API
crate will make sure to pin the blazesym version consumed.

Signed-off-by: Daniel Müller <[email protected]>
  • Loading branch information
d-e-s-o authored and danielocfb committed Nov 21, 2023
1 parent 29ffbc3 commit d8a36e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/inspect/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Elf {
pub debug_info: bool,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl Elf {
Expand Down
6 changes: 3 additions & 3 deletions src/normalize/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Apk {
pub path: PathBuf,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}


Expand All @@ -59,7 +59,7 @@ pub struct Elf {
pub build_id: Option<BuildId>,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}


Expand All @@ -74,7 +74,7 @@ pub struct Elf {
pub struct Unknown {
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl From<Unknown> for UserMeta {
Expand Down
6 changes: 3 additions & 3 deletions src/symbolize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub struct CodeInfo<'src> {
/// code.
pub column: Option<u16>,
/// The struct is non-exhaustive and open to extension.
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl CodeInfo<'_> {
Expand Down Expand Up @@ -224,7 +224,7 @@ pub struct InlinedFn<'src> {
/// Source code location information for the call to the function.
pub code_info: Option<CodeInfo<'src>>,
/// The struct is non-exhaustive and open to extension.
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}


Expand Down Expand Up @@ -292,7 +292,7 @@ pub struct Sym<'src> {
/// order `f`, `g`, `h`.
pub inlined: Box<[InlinedFn<'src>]>,
/// The struct is non-exhaustive and open to extension.
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}


Expand Down
12 changes: 6 additions & 6 deletions src/symbolize/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Apk {
pub path: PathBuf,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl Apk {
Expand Down Expand Up @@ -65,7 +65,7 @@ pub struct Elf {
pub path: PathBuf,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl Elf {
Expand Down Expand Up @@ -120,7 +120,7 @@ pub struct Kernel {
pub kernel_image: Option<PathBuf>,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl From<Kernel> for Source<'static> {
Expand All @@ -145,7 +145,7 @@ pub struct Process {
pub pid: Pid,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl Process {
Expand Down Expand Up @@ -216,7 +216,7 @@ pub struct GsymData<'dat> {
pub data: &'dat [u8],
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl<'dat> GsymData<'dat> {
Expand Down Expand Up @@ -258,7 +258,7 @@ pub struct GsymFile {
pub path: PathBuf,
/// The struct is non-exhaustive and open to extension.
#[doc(hidden)]
pub(crate) _non_exhaustive: (),
pub _non_exhaustive: (),
}

impl GsymFile {
Expand Down

0 comments on commit d8a36e0

Please sign in to comment.