nix-dotfiles/pkgs/edit/.cargo/release.toml
2025-05-23 12:19:11 -04:00

24 lines
1,003 B
TOML

# The following is not used by default via .cargo/config.toml,
# because `build-std-features` cannot be keyed by profile.
# This breaks the bench profile which doesn't support panic=abort.
# See: https://github.com/rust-lang/cargo/issues/11214
# See: https://github.com/rust-lang/cargo/issues/13894
# Avoid linking with vcruntime140.dll by statically linking everything,
# and then explicitly linking with ucrtbase.dll dynamically.
# We do this, because vcruntime140.dll is an optional Windows component.
[target.'cfg(target_os = "windows")']
rustflags = [
"-Ctarget-feature=+crt-static",
"-Clink-args=/DEFAULTLIB:ucrt.lib",
"-Clink-args=/NODEFAULTLIB:vcruntime.lib",
"-Clink-args=/NODEFAULTLIB:msvcrt.lib",
"-Clink-args=/NODEFAULTLIB:libucrt.lib",
]
# The backtrace code for panics in Rust is almost as large as the entire editor.
# = Huge reduction in binary size by removing all that.
[unstable]
build-std = ["std", "panic_abort"]
build-std-features = ["panic_immediate_abort"]