Commit graph

16 commits

Author SHA1 Message Date
Eric Huss 43a063c80a Stabilize namespaced and weak dependency features. 2022-01-06 15:56:56 -08:00
flip1995 390af27128
Add rust_metadata to SerializedPackage
After the rust_version field was stabilized in #9732 this adds the
rust_version as output to the `cargo metadata` command, so tools like
Clippy can read and use it as well.
2021-10-12 14:07:19 +02:00
Frank Steffahn ff881ee262 Fix more typos, “an”→“a” and “an”→“and” 2021-08-22 17:57:35 +02:00
Weihang Lo 8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
bors a2589dda38 Auto merge of #9574 - ehuss:weak-namespaced, r=alexcrichton
Unify weak and namespaced features.

This unifies weak and namespaced features in order to simplify the syntax and semantics.  Previously there were four different ways to specify the feature of a dependency:

* `package-name/feature-name` — Enables feature `package-name` on self and enables `feature-name` on the dependency. (Today's behavior.)
* `package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled and will also activates a feature named `package-name` (which must be defined implicitly or explicitly).
* `dep:package-name/feature-name` — Enables dependency `package-name`, and enables `feature-name` on that dependency. This does NOT enable a feature named "package-name".
* `dep:package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled.  This does NOT enable a feature named "package-name".

This changes it so there are only two:

* `package-name/feature-name` — Today's behavior.
* `package-name?/feature-name` — Only enables `feature-name` on the given package if it that package is enabled.  This does NOT enable a feature named "package-name" (the same behavior as `dep:package-name?/feature-name` above).

This is a fairly subtle change, and in most cases probably won't be noticed.  However, it simplifies things which helps with writing documentation and explaining how it works.
2021-06-22 21:02:31 +00:00
Eric Huss b73e3d4fa5 Don't export lines_match.
Use better high-level interfaces to achieve the same thing.
2021-06-16 09:44:29 -07:00
Eric Huss 9034e488ff Unify weak and namespaced features. 2021-06-11 07:27:33 -07:00
hi-rustin f9a5625733 add default_run to SerializedPackage
Delete "default_run": null,
2021-06-07 14:59:57 +08:00
Eric Huss 85854b1884 Refactor feature handling, and improve error messages. 2021-03-19 14:59:53 -07:00
Eric Huss be28b58b45 Add features2 to the index. 2021-02-10 11:15:19 -08:00
Eric Huss 2a07061b38 Fix publishing with optional dependencies. 2020-11-12 10:44:10 -08:00
Eric Huss f4ac82a0f5 Rename crate: to dep: 2020-10-25 12:51:27 -07:00
Eric Huss 8ff130bb28 Rename "explicit" to "crate_prefix". 2020-10-23 16:32:15 -07:00
Eric Huss b2cceaf76e Expose implicit features in cargo metadata. 2020-10-23 16:04:41 -07:00
Eric Huss bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Eric Huss 2611f5c73c Move namespaced features tests to a separate file. 2020-10-23 16:04:41 -07:00