Skip to content

Commit

Permalink
fix 'unresolved import' issue
Browse files Browse the repository at this point in the history
it does not work to have these feature guards currently until rustc issue
#8811 ([1]) is fixed since we just get errors running `cargo test` or
`cargo doc` otherwise.

the problem stems from the fact that `--cfg doc` will be used for compiling
the main crate being processed but not its dependencies, thus here the
re-exports are enabled in the binding crate, but not the actual items in
the sys crate, and thus 'unresolved import' errors occur, complaining about
not being able to find the items in the sys crate.

note, it obviously would not hurt to just have these string constants
unguarded, but i felt that it would be perhaps nicer to use the guards and
associated feature documentation to highlight the version requirement for
the use of these two significant properties.

[1]: rust-lang/cargo#8811
  • Loading branch information
jnqnfe committed Jul 29, 2021
1 parent 612d5cb commit 12b91d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pulse-sys/src/proplist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ pub const PA_PROP_FORMAT_CHANNEL_MAP: &str = "format.channel_map";
/// For context: whether to forcefully disable data transfer via POSIX or memfd shared memory.
/// This property overrides any other client configuration which would otherwise enable SHM
/// communication channels.
#[cfg(any(doc, feature = "pa_v15"))]
//TODO: enable this feature gate once the passing of `--cfg doc` to dependencies is fixed (https://github.com/rust-lang/cargo/issues/8811)
//#[cfg(any(doc, feature = "pa_v15"))]
#[cfg_attr(docsrs, doc(cfg(feature = "pa_v15")))]
pub const PA_PROP_CONTEXT_FORCE_DISABLE_SHM: &str = "context.force.disable.shm";

/// For a bluez device: the currently selected codec name.
#[cfg(any(doc, feature = "pa_v15"))]
//TODO: enable this feature gate once the passing of `--cfg doc` to dependencies is fixed (https://github.com/rust-lang/cargo/issues/8811)
//#[cfg(any(doc, feature = "pa_v15"))]
#[cfg_attr(docsrs, doc(cfg(feature = "pa_v15")))]
pub const PA_PROP_BLUETOOTH_CODEC: &str = "bluetooth.codec";

Expand Down

0 comments on commit 12b91d4

Please sign in to comment.