Fix --no-default-features

This commit is contained in:
Zhang Junyang 2025-04-02 11:40:07 +08:00 committed by Jianfeng Jiang
parent e040dda7a4
commit 2f40d13120

View File

@ -216,8 +216,12 @@ fn add_manifest_dependency(
let dependencies = manifest.get_mut("dependencies").unwrap();
// We disable default features when depending on the target crate, and add
// all the default features as the default features of the base crate, to
// allow controls from the users.
// See `add_feature_entries` for more details.
let target_dep = toml::Table::from_str(&format!(
"{} = {{ path = \"{}\" }}",
"{} = {{ path = \"{}\", default-features = false }}",
crate_name,
crate_path.as_ref().display()
))