6277 Commits

Author SHA1 Message Date
Dale Wijnand
f8c9928cc1
Rework some test projects to use the "foo" default
Generally that means either switching "foo" and "bar" around (reversing
the arrow), or it means push "foo" to "bar" (and sometimes "bar" to
"baz", etc..) to free up "foo".

For trivia that leaves 80/1222 outliers, therefore 93.4% of test
project use the default. :)
2018-07-21 19:40:45 +01:00
bors
8482505975 Auto merge of #5752 - dwijnand:project_at, r=alexcrichton
Remove the argument from the `project` test support function

By rewriting the tests, with rerast (https://github.com/google/rerast), to
use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
       project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
       replace!(project("foo") => project_foo());
       replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests

Fixes #5746
2018-07-20 16:42:57 +00:00
Dale Wijnand
6da2ada26d
Migrate trailing calls to project with an argument
.. in docs, commented code & tests targetting non-macos.
2018-07-20 15:25:51 +01:00
Dale Wijnand
7fe2fbc8a3
Remove the argument from the project test support function
By rewriting the tests, with rerast (https://github.com/google/rerast),
to use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
        project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
        replace!(project("foo") => project_foo());
        replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests
2018-07-20 13:31:50 +01:00
Dale Wijnand
d7d513e95e
Add tests/ProjectBuilder::at 2018-07-19 13:55:39 +01:00
bors
04c90d38af Auto merge of #5741 - rust-lang:dependabot/cargo/termcolor-1.0, r=alexcrichton
Update termcolor requirement to 1.0

Updates the requirements on [termcolor](https://github.com/BurntSushi/termcolor) to permit the latest version.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/BurntSushi/termcolor/commits/wincolor-1.0.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
2018-07-18 14:56:41 +00:00
dependabot[bot]
413e6489ff
Update termcolor requirement to 1.0
Updates the requirements on [termcolor](https://github.com/BurntSushi/termcolor) to permit the latest version.
- [Release notes](https://github.com/BurntSushi/termcolor/releases)
- [Commits](https://github.com/BurntSushi/termcolor/commits/wincolor-1.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-18 05:36:04 +00:00
bors
8d211fb4a0 Auto merge of #5735 - enizor:doc-profile-debug, r=alexcrichton
Doc: manifest profile.X.debug can be either an u32 or a bool

See #5734
2018-07-17 17:26:30 +00:00
Rémi Garde
a547302e7a Doc: manifest profile.X.debug can be either an u32 or a bool
Fixes #5734
2018-07-17 19:02:50 +02:00
bors
506eea76ed Auto merge of #5723 - alexcrichton:cargo-fix, r=ehuss
Import `cargo fix` directly in to Cargo

This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.

It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.

cc rust-lang/rust#52272
2018-07-17 16:28:32 +00:00
Alex Crichton
b02ba3771e Import cargo fix directly in to Cargo
This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.

It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.

cc rust-lang/rust#52272
2018-07-16 21:58:58 -07:00
bors
558eee4fbc Auto merge of #5732 - Eh2406:sort_unstable, r=alexcrichton`,
most sorts can be unstable

Inspired by [this](94f7058a48/src/bin/cargo/main.rs (L112-L122)) witch was improved in #5691, I did a quick review of `sort`s in the code. Most can be unstable, some can use a `_key` form, and none had unnecessary allocation.
2018-07-16 21:45:15 +00:00
Eh2406
c74aa9490e most sorts can be unstable 2018-07-16 16:57:38 -04:00
bors
e325bff3c4 Auto merge of #5710 - RalfJung:default-run, r=alexcrichton
implement default-run option to set default binary for cargo run

The implementation is not pretty but as good as I could make it. The fact that all this logic in `cargo_run` is for diagnosis only and essentially just re-implements the filtering done elsewhere really threw me off.

Fixes #2200
2018-07-16 20:47:38 +00:00
Ralf Jung
34a5cfb084 document new feature 2018-07-16 21:48:47 +02:00
Ralf Jung
04abd5ef2f fix code nits 2018-07-16 21:48:14 +02:00
Ralf Jung
579e0348d7 order of lits of binaries is not stable 2018-07-16 21:48:14 +02:00
Ralf Jung
c955c60e6b feature-gate default-run 2018-07-16 21:48:14 +02:00
Ralf Jung
5936f6ae9e implement default-run option to set default binary for cargo run 2018-07-16 21:48:14 +02:00
bors
fefbb68f89 Auto merge of #5691 - Eh2406:hyphen-underscore, r=alexcrichton
Make index lookup robust to _ vs -, but don't let the user get it wrong.

This does a brute force search thru combinations of hyphen and underscores to allow queries of crates to pass the wrong one.

This is a small first step of fixing #2775

Where is best to add test?
2018-07-16 19:35:38 +00:00
Eh2406
95b4640b32 only suggest lev_distance < 4 2018-07-16 15:28:53 -04:00
bors
06721dd6b6 Auto merge of #5543 - roblabla:doc-private-items, r=alexcrichton
Add document-private-items flag to cargo doc

Add a `--document-private-items` flag to `cargo doc`, that mimics the equivalent `cargo rustdoc -- --document-private-items`. This works by relaying the flag to the underlying rustdoc call.
2018-07-16 00:26:07 +00:00
roblabla
7757753b28 Verify that private items were actually documented 2018-07-15 20:22:22 +02:00
roblabla
4a11afc59f Add a test for document-private-items 2018-07-15 20:10:01 +02:00
bors
caf810b8f1 Auto merge of #5726 - ehuss:warn-virtual-keys, r=alexcrichton
Warn about unused virtual manifest keys.

Fixes #4243
2018-07-15 17:20:14 +00:00
bors
7cbca147ce Auto merge of #5727 - Eh2406:todos, r=alexcrichton
fix some Todo's

Just grep for todo and fix the simple ones.
2018-07-15 04:08:43 +00:00
Eh2406
c01a189980 recv_timeout was stable in 1.12 2018-07-14 22:50:00 -04:00
Eh2406
89e07849f7 remove unused Serialize 2018-07-14 22:42:38 -04:00
Eh2406
e745a81a5e remove unused Deserialize 2018-07-14 22:41:06 -04:00
Eh2406
992427843f remove incorrect todo
I tried repeatedly to remove the Rc with nll on.
`query` works, but it can not be called repeatedly.
2018-07-14 22:35:04 -04:00
Eric Huss
688a4fa6b3 Warn about unused virtual manifest keys.
Fixes #4243
2018-07-14 09:20:15 -07:00
Eh2406
98e1bdb762 oops... 2018-07-13 18:05:24 -04:00
bors
738c42d4dc Auto merge of #5715 - euclio:third-party-help, r=alexcrichton
help: display external subcommand help

When invoking `cargo help <subcommand>`, if the subcommand isn't found, but it *is* an external subcommand, call that subcommand with `--help`.

A test should probably be written for this, but I'm not sure how best to mock an external subcommand.
2018-07-13 22:02:09 +00:00
Andy Russell
dca0db2dce
document custom subcommand help 2018-07-13 17:09:10 -04:00
Eh2406
fc7ef626f7 add tests 2018-07-13 16:39:09 -04:00
Eh2406
335f64180f move the Uncanonicalizing loop to a Iterator 2018-07-13 16:27:42 -04:00
bors
5cddc4b8c6 Auto merge of #5711 - alexcrichton:fix-stack-overflow, r=ehuss
Partially revert dep changes in #5651

Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.

The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.

Closes #5708
2018-07-13 19:18:22 +00:00
Andy Russell
9e41e383ac
help: display external subcommand help 2018-07-13 15:09:00 -04:00
bors
39e74951b6 Auto merge of #5700 - alexcrichton:update-width, r=matklad
Update terminal width each time we print a display

This should help accomodate terminals that are resized while a progress bar is
being displayed. Additionally this shouldn't come with too much of a performance
impact because we're already heavily throttling printing of a progress update!

Closes #4732
2018-07-13 18:39:46 +00:00
Alex Crichton
f9d4927b26 Partially revert dep changes in #5651
Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.

The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.

Closes #5708
2018-07-13 10:54:22 -07:00
bors
88f92e50af Auto merge of #5712 - alexcrichton:better-debug, r=ehuss
Improve Debug display for a few types

Try to cut down on the wordiness here and make these implementations a bit more
usable by default.
2018-07-13 17:30:22 +00:00
Eh2406
2bac06c738 sort suggestions by distance 2018-07-12 13:25:42 -04:00
bors
a5617dfcf3 Auto merge of #5716 - kennytm:unstable-compile-progress, r=alexcrichton
Reintroduce the compile progress bar as an unstable feature (-Z compile-progress)

This allows us to test the feature on-demand to see if there's any other bugs besides #5695.

Also, fixed the flickering #5697 (this was caused by build script emitting Stdout/Stderr events).
2018-07-12 15:26:27 +00:00
kennytm
9612be6803
Compile progress: Do not update when a build script prints something.
Fix #5697. There may still be some little flickering, but should be much
less severe than before.
2018-07-12 12:24:26 +08:00
kennytm
6ce9087450
Bring back the compile progress bar as an -Z option. 2018-07-12 11:28:32 +08:00
Eh2406
3f5036ae4d update test to get ci passing 2018-07-11 23:26:01 -04:00
bors
15e6361e59 Auto merge of #5714 - jeremyBanks:docs-project-to-package, r=alexcrichton
Replace remaining uses of `[project]` in documentation with `[package]`

The `[project]` section is not currently referenced anywhere else in the documentation, so the use here confused me, and I spent a while trying to add it to a `Cargo.toml` that already had a `[package]`.

`[project]` seems to be a deprecated alias for `[package]`, which is documented, so let's swap it out.
2018-07-11 18:45:25 +00:00
bors
5486fa752e Auto merge of #5713 - mbrubeck:doc, r=alexcrichton
Clarify FAQ about Cargo.lock for libraries

The current wording in the FAQ implies that checking in a Cargo.lock for a library could cause version conflicts in consumers of the library, which is not true.

The text in the FAQ was based on [this comment][1] (emphasis mine):

> If each dependent library checked in a Cargo.lock, **and Cargo used it,** you would instead get multiple, duplicate copies of those dependencies

but it accidentally dropped the "and Cargo used it" requirement, which I think is the more important part.

[1]: https://github.com/rust-lang/cargo/pull/534#issuecomment-54776481
2018-07-11 18:24:19 +00:00
Jeremy Banks
fd1fd6cfe2
Replace remaining uses of [project] in documentation with [package]
The `[project]` section is not currently referenced anywhere else in the documentation, so the use here confused me. It seems to be a deprecated alias for `[package]`, which is documented, so let's swap it.
2018-07-11 13:52:53 -04:00
Eh2406
84cc3d8b09 allow each source to recommend packages that are close to a dependency 2018-07-11 12:46:52 -04:00