You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when enabled, this would produce a warning and suggestion whenever referring to a derive macro through a reexport instead of via the original package.
(optionally this would only trigger if the reexport is behind a feature flag, but i'm not sure how feasible that is)
Advantage
Enabling a derive feature flag has a slight overhead on compile times as it linearizes the dependency tree.
For example, building serde with the derive feature enabled means that serde and serde_derive can't be built in parallel.
This is something that often is done internally in the rust project, see rust-lang/rust#141989.
There is currently no automated way to refactor this, as it requires a level of namespace awareness that most (all?) IDEs lack.
Drawbacks
Some library crates may not want their _derive crates to be part of the public API for semver reasons.
May require adding a new entry to Cargo.toml
Example
use serde::Deserialize;#[derive(Deserialize)]structFoo;
...
Could be written as:
use serde::Deserialize;#[derive(serde_derive::Deserialize)]structFoo;
...
The text was updated successfully, but these errors were encountered:
What it does
when enabled, this would produce a warning and suggestion whenever referring to a derive macro through a reexport instead of via the original package.
(optionally this would only trigger if the reexport is behind a feature flag, but i'm not sure how feasible that is)
Advantage
Enabling a
derive
feature flag has a slight overhead on compile times as it linearizes the dependency tree.For example, building serde with the
derive
feature enabled means thatserde
andserde_derive
can't be built in parallel.This is something that often is done internally in the rust project, see rust-lang/rust#141989.
There is currently no automated way to refactor this, as it requires a level of namespace awareness that most (all?) IDEs lack.
Drawbacks
Some library crates may not want their
_derive
crates to be part of the public API for semver reasons.May require adding a new entry to Cargo.toml
Example
Could be written as:
The text was updated successfully, but these errors were encountered: