Rust 我可以只包含代码的调试信息而不包含包吗?

Rust 我可以只包含代码的调试信息而不包含包吗?,rust,rust-cargo,Rust,Rust Cargo,包含调试信息后,我的二进制文件大约变成400 MB。这是因为Rust包含所有依赖项的调试信息。有没有办法只为我的代码包含调试信息 [package] name = "app" version = "0.7.1" edition = "2018" [dependencies] actix = "*" actix-web = {version = "1.0", features = ["ssl"]} ... tokio-core = "*" tokio = "*" [profile.releas

包含调试信息后,我的二进制文件大约变成400 MB。这是因为Rust包含所有依赖项的调试信息。有没有办法只为我的代码包含调试信息

[package]
name = "app"
version = "0.7.1"
edition = "2018"

[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"

[profile.release]
debug = true

编辑:此功能现在已稳定,可以在稳定的工具链上使用,而无需使用
货物功能
清单键。此功能已记录在案


如果您愿意在夜间工具链中使用不稳定的cargo功能,可以通过该功能实现这一点,如下所示:

cargo-features = ["profile-overrides"]

[package]
name = "app"
version = "0.7.1"
edition = "2018"

[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"

[profile.release]
debug = true

// disable debug symbols for all packages except this one
[profile.release.package."*"]
debug = false