If I declare rustls
dependency in Cargo.toml
:
[dependencies]
rustls = "0.21"
In my main.rs
:
use rustls::*;
fn main() {}
Then I compile this with
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release
The generated binary is still dynamically-linked.
Note that if I remove the use rustls::*;
line in main.rs
, the generated binary is statically-linked as expected.