Commit graph

9966 commits

Author SHA1 Message Date
bors 2c10f2611f Auto merge of #8675 - weihanglo:fix/name-help, r=Eh2406
Add --name suggestion for cargo new

Resolves #8613

Since `check_name` have already got a parameter to show name help, I reuse the logic and sync the behavior between `cargo init` and `cargo new`. The divergence seems to be intentionally made in #7959:

_...Only print the --name suggestion for `cargo init`._

Feel free to discuss.
2020-09-10 19:06:19 +00:00
bors f110fd9fc1 Auto merge of #8681 - weihanglo:fix/redundant-messsage-local-crate-install, r=ehuss
Sweep unrelated message from unnecessary workspace infromation

Resolves #8619

Only pass workspace information when the source is from a local crate installation.
2020-09-10 18:40:48 +00:00
Weihang Lo c6fcb0e2ef
Fix unintenional newline in stderr assertion 2020-09-11 01:02:59 +08:00
Weihang Lo 2fbce89dd6
Rephrase message of restricted crate name 2020-09-11 00:39:51 +08:00
Weihang Lo a527caa248
test: check stderr containment explicitly 2020-09-10 07:57:57 +08:00
bors 738f461868 Auto merge of #8666 - clemens-tolboom:patch-1, r=Eh2406
Docs: Make it more clear we have two types of workspaces

It needed a few rereads before I discovered the two flavours. Hope this helps.
2020-09-09 21:59:25 +00:00
Weihang Lo 45cfd0cd12
Fix formatting 2020-09-10 00:26:30 +08:00
Weihang Lo 71cae39de0
Test for crate installation without emitting messages from cwd 2020-09-10 00:20:35 +08:00
bors 875e012325 Auto merge of #8655 - camelid:patch-1, r=ehuss
Lowercase and remove periods in error messages for consistency
2020-09-08 20:17:21 +00:00
Camelid 82c834cec2 Update tests 2020-09-07 10:57:00 -07:00
bors 99134aee39 Auto merge of #8682 - dtolnay:build-man, r=ehuss
Allow running build-man.sh from any directory

Before:

```console
$ src/doc/build-man.sh
error: manifest path `../../crates/mdman/Cargo.toml` does not exist
```

After: works.
2020-09-06 19:38:33 +00:00
David Tolnay 92965441c7
Allow running build-man.sh from any directory
Before:

    $ src/doc/build-man.sh
    error: manifest path `../../crates/mdman/Cargo.toml` does not exist

After: works.
2020-09-06 12:09:15 -07:00
Weihang Lo 392b902f06
Only --path and cwd crate installation need workspace info 2020-09-06 19:24:15 +08:00
Weihang Lo f92961923b
Sweep unrelated message from unnecessary workspace infromation 2020-09-06 13:29:52 +08:00
bors cb7ba3d4e4 Auto merge of #8677 - Rustin-Liu:rustin-patch-docs, r=ehuss
docs: add details for cargo check pass where cargo build fail

close  #8650
2020-09-05 18:45:58 +00:00
bors f40f7a78f8 Auto merge of #8678 - ehuss:fix-priv-test, r=alexcrichton
Fix nightly exported_priv_warning test.

Error messages have slightly changed due to https://github.com/rust-lang/rust/pull/73996 to not include the full path.  I used a `[..]` match just in case anyone is still using a slightly older nightly, or if it changes again in the future.
2020-09-05 17:44:58 +00:00
Eric Huss fd25718660 Fix nightly exported_priv_warning test. 2020-09-05 10:31:04 -07:00
Rustin-Liu 2ca439394a docs: add details for cargo check pass where cargo build fail 2020-09-05 11:17:06 +08:00
bors e1d3e13637 Auto merge of #8674 - guswynn:mdbooktest, r=ehuss
fix mdbook test with ```ignore/text/sh/console

I revitalized the dead PR #7832

sorry about the delay

testing is just running `mdbook test` which now passes! Let me know if you want me to add mdbook test to ci as well!
2020-09-04 13:55:31 +00:00
Gus Wynn a6e322bc98 fix mdbook test with ```ignore 2020-09-03 18:27:02 -07:00
Weihang Lo c00ad7922d
Fix test for windows reserved filename error message 2020-09-04 09:18:47 +08:00
Weihang Lo 9cda385ab3
Test for --name hint 2020-09-04 08:39:13 +08:00
Weihang Lo 3042ec68b6
Add --name hint for new when package name is retricted 2020-09-04 01:27:46 +08:00
bors 1857880b51 Auto merge of #8672 - dtolnay:cachedir, r=alexcrichton
End CACHEDIR.TAG with newline

Before:

```
/path/to$  cat target/CACHEDIR.TAG
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir//path/to$  ▎
```

After:

```
/path/to$  cat target/CACHEDIR.TAG
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/
/path/to$  ▎
```
2020-09-01 22:14:09 +00:00
bors 99eb3fd8aa Auto merge of #8671 - pjmore:master, r=alexcrichton
Fixed the fossil repo initialization actually run commands

I noticed that when using fossil cargo new would not ignore the target directory and that the commands to do so weren't being executed. I wasn't sure if opening an issue was needed as the fix is extremely simple, if an issue is needed I can create one.
2020-09-01 21:52:17 +00:00
David Tolnay 87f5ce38d8
End CACHEDIR.TAG with newline 2020-09-01 13:05:05 -07:00
Patrick More d27170e75f Modified the fossil repo initialization function to run the commands to
set the target directory as ignoreable and cleanable.
2020-09-01 11:56:36 -07:00
bors 2ab080c392 Auto merge of #8670 - ehuss:remove-asciidoc-attribute, r=Eh2406
Remove asciidoc attribute in cargo-metadata man page.

I accidentally left this behind during #8577.
2020-09-01 18:30:39 +00:00
Eric Huss 389c2782cd Remove asciidoc attribute 2020-09-01 10:46:45 -07:00
bors 126907a7cf Auto merge of #8668 - alexcrichton:fix-close-output, r=ehuss
Fix flakiness in close_output test

It looks like stdout/stderr can race as to which gets printed first, but
both are valid for this test.

Closes #8665
2020-08-31 20:42:11 +00:00
Alex Crichton bf10871c32 Fix flakiness in close_output test
It looks like stdout/stderr can race as to which gets printed first, but
both are valid for this test.

Closes #8665
2020-08-31 13:15:30 -07:00
Clemens Tolboom ae28555da9
Make it more clear we have two types of workspaces
It needed a few rereads before I discovered the two flavours. Hope this helps.
2020-08-31 17:15:35 +02:00
bors d6b5b53772 Auto merge of #8656 - phil-opp:fix-8512, r=ehuss
Reload unstable table from config file in `reload_rooted_at`

Fixes #8512

cc @ehuss
2020-08-31 15:01:14 +00:00
bors 6585cda2a7 Auto merge of #8659 - ehuss:version-bump, r=alexcrichton
Bump to 0.49.0, update changelog
2020-08-28 19:59:18 +00:00
Eric Huss f60962405f Update changelog for 1.47 2020-08-28 11:14:38 -07:00
Eric Huss f2f12ba6a2 Bump to 0.49.0 2020-08-28 10:17:49 -07:00
bors 55e59bdfd3 Auto merge of #8657 - ehuss:fix-doctest-lto, r=alexcrichton
Fix LTO with doctests.

This fixes an issue where `cargo test --release` would fail to run doctests if LTO is set in `profile.release` or `profile.bench`.

The issue is that dependencies were built with `-Clinker-plugin-lto`, but the final rustdoc invocation did not issue `-C lto`. This causes a link failure (or crash!) because the necessary object code was missing.  This is because rustdoc historically did not support codegen flags, so Cargo has never passed them in.  Rustdoc now supports codegen flags (via https://github.com/rust-lang/rust/pull/63827), so it should be safe to start passing them in.  For now, I am only adding LTO, but more should be added in the future.

There are two bugs here. One is that LTO flags aren't passed to rustdoc. The other is that the "doctest" unit was using the wrong profile (it was using dev/release when it should be using test/bench).

There are two distinct scenarios here.  One where just `release` has `lto` set.  And one where both `release` and `bench` have `lto` set.  This is relevant because LTO mostly cares about what the final artifact wants, and in the case where `bench` does not have `lto` set, then LTO will not be used for tests. This will hopefully be a little cleaner in the future when #6988 is stabilized, which causes the test/bench profiles to *inherit* from the dev/bench profiles, which means you won't need to manually synchronize the test/bench profiles with dev/release.

Fixes #8654
2020-08-28 15:39:13 +00:00
Eric Huss 5bbad10a8c Fix LTO with doctests. 2020-08-27 16:41:43 -07:00
Philipp Oppermann c5d8dcb323 Reload unstable table from config file in reload_rooted_at 2020-08-27 11:07:53 +02:00
Camelid a9424d978a
Remove periods from error messages 2020-08-26 19:51:53 -07:00
Camelid 8e7c0ab8d8
Lowercase docs error message for consistency 2020-08-26 18:51:36 -07:00
bors 888ae7266a Auto merge of #8648 - Fogapod:rustc-args, r=ehuss
Add spaces after -C and -Z flags for consistency

Most other options have a space after flag name.
This commit makes verbose output of rustc invocations a little bit cleaner.
2020-08-26 21:38:52 +00:00
bors 1d66f90d8e Auto merge of #8653 - ehuss:fix-cache-messages-rustdoc-test, r=alexcrichton
Fix cache_messages::rustdoc test broken on beta.

The most recent beta `rustc 1.47.0-beta.1` broke this test (https://github.com/rust-lang/rust/issues/75951).  Just switch to a different lint to get the test working again.
2020-08-26 18:59:57 +00:00
Eric Huss 10426acb54 Fix cache_messages::rustdoc test broken on beta. 2020-08-26 11:17:57 -07:00
Eugene 8164c1df3a Add spaces after -C and -Z flags for consistency
Most other options have a space after flag name.
This commit makes verbose output of rustc invocations a little bit cleaner.
2020-08-25 16:06:16 +03:00
bors 5165270dd4 Auto merge of #8641 - weihanglo:fix/remove-alloc, r=Eh2406
fix: remove unnecessary allocations

Remove unnecessary `str::to_string` and `str::replace` allocations by using iterators. This PR is almost identical to #8622 except it does not skip the generated header.

Sorry that I did not profile the changes by myself. Seems that valgrind does not support macOS 10.15.6, I have not idea how to profile cargo subcommand. It would be great for an instruction to run a memory profiling for Rust program on macOS.
2020-08-23 13:07:55 +00:00
Weihang Lo 0c70319afe
refactor: compare lockfile use Iterator.eq 2020-08-23 09:07:54 +08:00
Weihang Lo d86745bf99
fix: remove unnecessary allocations 2020-08-23 08:19:16 +08:00
bors 868a1cf00a Auto merge of #8637 - hbina:spelling_and_clippy, r=alexcrichton
Fixed a spelling and some clippy warnings
2020-08-20 17:29:36 +00:00
Hanif Bin Ariffin 47428433d4 Fixed a spelling and some clippy warnings 2020-08-19 18:20:51 -04:00