Fix ..Default::default() for struct Config

Previously the `depfile` option added a new private member to the
`Config` struct - a breaking change which many users complained about.
Making the field public, but hiding it from the documentation and
excluding it from `serde` reverts the breakage, while keeping the
depfile functionality.
This commit is contained in:
Jonathan Schwender 2023-12-27 11:04:01 +01:00 committed by Emilio Cobos Álvarez
parent 6bfc217618
commit c9c90bf661
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,7 @@
# unreleased
* Revert: The `Config` struct now has a private member.
# 0.26.0
* Fix swapping of `>>=` and `<<=` in constants.

View File

@ -1010,8 +1010,15 @@ pub struct Config {
pub only_target_dependencies: bool,
/// Configuration options specific to Cython.
pub cython: CythonConfig,
#[doc(hidden)]
#[serde(skip)]
pub(crate) config_path: Option<StdPathBuf>,
/// Internal field for tracking from which file the config was loaded.
///
/// Users should not set this field explicitly. Making the field private
/// prevents users from filling the struct with `..Default::default()`,
/// and creating a new InternalConfig struct would require more breaking
/// changes to our public API.
pub config_path: Option<StdPathBuf>,
}
impl Default for Config {