Commit Graph

170921 Commits

Author SHA1 Message Date
Eric Huss
24e0c44eb6 Update books 2022-06-22 16:12:32 -07:00
Yacin Tmimi
08105e80b7 Fix issue where cargo fmt --version would not display version info
Fixes 5395

In PR 5239 we switched from using `structopt` to `clap`. It seems that
the default behavior for `clap` is to override the `--version` flag,
which prevented our custom version display code from running.

The fix as outlined in https://github.com/clap-rs/clap/issues/3405 was
to set `#[clap(global_setting(AppSettings::NoAutoVersion))]` to prevent
clap from setting its own default behavior for the `--version` flag.
2022-06-22 17:47:00 -05:00
Yacin Tmimi
a187091568 Add idempotency test for issue 5399 2022-06-22 17:45:42 -05:00
Yacin Tmimi
0156575a32 Revert "Memoize format_expr"
Fixes 5399

Memoizing expressions lead to cases where rustfmt's stability guarantees
were violated.

This reverts commit a37d3ab0e1.
2022-06-22 17:45:42 -05:00
Ralf Jung
08789aa0f8 update Miri 2022-06-22 15:09:54 -07:00
Eric Huss
d23eea59f8 Add tracking issues to --extern option docs. 2022-06-22 14:03:58 -07:00
Josh Triplett
5cf5a5236f triagebot.toml: Sort and wrap the list of allowed labels 2022-06-22 14:02:48 -07:00
Josh Triplett
96cc0c691a triagebot.toml: Allow applying nominated labels
This seems likely to help more than it would hurt; let's see how it
goes.
2022-06-22 14:01:31 -07:00
Aaron Hill
36ccdbefbb
Remove (transitive) reliance on sorting by DefId in pretty-printer
This moves us a step closer to removing the `PartialOrd/`Ord` impls
for `DefId`. See #90317
2022-06-22 12:58:56 -05:00
Martin Nordholts
94477e3323 Fixup missing renames from #[main] to #[rustc_main]
In fc357039f9 `#[main]` was removed and replaced with `#[rustc_main]`.
In some place the rename was forgotten, which makes the current code
confusing, because at first glance it seems that `#[main]` is still
around. Perform the renames also in these places.
2022-06-22 18:24:09 +02:00
Guillaume Gomez
75ad2f7a76 Add test for keywords in rustdoc JSON output 2022-06-22 16:26:22 +02:00
Guillaume Gomez
8e40d93647 Filter out keyword items in rustdoc JSON output 2022-06-22 16:26:04 +02:00
Rose Hudson
53481a5a8f implement iter_projections function on PlaceRef
this makes the api more flexible. the original function now calls the PlaceRef
version to avoid duplicating the code.
2022-06-22 14:06:13 +01:00
Mara Bos
903357604d Work around llvm 12's memory ordering restrictions.
Older llvm has the pre-C++17 restriction on success and failure memory
ordering, requiring the former to be at least as strong as the latter.
So, for llvm 12, this upgrades the success ordering to a stronger one if
necessary.
2022-06-22 14:48:49 +02:00
Raoul Strackx
6a6910e5a9 Address reviewer comments 2022-06-22 13:49:12 +02:00
klensy
18ed1fa129 use -Cstrip=debuginfo with ui tests to reduce disk space usage 2022-06-22 14:43:59 +03:00
bors
10f4ce324b Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkov
Create elided lifetime parameters for function-like types

Split from https://github.com/rust-lang/rust/pull/97720

This PR refactor lifetime generic parameters in bare function types and parenthesized traits to introduce the additional required lifetimes as fresh parameters in a `for<>` bound.

This PR does the same to lifetimes appearing in closure signatures, and as-if introducing `for<>` bounds on closures (without the associated change in semantics).

r? `@petrochenkov`
2022-06-22 10:48:58 +00:00
bors
89a0783f1c Auto merge of #98375 - JohnTitor:rollup-e5c6rgo, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #95446 (update CPU usage script)
 - #96768 (Use futex based thread parker on Fuchsia.)
 - #97454 (Add release notes for 1.62)
 - #97516 (clarify how Rust atomics correspond to C++ atomics)
 - #97818 (Point at return expression for RPIT-related error)
 - #97895 (Simplify `likely!` and `unlikely!` macro)
 - #98005 (Add some tests for impossible bounds)
 - #98226 (Document unstable `--extern` options)
 - #98356 (Add missing period)
 - #98363 (remove use of &Alloc in btree tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-22 08:07:46 +00:00
Robin Raymond
5656de73d9 Fix debug info test 2022-06-22 06:51:39 +00:00
Yuki Okushi
db64923b80
Rollup merge of #98363 - RalfJung:btree-test-ref-alloc, r=thomcc
remove use of &Alloc in btree tests

I missed these in https://github.com/rust-lang/rust/pull/98233.

r? ``@thomcc``
2022-06-22 15:16:17 +09:00
Yuki Okushi
0cac62df1c
Rollup merge of #98356 - lucasthormann:patch-1, r=Mark-Simulacrum
Add missing period
2022-06-22 15:16:16 +09:00
Yuki Okushi
35597182ab
Rollup merge of #98226 - ChrisDenton:doc-extern-options, r=ehuss
Document unstable `--extern` options

These are needed for Cargo's `build-std` feature and for anyone who wanted to do a similar thing outside of Cargo.
2022-06-22 15:16:15 +09:00
Yuki Okushi
400751d40b
Rollup merge of #98005 - compiler-errors:impossible-bounds, r=Mark-Simulacrum
Add some tests for impossible bounds

Adds test for #93008
Adds test for #94680
Closes #94999
Closes #95640
2022-06-22 15:16:14 +09:00
Yuki Okushi
8f861dae7a
Rollup merge of #97895 - nbdd0121:unlikely, r=estebank
Simplify `likely!` and `unlikely!` macro

The corresponding intrinsics have long been safe-to-call, so the unsafe block is no longer needed.
2022-06-22 15:16:13 +09:00
Yuki Okushi
dfc6d7ac76
Rollup merge of #97818 - compiler-errors:rpit-error-spanned, r=oli-obk
Point at return expression for RPIT-related error

Certainly this needs some diagnostic refining, but I wanted to show that it was possible first and foremost. Not sure if this is the right approach. Open to feedback.

Fixes #80583
2022-06-22 15:16:12 +09:00
Yuki Okushi
25b84491f7
Rollup merge of #97516 - RalfJung:atomics, r=joshtriplett
clarify how Rust atomics correspond to C++ atomics

``@cbeuw`` noted in https://github.com/rust-lang/miri/pull/1963 that the correspondence between C++ atomics and Rust atomics is not quite as obvious as one might think, since in Rust I can use `get_mut` to treat previously non-atomic data as atomic. However, I think using C++20 `atomic_ref`, we can establish a suitable relation between the two -- or do you see problems with that ``@cbeuw?`` (I recall you said there was some issue, but it was deep inside that PR and Github makes it impossible to find...)

Cc ``@thomcc;`` not sure whom else to ping for atomic memory model things.
2022-06-22 15:16:11 +09:00
Yuki Okushi
75a2e5dddd
Rollup merge of #97454 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
Add release notes for 1.62

cc ``@rust-lang/release``

r? ``@pietroalbini``
2022-06-22 15:16:10 +09:00
Yuki Okushi
897745bf67
Rollup merge of #96768 - m-ou-se:futex-fuchsia, r=tmandry
Use futex based thread parker on Fuchsia.
2022-06-22 15:16:09 +09:00
Yuki Okushi
7b442f717e
Rollup merge of #95446 - notseanray:master, r=Mark-Simulacrum
update CPU usage script

I've made slight changes to the CPU usage plot script with updated links from the [ci2 aws instance](https://rust-lang-ci2.s3.amazonaws.com/).
2022-06-22 15:16:08 +09:00
Takayuki Maeda
eb86daa138 add "was" to pluralize macro and use it 2022-06-22 14:56:40 +09:00
Joshua Nelson
81482e67cb Remove individual crate checks for bootstrap in tidy
This duplicates a lot of checking, and doesn't seem particularly useful -
these are already caught in review.

Note that this still keeps the license check.
2022-06-22 00:33:35 -05:00
Joshua Nelson
345eb14f6c Remove vendoring support when building from git sources
This is difficult to support without submodule handling in bootstrap.py, because cargo will refuse
to vendor sources unless it knows the Cargo.toml files of all tools in tree. Moving vendor support
to rustbuild means that rustbuild will be built without vendoring.

Rather than trying to solve this, just remove support altogether and require
people to use `rustc-src` if they want vendoring (or run `cargo vendor` manually).
2022-06-21 23:42:56 -05:00
Joshua Nelson
85c87f6c67 Add bootstrap to tidy check 2022-06-21 23:42:56 -05:00
Takayuki Maeda
402dceba99 point to type param definition when not finding variant, method and assoc type
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span`

use `body_id.owner` directly

add description to label
2022-06-22 13:40:20 +09:00
Ralf Jung
46b2454bad clarify Arc::clone overflow check comment 2022-06-21 21:14:03 -07:00
Joshua Nelson
9cde0f7877 Fully remove submodule handling from bootstrap.py
These submodules were previously updated in python because Cargo gives a hard error if toml files
are missing from the workspace:

```
error: failed to load manifest for workspace member `/home/jnelson/rust-lang/rust/src/tools/rls`

Caused by:
  failed to read `/home/jnelson/rust-lang/rust/src/tools/rls/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
failed to run: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /home/jnelson/rust-lang/rust/src/bootstrap/Cargo.toml
```

However, bootstrap doesn't actually need to be part of the workspace.
Remove it so we can move submodule handling fully to Rust, avoiding duplicate code between Rust and Python.

Note that this does break `cargo run`; it has to be `cd src/bootstrap && cargo run` now.
Given that we're planning to make the main entrypoint a shell script (or rust binary),
I think this is a good tradeoff for reduced complexity in bootstrap.py.
2022-06-21 22:55:43 -05:00
Chris Denton
c20e0e1e8e
Document unstable --extern options
Co-Authored-By: Joshua Nelson <github@jyn.dev>
Co-Authored-By: Eric Huss <eric@huss.org>
2022-06-22 04:12:26 +01:00
Takayuki Maeda
f847261478 stop pointing at definitions of missing fields 2022-06-22 12:01:41 +09:00
bors
3d829a0922 Auto merge of #97853 - TaKO8Ki:emit-only-one-note-per-unused-struct-field, r=estebank
Collapse multiple dead code warnings into a single diagnostic

closes #97643
2022-06-22 02:51:55 +00:00
Michael Goulet
e53b2baf29 Add some tests for impossible bounds 2022-06-21 18:40:42 -07:00
Michael Goulet
52409c4c90 Point at return expression for RPIT-related error 2022-06-21 18:23:37 -07:00
Michael Goulet
d15fed79b8 Improve suggestion for calling closure on type mismatch 2022-06-21 18:12:43 -07:00
Joshua Nelson
b052d76586 Address review comments from #98259
It got merged so fast I didn't have time to make changes xD
2022-06-21 19:44:53 -05:00
bors
a09c668c96 Auto merge of #98359 - JohnTitor:rollup-v30vyzr, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #97867 (lub: don't bail out due to empty binders)
 - #98099 (interpret: convert_tag_add_extra: allow tagger to raise errors)
 - #98199 (Move some tests to more reasonable directories)
 - #98334 (Add a full regression test for #73727)
 - #98336 (Remove the unused-`#[doc(hidden)]` logic from the `unused_attributes` lint)
 - #98344 (This comment is out dated and misleading, the arm is about TAITs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-22 00:28:20 +00:00
Ralf Jung
4768bfc6ef
hedge our bets
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2022-06-21 16:54:54 -07:00
Ralf Jung
1ca8b69e1c remove use of &Alloc in btree tests 2022-06-21 16:38:12 -07:00
Yuki Okushi
cb3322ae3d
Rollup merge of #98344 - spastorino:remove-misleading-comment, r=oli-obk
This comment is out dated and misleading, the arm is about TAITs

r? ```@oli-obk```

```@oli-obk``` unsure if you want to add a different comment of some sort.

```@bors``` rollup=always
2022-06-22 07:04:05 +09:00
Yuki Okushi
b887da1cb2
Rollup merge of #98336 - fmease:remove-faulty-doc-hidden-lint, r=GuillaumeGomez
Remove the unused-`#[doc(hidden)]` logic from the `unused_attributes` lint

Fixes #96890.

It was found out that `#[doc(hidden)]` on trait impl items does indeed have an effect on the generated documentation (see the linked issue). In my opinion and the one of [others](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60/near/281846219), rustdoc's output is actually a bit flawed in that regard but that should be tracked in a new issue I suppose (I will open an issue for that in the near future).

The check was introduced in #96008 which is marked to be part of version `1.62` (current `beta`). As far as I understand, this means that **this PR needs to be backported** to `beta` to fix #96890 on time. Correct me if I am wrong.

CC `@dtolnay` (in case you would like to agree or disagree with my decision to fully remove this check)

`@rustbot` label A-lint T-compiler T-rustdoc

r? `@rust-lang/compiler`
2022-06-22 07:04:04 +09:00
Yuki Okushi
880ac7c51e
Rollup merge of #98334 - JohnTitor:issue-73727, r=compiler-errors
Add a full regression test for #73727

Closes #73727

This also moves a test to the `issues` directory as it's also tested on the adt_const_params feature.

r? ```@compiler-errors```

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-22 07:04:03 +09:00
Yuki Okushi
65f74c66c2
Rollup merge of #98199 - c410-f3r:z-errors, r=petrochenkov
Move some tests to more reasonable directories

r? `@petrochenkov`
2022-06-22 07:04:02 +09:00