Skip to content

Build breaks with v0.24.6 #841

@tronical

Description

@tronical

PR #820 changed the config struct in a way that breaks existing code:

@@ -1003,6 +1003,8 @@ pub struct Config {
     pub only_target_dependencies: bool,
     /// Configuration options specific to Cython.
     pub cython: CythonConfig,
+    #[serde(skip)]
+    pub(crate) config_path: Option<StdPathBuf>,
 }

 impl Default for Config {

Our code initialises Config not via ::default() but like this:

cbindgen::Config {
        pragma_once: true,
        include_version: true,
        // some more fields here
        ..Default::default()
    }

and that causes

error[E0451]: field `config_path` of struct `Config` is private
  --> api/cpp/cbindgen.rs:83:11
   |
83 |         ..Default::default()
   |           ^^^^^^^^^^^^^^^^^^ field `config_path` is private

I can work around this of course by using Config::default(), but unfortunately the crate release with this change breaks our existing crate on crates.io that relies on this :-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions