sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Take advantage of weak features in Rust 1.60 for TLS enablement

Open MarijnS95 opened this issue 3 years ago • 0 comments
trafficstars

Previously it was impossible to have a unified feature named rustls or native-tls that would turn on the respective TLS backend in the chosen transport (reqwest or ureq) as a feature of <crate>/tls would implicitly turn on <crate>. Since Rust 1.60 it is now possible to specify this crate-feature enablement through the use of the question mark in <crate>?/tls, which will only enable the tls feature if <crate> was enabled through other means (another feature).

Secondly we can now also let optional crates have the same name as a feature, and use dep:<crate> to refer to the crate instead of the dependency, making for a more pleasant experience without renames to underscore suffixes.


Filing this as draft just to get the word out and discuss this for a bit, as it will only be mergeable in 6 months in accordance with the MSRV policy. It goes without saying that this is a breaking change.

Also note that I haven't renamed other optional crates like anyhow_, log_ etc yet, until this is accepted as a (future) solution.

MarijnS95 avatar Apr 07 '22 15:04 MarijnS95