Commit graph

5795 commits

Author SHA1 Message Date
Ed Page
e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
bors
571edcb733 Auto merge of #13411 - linyihai:hint-for-cargo-new, r=epage
feat: Add hint for adding members to workspace

### What does this PR try to resolve?

Fixes https://github.com/rust-lang/cargo/issues/13403

### How should we test and review this PR?
Reviewd commit by commit

### Additional information
2024-02-08 11:35:56 +00:00
bors
ccc84ccec4 Auto merge of #13415 - oli-obk:relax_test_for_rustc_changes, r=weihanglo
Relax a test to permit warnings to be emitted, too.

This change is necessary to allow rustc to actually start emitting the warning about the unused `mut`

See the test failure in https://github.com/rust-lang/rust/pull/120550#issuecomment-1931802095 for where this happens.
2024-02-07 15:37:49 +00:00
Oli Scherer
e60678fae0 Relax a test to permit warnings to be emitted, too.
This change is necessary to allow rustc to actually start emitting the warning about the unused `mut`
2024-02-07 15:16:40 +00:00
bors
9a6bafd956 Auto merge of #13416 - weihanglo:disable-lldb, r=epage
test: disable lldb test as it requires privileges to run on macOS

Resolves #13413
2024-02-07 14:53:24 +00:00
Weihang Lo
cd1f08899e
test: disable lldb test as it requires privileges to run on macOS 2024-02-07 09:45:25 -05:00
bors
993418efd7 Auto merge of #13410 - epage:note, r=weihanglo
fix: Switch more notes/warnings to lowercase

See https://doc.crates.io/contrib/implementation/console.html#style

By fixing existing cases, we make it more likely people will copy a case they should.

I left out multi-sentence cases because I was unsure how to handle those
2024-02-07 03:07:12 +00:00
Ed Page
69eb49194b fix: Switch more notes/warnings to lowercase
See https://doc.crates.io/contrib/implementation/console.html#style

By fixing existing cases, we make it more likely people will copy a case
they should.

I left out multi-sentance cases because I was unsure how to handle those

r? @weighanglo
2024-02-06 19:52:12 -06:00
bors
bb9b25f213 Auto merge of #13391 - linyihai:non_workspace_add_lib, r=weihanglo
Don't add the new package to workspace.members if there is no existing workspace in Cargo.toml.

### What does this PR try to resolve?
Fixed https://github.com/rust-lang/cargo/issues/13345

If the current package has no workspace table in Cargo.toml,  then if you run `cargo add  foo`, don't create the workspace inline item and don't add `foo` into the workspace.members.

### How should we test and review this PR?
Reviewed by commit by commit.

### Additional information
2024-02-06 13:02:36 +00:00
Lin Yihai
9be95dfb1c feat: Add hint for adding members to workspace 2024-02-06 13:30:56 +08:00
Ed Page
012ca52bcc fix(update): Start note/warn with lowercase 2024-02-05 10:55:01 -06:00
Lin Yihai
0391b14a9b fix: Don't add the new package to workspace.members if there is no existing workspace in Cargo.toml 2024-02-05 21:12:15 +08:00
Lin Yihai
3a4fdba907 test: Add library package into non-workspace package 2024-02-02 11:32:44 +08:00
bors
cdf84b69d0 Auto merge of #13388 - Nemo157:panic-abort-doc-tests, r=epage
Apply `-Zpanic-abort-tests` to doctests too

### What does this PR try to resolve?

`cranelift` doesn't support unwinding, which causes issues with `should_panic` tests. Attempting to use `-Zpanic-abort-tests` to fix that still fails with doctests because they attempt to use unwinding. `rustdoc` already supports specifying `-Cpanic=abort` and correctly handles ` ```should_panic` tests with it enabled, so we can just start passing it when `-Zpanic-abort-tests` is set.

Fixes https://github.com/rust-lang/rust/issues/120578 (when using `-Zbuild-std=std,panic_abort` too)
2024-02-02 19:39:16 +00:00
Wim Looman
255914696a
Apply -Zpanic-abort-tests to doctests too 2024-02-02 19:45:15 +01:00
Alex Crichton
1439b3fbe9 Don't print rustdoc command lines on failure by default
This commit lifts a helper function from invoking rustc to additionally
being used for invoking rustdoc. This enables hiding the command line
invocation of `rustdoc` by default when it fails, although it's still
available to see with `--verbose`. The intention here is to match the
behavior of `cargo build` for rustc failures here and was inspired by
recently running `cargo doc` and not being able to see the actual
failure as the command line ended up taking the whole screen (afterwards
I made the screen bigger and that helped too).
2024-02-02 10:33:07 -08:00
Wim Looman
4ebbda15e1
Ensure nonzero_exit_code test isn't affected by developers RUST_BACKTRACE setting 2024-02-02 16:04:21 +01:00
Ed Page
dce58dc76d fix(update): Show updates for all relevant packages 2024-02-01 14:01:07 -06:00
Ed Page
0034ea3bbf test(update): Show lack of message on old 2024-02-01 12:59:30 -06:00
bors
a4fe27a4ba Auto merge of #13383 - Urgau:check-cfg-docsrs, r=epage
Add `docsrs` cfg as a well known `--check-cfg`

Now that https://github.com/rust-lang/docs.rs/pull/2390 has been merged we can add the `docsrs` cfg in Cargo well known --check-cfg "list". The `docsrs` cfg used by at least [3k project on GitHub](https://github.com/search?q=lang%3Atoml+%2Frustdoc-args+%3D+%5C%5B%22--cfg%22%2C+%22docsrs%22%5C%5D%2F+NOT+is%3Afork&type=code&repo=&langOverride=&start_value=1) alone; including the cfg will help reduce the impact of enabling by default this feature.

> We include it here (in Cargo) instead of rustc, since there is a much closer relationship between Cargo and docs.rs than rustc and docs.rs. In particular, all users of docs.rs use Cargo, but not all users of rustc (like Rust-for-Linux) use docs.rs.

This is part of the last remaining bits of the `--check-cfg` feature.

r? `@epage`
2024-02-01 18:07:25 +00:00
Urgau
dfc40a0ca6 Add docsrs cfg as a well known --check-cfg 2024-02-01 18:53:51 +01:00
Ed Page
b05dc26a08 fix(update): Help people discover how they pull in a stale dep
I put this behind `--verbose`
- To keep the output down in the standard case
- Because its assuming  most people's "behind" dependencies will be
  "Unchanged" and so that is when knowing how to look up how its pulled
  in is useful
2024-01-30 20:49:32 -06:00
Ed Page
967e199be7 test(update): Remove unnecesary verbose 2024-01-30 20:49:32 -06:00
Ed Page
21dfe88079 fix(update): Call out pre-releases when relevant 2024-01-30 20:16:32 -06:00
Ed Page
c89ac1f234 feat(update): Summarize unchanged packages with updates
`--verbose` will show them.

This is prep for telling the user about `--breaking` and other flags.
2024-01-30 20:16:32 -06:00
Ed Page
b4ad206205 test(update): Show behavior for missing feature 2024-01-30 20:16:32 -06:00
Ed Page
94f67d0917 test(update): Compare verbose with and without updates 2024-01-30 20:16:32 -06:00
Ed Page
a1db0b1383 fix(update): Don't bother listing pre-release
There might be casses where we want to show pre-release as this grows
but, for now, there isn't too often a case where an update is held back,
you are on a pre-release, your pre-release is updating, and you want a pre-release.
2024-01-30 20:16:32 -06:00
Ed Page
e7f1009bc4 test(update): Latest alpha is shown 2024-01-30 20:16:32 -06:00
Ed Page
47a006eeea feat(update): Show available breaking versions 2024-01-30 20:16:32 -06:00
Ed Page
f49a8f44ab test(update): Show behind on breaking 2024-01-29 20:35:53 -06:00
Ed Page
7513b412fe fix(new): Print a note, rather than a comment, for more information
Fixes #12210
2024-01-29 15:38:04 -06:00
Esteban Küber
88bafd161e Change tests to support changes to suggestion
`rustc` will start marking the suggestions for prefacing unused bindings
with underscores as "maybe incorrect", which makes them no longer auto
applicable by `rustfix`.

Change done at https://github.com/rust-lang/rust/pull/120470.
2024-02-01 03:47:27 +00:00
Ed Page
bd6b4a9b14 fix(toml): Improve map/sequence error message
This is a follow up to #13375
2024-01-31 10:42:58 -06:00
Ed Page
1c05d412af fix(diagnostic): Don't panic on empty spans
There is another level to this bug where we better point to where the
error occurs.
2024-01-31 09:11:12 -06:00
Ed Page
f2a4a3e88b test(diagnostic): Show panic 2024-01-31 08:48:53 -06:00
bors
f8c152df3b Auto merge of #12852 - weihanglo:lockfile-v4, r=ehuss
feat: stabilize lockfile v4
2024-01-30 19:48:25 +00:00
bors
251d437564 Auto merge of #13367 - epage:new-creating, r=weihanglo
fix(new): Print a 'Creating', rather than 'Created' status

### What does this PR try to resolve?

This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
`@@` -1,3 +1,3 `@@`
+    Creating binary (application) package
 warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
 It is recommended to use a different name to avoid problems.
-     Created binary (application) package
```

### How should we test and review this PR?

### Additional information
2024-01-30 18:25:27 +00:00
bors
8ed4cb1ec8 Auto merge of #13335 - hi-rustin:rustin-patch-same-name, r=weihanglo
fix: use spec id instead of name to match package
2024-01-30 13:25:13 +00:00
hi-rustin
7a13864f29 test: add a cannot find case
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-01-30 20:55:50 +08:00
hi-rustin
240020d546 fix: use spec id instead of name to match package
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-01-30 20:55:40 +08:00
Ed Page
db54c040ae fix(new): Print a 'Creating', rather than 'Created' status
This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
@@ -1,3 +1,3 @@
+    Creating binary (application) package
 warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
 It is recommended to use a different name to avoid problems.
-     Created binary (application) package
```
2024-01-29 15:29:10 -06:00
bors
3e1a2ddc3e Auto merge of #13333 - weihanglo:precise-yank, r=Eh2406
feat(cargo-update): `--precise` to allow yanked versions
2024-01-29 21:25:44 +00:00
Weihang Lo
caeaaa529c
fix(cargo-update): once warn once for --precise <yanked>
This also tweaks the error message a bit.
2024-01-29 16:00:01 -05:00
Weihang Lo
bc5da432ef
test(cargo-update): verify `--precise <yanked> warns twice
This is not ideal and we need to track selected yanked versions.
2024-01-29 15:50:56 -05:00
Weihang Lo
f1aefdd9f7
test: data layout fix for x86_64-unknown-none-gnu 2024-01-28 15:52:14 -05:00
Ed Page
6eb2ddea20 fix(config): Deprecate non-extension files
In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months.  Over 4 years later, we are now
getting that warning.

 This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
2024-01-26 15:16:11 -06:00
Ed Page
a1525bca4d test(config): Improve failure output 2024-01-26 15:16:05 -06:00
Ed Page
7e8521162b test(config): Verify output for extension-less 2024-01-26 15:08:48 -06:00
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00