]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #86740 - 1000teslas:issue-71519-fix, r=petrochenkov
Yuki Okushi [Wed, 30 Jun 2021 20:20:59 +0000 (05:20 +0900)]
Rollup merge of #86740 - 1000teslas:issue-71519-fix, r=petrochenkov

copy rust-lld as ld in dist

Fixes bug in https://github.com/rust-lang/rust/pull/85961. Linking seems to work for pure Rust projects, but not when a C library needs to be dynamically linked.

3 years agoRollup merge of #86728 - FabianWolff:issue-86721, r=LeSeulArtichaut
Yuki Okushi [Wed, 30 Jun 2021 20:20:58 +0000 (05:20 +0900)]
Rollup merge of #86728 - FabianWolff:issue-86721, r=LeSeulArtichaut

Check node kind to avoid ICE in `check_expr_return()`

This PR fixes #86721. The ICE described there is apparently due to a misunderstanding:
https://github.com/rust-lang/rust/blob/e98897e5dc9898707bf4331c43b2e76ab7e282fe/compiler/rustc_typeck/src/check/expr.rs#L684-L685

Intuitively, one would think that calling `expect_item()` after `get_parent_item()` should succeed, but as it turns out, `get_parent_item()` can also return foreign, trait, and impl items as well as crates, whereas `expect_item()` specifically expects a `Node::Item`. I have therefore added an extra check to prevent this ICE.

3 years agoRollup merge of #86680 - camsteffen:dbg-opt-error, r=petrochenkov
Yuki Okushi [Wed, 30 Jun 2021 20:20:57 +0000 (05:20 +0900)]
Rollup merge of #86680 - camsteffen:dbg-opt-error, r=petrochenkov

Improve error for missing -Z with debugging option

Before:
```text
❯ rustc --unpretty=hir
error: Unrecognized option: 'unpretty'
```
After:
```text
❯ rustc --unpretty=hir
error: Unrecognized option: 'unpretty'. Did you mean `-Z unpretty`?
```

3 years agoRollup merge of #85520 - FabianWolff:issue-85475, r=jackh726
Yuki Okushi [Wed, 30 Jun 2021 20:20:55 +0000 (05:20 +0900)]
Rollup merge of #85520 - FabianWolff:issue-85475, r=jackh726

Fix typo and improve documentation for E0632

Edit: After https://github.com/rust-lang/rust/pull/85520#issuecomment-870095546, this PR has been boiled down to just an extended description for `E0632` and a fixed typo.

3 years agoRollup merge of #85504 - liigo:patch-13, r=Mark-Simulacrum
Yuki Okushi [Wed, 30 Jun 2021 20:20:54 +0000 (05:20 +0900)]
Rollup merge of #85504 - liigo:patch-13, r=Mark-Simulacrum

the foundation owns rust trademarks

3 years agoUpdate comments.
Camille GILLOT [Wed, 30 Jun 2021 18:52:00 +0000 (20:52 +0200)]
Update comments.

3 years agoFix AST pretty.
Camille GILLOT [Sun, 20 Jun 2021 16:52:35 +0000 (18:52 +0200)]
Fix AST pretty.

3 years agoMove AST crate.
Camille GILLOT [Fri, 11 Jun 2021 16:55:30 +0000 (18:55 +0200)]
Move AST crate.

3 years agoArena-allocate Crate during lowering.
Camille GILLOT [Fri, 11 Jun 2021 16:55:14 +0000 (18:55 +0200)]
Arena-allocate Crate during lowering.

3 years agoMove lowering to create_global_ctxt.
Camille GILLOT [Sun, 23 May 2021 19:42:16 +0000 (21:42 +0200)]
Move lowering to create_global_ctxt.

3 years agoInline lower_to_hir.
Camille GILLOT [Sun, 23 May 2021 19:30:03 +0000 (21:30 +0200)]
Inline lower_to_hir.

3 years agoSeparate resolver creation from expansion.
Camille GILLOT [Mon, 24 May 2021 16:45:21 +0000 (18:45 +0200)]
Separate resolver creation from expansion.

3 years agoSimplify DepGraph creation.
Camille GILLOT [Mon, 24 May 2021 17:24:58 +0000 (19:24 +0200)]
Simplify DepGraph creation.

3 years agoAdd suggestion for missing compile flag group
Cameron Steffen [Sun, 27 Jun 2021 23:15:16 +0000 (18:15 -0500)]
Add suggestion for missing compile flag group

3 years agoAuto merge of #7400 - popzxc:restrict-locales, r=Manishearth
bors [Wed, 30 Jun 2021 18:14:16 +0000 (18:14 +0000)]
Auto merge of #7400 - popzxc:restrict-locales, r=Manishearth

New lint: `disallowed_script_idents`

This PR implements a new lint to restrict locales that can be used in the code,
as proposed in #7376.

Current concerns / unresolved questions:

- ~~Mixed usage of `script` (as a Unicode term) and `locale` (as something that is easier to understand for the broad audience). I'm not sure whether these terms are fully interchangeable and whether in the current form it is more confusing than helpful.~~ `script` is now used everywhere.
- ~~Having to mostly copy-paste `AllowedScript`. Probably it's not a big problem, as the list of scripts is standardized and is unlikely to change, and even if we'd stick to the `unicode_script::Script`, we'll still have to implement custom deserialization, and I don't think that it will be shorter in terms of the amount of LoC.~~ `unicode::Script` is used together with a filtering deserialize function.
- Should we stick to the list of "recommended scripts" from [UAX #31](http://www.unicode.org/reports/tr31/#Table_Recommended_Scripts) in the configuration?

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: ``[`disallowed_script_idents`]``

r? `@Manishearth`

3 years agoImprove debug symbol names to avoid ambiguity and work better with MSVC's debugger
Daniel Paoliello [Thu, 24 Jun 2021 17:36:28 +0000 (10:36 -0700)]
Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger
There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types).

Instead, each debug symbol name should be unique and useful:
* Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified.
* Qualify the principal trait for dynamic types.
* If there is no principal trait for a dynamic type, emit all other traits instead.
* Respect the `qualified` argument when emitting ref and pointer types.
* For implementations, emit the disambiguator.
* Print const generics when emitting generic parameters or arguments.

Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly:
* Avoid characters with special meaning (`#`, `[`, `"`, `+`).
* Never start a name with `<` or `{` as this is treated as an operator.
* `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this).
* Emit function declarations using C/C++ style syntax (e.g., leading return type).
* Emit arrays as a synthetic `array$<type, size>` type.
* Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).

3 years agoalloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.
Miguel Ojeda [Wed, 30 Jun 2021 17:41:49 +0000 (19:41 +0200)]
alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.

Found in https://github.com/Rust-for-Linux/linux/pull/402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
3 years agoAdd support for leaf fn frame pointer elimination
Simonas Kazlauskas [Sat, 26 Jun 2021 20:53:35 +0000 (23:53 +0300)]
Add support for leaf fn frame pointer elimination

This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196

3 years agoMatch on `hir::TraitFn::Provided` instead of using `maybe_body_owned_by`
Fabian Wolff [Wed, 30 Jun 2021 16:27:07 +0000 (18:27 +0200)]
Match on `hir::TraitFn::Provided` instead of using `maybe_body_owned_by`

3 years agoImplement 'disallowed_script_idents' lint
Igor Aleksanov [Wed, 30 Jun 2021 16:06:33 +0000 (19:06 +0300)]
Implement 'disallowed_script_idents' lint

3 years agoAdd tests for cross-crate usage of `impl const`
Deadbeef [Wed, 30 Jun 2021 15:57:17 +0000 (23:57 +0800)]
Add tests for cross-crate usage of `impl const`

3 years agouse is_const_fn_raw when encoding constness
Deadbeef [Wed, 30 Jun 2021 15:56:43 +0000 (23:56 +0800)]
use is_const_fn_raw when encoding constness

this properly encodes cross-crate constness data.

3 years agoAuto merge of #7390 - popzxc:issue-7331, r=flip1995
bors [Wed, 30 Jun 2021 15:12:55 +0000 (15:12 +0000)]
Auto merge of #7390 - popzxc:issue-7331, r=flip1995

Improve lint message for match-same-arms lint

fixes #7331

Follow-up to #7377

This PR improves the lint message for `match-same-arms` lint and adds `todo!(..)`  example to the lint docs.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: None

3 years agoAuto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakis
bors [Wed, 30 Jun 2021 13:42:50 +0000 (13:42 +0000)]
Auto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakis

Introduce -Zprofile-closures to evaluate the impact of 2229

This creates a CSV with name "closure_profile_XXXXX.csv", where the
variable part is the process id of the compiler.

To profile a cargo project you can run one of the following depending on
if you're compiling a library or a binary:

```
cargo +nightly rustc --lib -- -Zprofile-closures
cargo +nightly rustc --bin {binary_name} -- -Zprofile-closures
```

r? `@nikomatsakis`

3 years agoAdd test to ensure that the typed queries are not including other types
Guillaume Gomez [Wed, 30 Jun 2021 12:20:17 +0000 (14:20 +0200)]
Add test to ensure that the typed queries are not including other types

3 years agoEnforce search typed queries
Guillaume Gomez [Wed, 30 Jun 2021 12:11:09 +0000 (14:11 +0200)]
Enforce search typed queries

3 years agoEmit explanatory note for functions in trait and impl items as well
Fabian Wolff [Wed, 30 Jun 2021 11:56:26 +0000 (13:56 +0200)]
Emit explanatory note for functions in trait and impl items as well

3 years agoAuto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157
bors [Wed, 30 Jun 2021 10:54:08 +0000 (10:54 +0000)]
Auto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157

Fix boldness (put it back where needed)

I realized that I created a GUI test that wasn't run because it had ".rs" extension instead of ".goml" so I moved its content into `font-weight.goml` (since it was checking font weight).

3 years agoAuto merge of #86739 - RalfJung:miri, r=RalfJung
bors [Wed, 30 Jun 2021 07:28:42 +0000 (07:28 +0000)]
Auto merge of #86739 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/86723
Cc `@rust-lang/miri` r? `@ghost`

3 years agoupdate Miri
Ralf Jung [Wed, 30 Jun 2021 07:21:20 +0000 (09:21 +0200)]
update Miri

3 years agocopy rust-lld as ld in dist
1000teslas [Sun, 13 Jun 2021 11:45:22 +0000 (21:45 +1000)]
copy rust-lld as ld in dist

3 years agoAuto merge of #86689 - rylev:future-compat-lint-group, r=nikomatsakis
bors [Wed, 30 Jun 2021 05:02:01 +0000 (05:02 +0000)]
Auto merge of #86689 - rylev:future-compat-lint-group, r=nikomatsakis

Only include lint in future_incompatible lint group if not an edition lint

A follow up to #86330 - this only includes lints annotated with `FutureIncompatibleInfo` in the `future_incompatibile` lint group if the future compatibility is not tied to an edition.

We probably want to rename `FutureIncompatibleInfo` to something else since this type is now used to indicate future breakages of all kinds (even those that happen in editions). I'd prefer to do that in a separate PR though.

r? `@nikomatsakis`

3 years agoUse a macro for documenting rustdoc
Joshua Nelson [Wed, 30 Jun 2021 03:05:02 +0000 (23:05 -0400)]
Use a macro for documenting rustdoc

3 years agoAuto merge of #86724 - cuviper:indexmap-1.7, r=Mark-Simulacrum
bors [Wed, 30 Jun 2021 02:20:50 +0000 (02:20 +0000)]
Auto merge of #86724 - cuviper:indexmap-1.7, r=Mark-Simulacrum

Upgrade to indexmap 1.7, using hashbrown 0.11

3 years agoAuto merge of #86522 - JohnTitor:move-ui-tests, r=petrochenkov
bors [Tue, 29 Jun 2021 23:40:00 +0000 (23:40 +0000)]
Auto merge of #86522 - JohnTitor:move-ui-tests, r=petrochenkov

Move some UI tests to more suitable subdirs

cc #73494
The classified result is here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427

- issues/issue-27060.rs: misclassified, should be packed.
- issues/issue-45157.rs: moved to nll.
- issues/issue-69532.rs: ~~couldn't figured out the best place, placed a new `llvm` dir~~ moved to consts.
- fsu-moves-and-copies.rs: moved to borrowck.
- issues/issue-36638.rs: misclassified, moved to keyword.
- issues/issue-48636.rs: moved to parser.
- issues/issue-37655.rs: I'm not sure but associated-types shouldn't the best, moved to coercion but region may be better.
- issues/issue-20005.rs: moved to associated-types.
- issues/issue-82869.rs: moved to asm.
- issues/issue-24535-allow-mutable-borrow-in-match-guard.rs: moved to nll.
- issues/issue-52169.rs: moved to macros.
- test-passed.rs: moved to test-attrs along with `test-` prefixed tests.
  - test-cfg.rs: moved to conditional-compilation.
- non-integer-atomic.rs: moved to intrinsics.
- issues/issue-54521-2.rs: moved to parser.
- issues/issue-17756.rs: moved to consts.
- conversion-methods.rs: ~~moved to suggestions~~ moved to typeck.

r? `@petrochenkov`

3 years agoMove some UI tests to more suitable subdirs
Yuki Okushi [Mon, 21 Jun 2021 20:29:18 +0000 (05:29 +0900)]
Move some UI tests to more suitable subdirs

3 years agoAuto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomez
bors [Tue, 29 Jun 2021 20:59:14 +0000 (20:59 +0000)]
Auto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomez

Upgrade normalize.css to v8.0.1

Fixes #86629, this addresses #82548 and #82542 with tweaks. I expect that this changes the style *slightly* but shouldn't have any major changes.
Here's some changes I observed, I'd say they all are an improvement.

<details>
<summary>Before</summary>

![before 1](https://user-images.githubusercontent.com/25030997/123854746-0fc84800-d95a-11eb-8484-ea86dfe0ae14.png)
![before 2](https://user-images.githubusercontent.com/25030997/123854754-135bcf00-d95a-11eb-8cca-f49994629e08.png)

</details>

<details>
<summary>After</summary>

![after 1](https://user-images.githubusercontent.com/25030997/123854809-21115480-d95a-11eb-9dd2-0d3b9ca45edd.png)
![after 2](https://user-images.githubusercontent.com/25030997/123854818-22428180-d95a-11eb-83aa-fb5a698124f9.png)

</details>

r? `@jsha`

3 years agoCheck node kind to avoid ICE in `check_expr_return()`
Fabian Wolff [Tue, 29 Jun 2021 20:11:48 +0000 (22:11 +0200)]
Check node kind to avoid ICE in `check_expr_return()`

3 years agoFix some style regressions due to normalize.css 8
Yuki Okushi [Tue, 29 Jun 2021 19:13:46 +0000 (04:13 +0900)]
Fix some style regressions due to normalize.css 8

3 years agoUpgrade normalize.css to v8.0.1
Yuki Okushi [Tue, 29 Jun 2021 19:13:16 +0000 (04:13 +0900)]
Upgrade normalize.css to v8.0.1

3 years agoUpgrade to indexmap 1.7, using hashbrown 0.11
Josh Stone [Tue, 29 Jun 2021 18:38:16 +0000 (11:38 -0700)]
Upgrade to indexmap 1.7, using hashbrown 0.11

3 years agoAuto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbini
bors [Tue, 29 Jun 2021 18:33:13 +0000 (18:33 +0000)]
Auto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbini

Update to new bootstrap compiler

r? `@pietroalbini`

3 years agoAuto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3
bors [Tue, 29 Jun 2021 15:52:21 +0000 (15:52 +0000)]
Auto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3

Change vtable memory representation to use tcx allocated allocations.

This fixes https://github.com/rust-lang/rust/issues/86324. However i suspect there's more to change before it can land.

r? `@bjorn3`
cc `@rust-lang/miri`

3 years agoAdd non-mutable methods to `Cursor`
Ian Wahbe [Tue, 29 Jun 2021 13:35:14 +0000 (15:35 +0200)]
Add non-mutable methods to `Cursor`

3 years agoadd head/tail methods to linked list mutable cursor
Ian Wahbe [Tue, 29 Jun 2021 13:24:01 +0000 (15:24 +0200)]
add head/tail methods to linked list mutable cursor

3 years agoAuto merge of #7411 - camsteffen:use-self-visitor, r=flip1995
bors [Tue, 29 Jun 2021 13:23:04 +0000 (13:23 +0000)]
Auto merge of #7411 - camsteffen:use-self-visitor, r=flip1995

Simplify use_self impl

changelog: none

Mainly to remove an extra visit and simplify the "in body?" logic.

3 years agoRemove a visitor from use_self
Cameron Steffen [Wed, 16 Jun 2021 17:14:23 +0000 (12:14 -0500)]
Remove a visitor from use_self

3 years agoUse type_of for impl self type
Cameron Steffen [Wed, 16 Jun 2021 20:43:48 +0000 (15:43 -0500)]
Use type_of for impl self type

3 years agoSimplify in impl check
Cameron Steffen [Wed, 16 Jun 2021 17:23:09 +0000 (12:23 -0500)]
Simplify in impl check

3 years agoMake ItemKind check dry
Cameron Steffen [Thu, 17 Jun 2021 16:19:33 +0000 (11:19 -0500)]
Make ItemKind check dry

3 years agoAuto merge of #86009 - cjgillot:fwarn, r=davidtwco
bors [Tue, 29 Jun 2021 13:11:16 +0000 (13:11 +0000)]
Auto merge of #86009 - cjgillot:fwarn, r=davidtwco

Make ForceWarn a lint level.

Follow-up to #85788
cc `@rylev`

3 years agoAuto merge of #7405 - jyn514:fix-stable, r=camsteffen
bors [Tue, 29 Jun 2021 13:03:45 +0000 (13:03 +0000)]
Auto merge of #7405 - jyn514:fix-stable, r=camsteffen

Stabilize `cargo clippy --fix`

This has been unstable since it was first introduced in
https://github.com/rust-lang/rust-clippy/pull/5363. In that time, I have
been using it successfully in nightly without issues. I don't think
there are any blocking issues now that RUSTC_WORKSPACE_WRAPPER is
stabilized, so this can be stabilized.

changelog: Stabilize `cargo clippy --fix`

3 years agoBless UI tests
Fabian Wolff [Tue, 29 Jun 2021 10:49:08 +0000 (12:49 +0200)]
Bless UI tests

3 years agoAuto merge of #86594 - dns2utf8:move_label_to_symbol, r=GuillaumeGomez
bors [Tue, 29 Jun 2021 10:41:40 +0000 (10:41 +0000)]
Auto merge of #86594 - dns2utf8:move_label_to_symbol, r=GuillaumeGomez

rustdoc: Move label to symbol

Implements #86578 depends on #85651

r? `@GuillaumeGomez`

# Screenshot of mobile
![grafik](https://user-images.githubusercontent.com/739070/123267064-1be07f80-d4ec-11eb-8bdb-0b18a41908dc.png)

# Screenshot on desktop
![grafik](https://user-images.githubusercontent.com/739070/123267204-46323d00-d4ec-11eb-97ca-2750421352f4.png)

3 years agoAuto merge of #7409 - xFrednet:5394-vs-code-tasks, r=giraffate,flip1995
bors [Tue, 29 Jun 2021 08:53:59 +0000 (08:53 +0000)]
Auto merge of #7409 - xFrednet:5394-vs-code-tasks, r=giraffate,flip1995

Added `cargo dev setup vscode-tasks` for simplicity

This PR adds a setup command to `clippy dev` that installs tasks into the Clippy vscode workspace. These might be useful as they be used via shortcuts and are accessible over the GUI. The available tasks are:
* `cargo check` (standard Linux shortcut `[ctrl] + [shift] + b`)
* `cargo dev fmt`
* `cargo uitest` (with a comment how to add the `TESTNAME` environment value)
* `cargo test`
* `cargo dev bless`

---

changelog: none

only internal changes again. cc #5394

r? `@flip1995` This should be pretty much the same as the other `cargo dev setup` commands. Would you mind reviewing this? :upside_down_face:

3 years agoAuto merge of #86697 - jackh726:pgo, r=Mark-Simulacrum
bors [Tue, 29 Jun 2021 07:44:20 +0000 (07:44 +0000)]
Auto merge of #86697 - jackh726:pgo, r=Mark-Simulacrum

Add inflate to pgo

3 years agoAuto merge of #86670 - Aaron1011:copy-variance-diag, r=davidtwco
bors [Tue, 29 Jun 2021 05:15:34 +0000 (05:15 +0000)]
Auto merge of #86670 - Aaron1011:copy-variance-diag, r=davidtwco

Derive `Copy` for `VarianceDiagInfo`

3 years agoAuto merge of #86446 - Smittyvb:rustc_insignificant_dtor-ice, r=Mark-Simulacrum
bors [Tue, 29 Jun 2021 02:48:08 +0000 (02:48 +0000)]
Auto merge of #86446 - Smittyvb:rustc_insignificant_dtor-ice, r=Mark-Simulacrum

Don't make `rustc_insignificant_dtor` feature gate

This isn't a feature gate, it's an attribute that is feature gated behind the `rustc_attrs` attribute. Closes #85680.

3 years agoStabilize `cargo clippy --fix`
Joshua Nelson [Sat, 26 Jun 2021 01:41:56 +0000 (21:41 -0400)]
Stabilize `cargo clippy --fix`

This has been unstable since it was first introduced in
https://github.com/rust-lang/rust-clippy/pull/5363. In that time, I have
been using it successfully in nightly without issues. I don't think
there are any blocking issues now that RUSTC_WORKSPACE_WRAPPER is
stabilized, so this can be stabilized.

3 years agoAuto merge of #86704 - JohnTitor:rollup-lnrxo4i, r=JohnTitor
bors [Tue, 29 Jun 2021 00:18:45 +0000 (00:18 +0000)]
Auto merge of #86704 - JohnTitor:rollup-lnrxo4i, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #86059 (Add new tool to check HTML)
 - #86529 (Add support for OpenSSL 3.0.0)
 - #86657 (Fix `future_prelude_collision` false positive)
 - #86661 (Editon 2021 enables precise capture)
 - #86671 (Turn non_fmt_panic into a future_incompatible edition lint.)
 - #86673 (Make disjoint_capture_migration an edition lint.)
 - #86678 (Fix garbled suggestion for missing lifetime specifier)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #86678 - FabianWolff:issue-86667, r=jackh726
Yuki Okushi [Mon, 28 Jun 2021 23:46:16 +0000 (08:46 +0900)]
Rollup merge of #86678 - FabianWolff:issue-86667, r=jackh726

Fix garbled suggestion for missing lifetime specifier

This PR fixes #86667. The suggestion code currently checks whether there is a generic parameter that is not a synthetic `impl Trait` parameter and, if so, suggests to insert a new lifetime `'a` before that generic parameter. However, it does not make sense to insert `'a` in front of an elided lifetime parameter, since these are synthetic as well, which leads to the garbled suggestion in #86667.

3 years agoRollup merge of #86673 - m-ou-se:disjoint-capture-edition-lint, r=nikomatsakis
Yuki Okushi [Mon, 28 Jun 2021 23:46:15 +0000 (08:46 +0900)]
Rollup merge of #86673 - m-ou-se:disjoint-capture-edition-lint, r=nikomatsakis

Make disjoint_capture_migration an edition lint.

This turns the disjoint capture lint into an edition lint, and changes all the wording to refer to the edition.

This includes the same first commit as https://github.com/rust-lang/rust/pull/86671. See https://github.com/rust-lang/rust/pull/86671.

Fixes most of https://github.com/rust-lang/project-rfc-2229/issues/43#issuecomment-869188197

3 years agoRollup merge of #86671 - m-ou-se:non-fmt-panic-future-incompatible, r=nikomatsakis
Yuki Okushi [Mon, 28 Jun 2021 23:46:14 +0000 (08:46 +0900)]
Rollup merge of #86671 - m-ou-se:non-fmt-panic-future-incompatible, r=nikomatsakis

Turn non_fmt_panic into a future_incompatible edition lint.

This turns the `non_fmt_panic` lint into a future_incompatible edition lint, so it becomes part of the `rust_2021_compatibility` group. See https://github.com/rust-lang/rust/issues/85894.

This lint produces both warnings about semantical changes (e.g. `panic!("{{")`) and things that will become hard errors (e.g. `panic!("{")`). So I added a `explain_reason: false` that supresses the default "this will become a hard error" or "the semantics will change" message, and instead added a note depending on the situation. (cc `@rylev)`

r? `@nikomatsakis`

3 years agoRollup merge of #86661 - sexxi-goose:edition_fix, r=nikomatsakis
Yuki Okushi [Mon, 28 Jun 2021 23:46:12 +0000 (08:46 +0900)]
Rollup merge of #86661 - sexxi-goose:edition_fix, r=nikomatsakis

Editon 2021 enables precise capture

r? `@nikomatsakis`

3 years agoRollup merge of #86657 - jam1garner:future_prelude_false_positive, r=nikomatsakis
Yuki Okushi [Mon, 28 Jun 2021 23:46:11 +0000 (08:46 +0900)]
Rollup merge of #86657 - jam1garner:future_prelude_false_positive, r=nikomatsakis

Fix `future_prelude_collision` false positive

Fixes #86633

The lint for checking if method resolution of methods named `try_into` will fail in 2021 edition previously would fire on all inherent methods, however for inherent methods that consume `self`, this takes priority over `TryInto::try_into` due to being inherent, while trait method and methods that take `&self` or `&mut self` don't take priority, and thus aren't affected by this false positive.

This fix is rather simple: simply checking if the inherent method doesn't auto-deref or auto-ref (and thus takes `self`) and if so, prevents the lint from firing.

3 years agoRollup merge of #86529 - cuviper:ssl3, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 23:46:10 +0000 (08:46 +0900)]
Rollup merge of #86529 - cuviper:ssl3, r=Mark-Simulacrum

Add support for OpenSSL 3.0.0

This updates the `openssl` and `openssl-sys` crates to support building
the toolchain with system libraries up to OpenSSL 3.0.0. This does not
affect the static version used via `openssl-src` in CI builds.

ref: https://github.com/sfackler/rust-openssl/pull/1264

3 years agoRollup merge of #86059 - GuillaumeGomez:html-checker2, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 23:46:09 +0000 (08:46 +0900)]
Rollup merge of #86059 - GuillaumeGomez:html-checker2, r=Mark-Simulacrum

Add new tool to check HTML

Re-opening of https://github.com/rust-lang/rust/pull/84480.

r? `@Mark-Simulacrum`

3 years agoBump the workspace dependency for OpenSSL 3
Josh Stone [Mon, 28 Jun 2021 23:25:44 +0000 (16:25 -0700)]
Bump the workspace dependency for OpenSSL 3

3 years agoFix typo and improve documentation for E0632
Fabian Wolff [Sun, 23 May 2021 11:31:04 +0000 (13:31 +0200)]
Fix typo and improve documentation for E0632

3 years agoPanic on trying to find non-feature incompleteness
Smitty [Mon, 28 Jun 2021 22:37:54 +0000 (18:37 -0400)]
Panic on trying to find non-feature incompleteness

3 years agoAuto merge of #86669 - Smittyvb:satisfy-windows-defender, r=Mark-Simulacrum
bors [Mon, 28 Jun 2021 21:37:57 +0000 (21:37 +0000)]
Auto merge of #86669 - Smittyvb:satisfy-windows-defender, r=Mark-Simulacrum

Don't run a publically reachable server in tests

This causes Windows Defender's firewall to pop up during tests to ask if I want to allow the test program to access the public Internet, since it was listening on `0.0.0.0` (the test passes regardless of how you respond to the modal, since the firewall only affects traffic outside of the computer, none of which actually happens in the test). The test server doesn't actually need to be publicly reachable, so this makes it so it is only reachable locally, which makes Windows Defender happy.

3 years agoAdd test for item-table with resize to mobile
Stefan Schindler [Thu, 24 Jun 2021 12:30:01 +0000 (14:30 +0200)]
Add test for item-table with resize to mobile

3 years agoAdd inflate to pgo
jackh726 [Mon, 28 Jun 2021 19:04:16 +0000 (15:04 -0400)]
Add inflate to pgo

3 years agoUpdated `clippy_dev` ui message and vscode task name
xFrednet [Mon, 28 Jun 2021 18:40:09 +0000 (20:40 +0200)]
Updated `clippy_dev` ui message and vscode task name

Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
3 years agoMake incomplete features part of delcaration
Smitty [Mon, 28 Jun 2021 18:39:20 +0000 (14:39 -0400)]
Make incomplete features part of delcaration

This prevents mistakes where the feature is in the list of incomplete
features but not actually a feature by making the incompleteness a part
of the declaration.

3 years agoIntroduce -Zprofile-closures to evaluate the impact of 2229
Aman Arora [Wed, 5 May 2021 19:57:08 +0000 (15:57 -0400)]
Introduce -Zprofile-closures to evaluate the impact of 2229

This creates a CSV with name "closure_profile_XXXXX.csv", where the
variable part is the process id of the compiler.

To profile a cargo project you can run one of the following depending on
if you're compiling a library or a binary:

```
cargo +stage1 rustc --lib -- -Zprofile-closures
cargo +stage1 rustc --bin -- -Zprofile-closures
```

3 years agoDon't make `rustc_insignificant_dtor` feature gate
Smitty [Fri, 18 Jun 2021 20:51:10 +0000 (16:51 -0400)]
Don't make `rustc_insignificant_dtor` feature gate

This isn't a feature gate, it's an attribute that is feature gated
behind the `rustc_attrs` attribute. Closes #85680.

3 years agoAuto merge of #86690 - JohnTitor:rollup-4ukk4yw, r=JohnTitor
bors [Mon, 28 Jun 2021 16:48:01 +0000 (16:48 +0000)]
Auto merge of #86690 - JohnTitor:rollup-4ukk4yw, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #86206 (Fix type checking of return expressions outside of function bodies)
 - #86358 (fix pretty print for `loop`)
 - #86568 (Don't dist miri or rust-analyzer on stable or beta.)
 - #86683 (:arrow_up: rust-analyzer)
 - #86687 (Allow anyone to set `perf-regression` label)
 - #86688 (Add a regression test for issue-65384)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoOnly run HTML check on rustdoc generated items
Guillaume Gomez [Thu, 3 Jun 2021 17:57:49 +0000 (19:57 +0200)]
Only run HTML check on rustdoc generated items

3 years agoInstall tidy on x86_64-gnu-aux target to run html check
Guillaume Gomez [Sat, 24 Apr 2021 15:25:45 +0000 (17:25 +0200)]
Install tidy on x86_64-gnu-aux target to run html check

3 years agoAdd new tool to check HTML:
Guillaume Gomez [Fri, 23 Apr 2021 14:43:18 +0000 (16:43 +0200)]
Add new tool to check HTML:
 * Make html-checker run by default on rust compiler docs as well
 * Ensure html-checker is run on CI
 * Lazify tidy binary presence check

3 years agoAdd comment for future_incompatible lint group
Ryan Levick [Mon, 28 Jun 2021 15:42:27 +0000 (17:42 +0200)]
Add comment for future_incompatible lint group

3 years agoMove stab_tags to symbol in tables
Stefan Schindler [Wed, 23 Jun 2021 18:02:00 +0000 (20:02 +0200)]
Move stab_tags to symbol in tables

3 years agoUpdate to new bootstrap compiler
Mark Rousskov [Thu, 24 Jun 2021 16:47:33 +0000 (12:47 -0400)]
Update to new bootstrap compiler

3 years agoRollup merge of #86688 - JohnTitor:test-65384, r=jackh726
Yuki Okushi [Mon, 28 Jun 2021 15:27:00 +0000 (00:27 +0900)]
Rollup merge of #86688 - JohnTitor:test-65384, r=jackh726

Add a regression test for issue-65384

Closes #65384
r? `@jackh726`

3 years agoRollup merge of #86687 - JohnTitor:perf-regression-label, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 15:26:59 +0000 (00:26 +0900)]
Rollup merge of #86687 - JohnTitor:perf-regression-label, r=Mark-Simulacrum

Allow anyone to set `perf-regression` label

The main purpose is to allow the triage bot to set the label: https://github.com/rust-lang/rust/pull/86617#issuecomment-868450443

r? `@Mark-Simulacrum`

3 years agoRollup merge of #86683 - lnicola:rust-analyzer-2021-06-28, r=jonas-schievink
Yuki Okushi [Mon, 28 Jun 2021 15:26:58 +0000 (00:26 +0900)]
Rollup merge of #86683 - lnicola:rust-analyzer-2021-06-28, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #86568 - ehuss:dist-miri-stable, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 15:26:57 +0000 (00:26 +0900)]
Rollup merge of #86568 - ehuss:dist-miri-stable, r=Mark-Simulacrum

Don't dist miri or rust-analyzer on stable or beta.

This prevents miri and rust-analyzer from being built for "dist" or "install" on the stable/beta channels. It is a nightly-only tool and should not be included.

Closes #86286

3 years agoRollup merge of #86358 - klensy:pp-loop, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 15:26:55 +0000 (00:26 +0900)]
Rollup merge of #86358 - klensy:pp-loop, r=Mark-Simulacrum

fix pretty print for `loop`

3 years agoRollup merge of #86206 - FabianWolff:issue-86188, r=Mark-Simulacrum
Yuki Okushi [Mon, 28 Jun 2021 15:26:54 +0000 (00:26 +0900)]
Rollup merge of #86206 - FabianWolff:issue-86188, r=Mark-Simulacrum

Fix type checking of return expressions outside of function bodies

This pull request fixes #86188. The problem is that the current code for type-checking `return` expressions stops if the `return` occurs outside of a function body, while the correct behavior is to continue type-checking the return value expression (otherwise an ICE happens later on because variables declared in the return value expression don't have a type).

Also, I have noticed that it is sometimes not obvious why a `return` is outside of a function body; for instance, in the example from #86188 (which currently causes an ICE):
```rust
fn main() {
    [(); return || {
        let tx;
    }]
}
```
I have changed the error message to also explain why the `return` is considered outside of the function body:
```
error[E0572]: return statement outside of function body
 --> ice0.rs:2:10
  |
1 |  / fn main() {
2 |  |     [(); return || {
  |  |__________^
3 | ||         let tx;
4 | ||     }]
  | ||_____^ the return is part of this body...
5 |  | }
  |  |_- ...not the enclosing function body
```

3 years agoOnly include lint in future_incompatible lint group if not an edition lint
Ryan Levick [Thu, 24 Jun 2021 14:29:03 +0000 (16:29 +0200)]
Only include lint in future_incompatible lint group if not an edition lint

3 years agoBless the test suite.
Charles Lew [Mon, 28 Jun 2021 04:39:42 +0000 (12:39 +0800)]
Bless the test suite.

3 years agoUpdate other codegens to use tcx managed vtable allocations.
Charles Lew [Sun, 20 Jun 2021 09:43:25 +0000 (17:43 +0800)]
Update other codegens to use tcx managed vtable allocations.

3 years agoAuto merge of #82624 - ojeda:rwlock-example-deadlock, r=JohnTitor
bors [Mon, 28 Jun 2021 09:58:06 +0000 (09:58 +0000)]
Auto merge of #82624 - ojeda:rwlock-example-deadlock, r=JohnTitor

RWLock: Add deadlock example

Suggested in https://github.com/rust-lang/rust/pull/82596 but it was a bit too late.

`@matklad` `@azdavis` `@sfackler`

3 years agoAdd a regression test for issue-65384
Yuki Okushi [Mon, 28 Jun 2021 09:39:51 +0000 (18:39 +0900)]
Add a regression test for issue-65384

3 years agoAllow anyone to set `perf-regression` label
Yuki Okushi [Mon, 28 Jun 2021 09:15:26 +0000 (18:15 +0900)]
Allow anyone to set `perf-regression` label

3 years agoAuto merge of #7350 - camsteffen:suspicious, r=flip1995
bors [Mon, 28 Jun 2021 08:35:51 +0000 (08:35 +0000)]
Auto merge of #7350 - camsteffen:suspicious, r=flip1995

Add suspicious group

changelog: Introduce `clippy::suspicious` 🤔 group and move several lints into the group

Closes #6366. CC #6626.

A number of lints are moved from each of `correctness`, `style` and `complexity` groups. Notably I didn't move `suspicious_splitn` since I think that is a `correctness` lint despite the name.

Lints moved to `clippy::suspicious`:
* `blanket_clippy_restriction_lints` (was `clippy::style`)
* `empty_loop` (was `clippy::style`)
* `eval_order_dependence` (was `clippy::complexity`)
* `float_equality_without_abs` (was `clippy::correctness`)
* `for_loops_over_fallibles` (was `clippy::correctness`)
* `misrefactored_assign_op` (was `clippy::complexity`)
* `mut_range_bound` (was `clippy::complexity`)
* `mutable_key_type` (was `clippy::correctness`)
* `suspicious_arithmetic_impl` (was `clippy::correctness`)
* `suspicious_assignment_formatting` (was `clippy::style`)
* `suspicious_else_formatting` (was `clippy::style`)
* `suspicious_map` (was `clippy::complexity`)
* `suspicious_op_assign_impl` (was `clippy::correctness`)
* `suspicious_unary_op_formatting` (was `clippy::style`)

3 years agoAuto merge of #86684 - inquisitivecrystal:libs-tracking-issue, r=m-ou-se
bors [Mon, 28 Jun 2021 06:24:49 +0000 (06:24 +0000)]
Auto merge of #86684 - inquisitivecrystal:libs-tracking-issue, r=m-ou-se

Fix typo in libs tracking issue template

Currently, the libs tracking issue template expands FCP as "final commenting period". Everywhere else, including in [the official explanation](https://rust-lang.github.io/rfcs/), it's expanded as "final comment period". That version also sounds a bit better. Accordingly, this PR changes the tracking issue template to use that version.

`@rustbot` label A-meta T-libs-api
r? `@m-ou-se`

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 28 Jun 2021 06:09:55 +0000 (09:09 +0300)]
:arrow_up: rust-analyzer

3 years agoFix typo in libs tracking issue template
Aris Merchant [Mon, 28 Jun 2021 06:00:26 +0000 (23:00 -0700)]
Fix typo in libs tracking issue template