Determine how crates should expose 'unstable' APIs #95
Replies: 4 comments
-
Let's also consider how this applies to APIs that are unstable because they involve unstable Rust functionality—rather than a pre-1.0 public dependency. I haven't thought much about pre-1.0 dependencies exposed by a 1.0 crate, but for APIs that depend on an unstable Rust feature I would like to recommend against using a blanket |
Beta Was this translation helpful? Give feedback.
-
Diesel also has an I've been considering renaming the feature which maps to rust-nightly things to |
Beta Was this translation helpful? Give feedback.
-
I've adopted to using a |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
We want to mark crates as 1.0, and part of that requires all public dependencies to also be 1.0. It's possible an otherwise-stable crate would like to expose an API using a dependency that isn't stable yet. A common instance of this is
futures
. How should a crate expose this?Some examples that I've seen:
RUSTFLAGS="--cfg rayon_unstable"
to export the API that uses futures. As discussed there, this works closer to compiler unstable features, by requiring that the end user opt-in explicitly. A user cannot unknowingly depend on a crate using unstable features and think them stable.unstable
. Additionally, all unstable APIs are put intoreqwest::unstable
, to try to remind anyone using it that those are not covered by semver.Beta Was this translation helpful? Give feedback.
All reactions