Commit graph

12 commits

Author SHA1 Message Date
bors 4963d884a4 Auto merge of #5300 - djc:namespaced-features, r=alexcrichton
Introduction of namespaced features (see #1286)

I think this basically covers all of the plans from #1286, although it still needs a bunch of tests and documentation updates. Submitting this PR to get some early feedback on the direction.
2018-04-30 17:52:35 +00:00
Dirkjan Ochtman 0b6f420670 Put namespaced features behind a feature gate 2018-04-30 17:33:36 +02:00
Aleksey Kladov d369f97c19 Revert "Enable new behavior of --feature"
This reverts commit 038eec5cb3.
2018-04-28 17:28:39 +03:00
Dirkjan Ochtman dc5d023482 Add tests for namespaced features 2018-04-28 13:41:18 +02:00
Aleksey Kladov 038eec5cb3 Enable new behavior of --feature 2018-04-19 00:34:45 +03:00
Dirkjan Ochtman 90954d700c Correct formatting with cargo fmt 2018-04-13 19:59:55 +02:00
Aleksey Kladov 8d0b31b975 New semantics for --features flag
Historically, feature-related flags like `--all-features`,
`--no-default-features` and `--features` operated on the *current*
package. That is, `cargo --package foo --feature feat` would activate
`feat` for the package at the current working directory, and not for the
`foo` package. `-Z package-features` flag implements the more obvious
semantics for this combination of flags. This changes behavior, and that
is why we want to start with an unstable opt-in. The changes are:

* `--feature` flag affects the selected package. It is an error to
  specify `--feature` with more than a single `-p`, or with `-p` outside
  workspace (the latter could work in theory, but would be hard to
  implement).

* `--all-features` and `--no-default-features` affect all selected
  packages, and not the one at cwd.

* The package in `cwd` is not implicitly enabled when doing feature
  selection. That is, `cargo build -Z package-features -p foo` could
  select *less* features for various packages than `cargo build -p foo`.
2018-04-13 17:36:09 +03:00
Aleksey Kladov b0c181d91c Prettify rustfmted single-line strings 2018-03-14 17:48:44 -07:00
Alex Crichton 1e6828485e cargo fmt 2018-03-14 17:48:23 -07:00
Eh2406 2cbd1ddc93 fix cause and the error messages 2018-03-01 13:24:26 -05:00
Eh2406 5d4402ce17 fix the todo's
needs a test where we have an activation_error the then try activate something that dose not work and backtrack to where we had the activation_error then:
- Hit fast backtracking that go past the crate with the missing features
- Or give a bad error message that does not mention the activation_error.
The test will pass, but there is code that is not yet justified by tests
2018-03-01 06:34:17 -05:00
André Rocha c2ff988c9f Reorganize integration tests as one crate with many modules. Issue #4867. 2018-02-21 13:33:51 -05:00
Renamed from tests/features.rs (Browse further)