]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRemove min_type_alias_impl_trait feature
Santiago Pastorino [Mon, 26 Jul 2021 23:38:38 +0000 (20:38 -0300)]
Remove min_type_alias_impl_trait feature

2 years agoexistential_type was removed in favor of type_alias_impl_trait
Santiago Pastorino [Mon, 26 Jul 2021 23:32:55 +0000 (20:32 -0300)]
existential_type was removed in favor of type_alias_impl_trait

2 years agoMake all tests use type_alias_impl_trait feature instead of min
Santiago Pastorino [Mon, 26 Jul 2021 20:01:16 +0000 (17:01 -0300)]
Make all tests use type_alias_impl_trait feature instead of min

2 years agoUse type_alias_impl_trait instead of min in compiler and lib
Santiago Pastorino [Tue, 27 Jul 2021 12:14:21 +0000 (09:14 -0300)]
Use type_alias_impl_trait instead of min in compiler and lib

2 years agobootstrap.py: remove unused `git log` option
Hudson Ayers [Tue, 27 Jul 2021 13:54:51 +0000 (13:54 +0000)]
bootstrap.py: remove unused `git log` option

When determining which LLVM artifacts to download, bootstrap.py
calls: `git log --author=bors --format=%H -n1 -m --first-parent --
src/llvm-project src/bootstrap/download-ci-llvm-stamp src/version`.
However, the `-m` option has no effect, per the `git log` help:

> -m
> This option makes diff output for merge commits to be shown in the
> default format. -m will produce the output only if -p is given as
> well. The default format could be changed using log.diffMerges
> configuration parameter, which default value is separate.

Accordingly, this commit removes use of the -m option in favor of
`--no-patch`, to make clear that this command should never output
diff information, as the SHA-1 hash is the only desired output.
Tested using git 2.32, this does not change the
output of the command.

The motivation for this change is that some patched versions of git
change the behavior of the `-m` flag to imply `-p`, rather than to do
nothing unless `-p` is passed. These patched versions of git lead to
this script not working. Google's corp-provided git is one such example.

2 years agoAuto merge of #7492 - nfejzic:improve_help, r=Manishearth
bors [Tue, 27 Jul 2021 14:39:08 +0000 (14:39 +0000)]
Auto merge of #7492 - nfejzic:improve_help, r=Manishearth

Explain flags missing in cargo check in --help

This commit closes #7389. As stated in the issue, `cargo clippy --help`
provides explanation for some flags and states that the rest are same
as in `cargo check --help`, even though some clippy specific flags
exist.

This commit extends the `cargo clippy --help` with two additional flags,
  - `cargo clippy --fix`
  - `cargo clippy --no-deps`

If there are more flags which are not present in `cargo check --help`
please bring these to my attention, I will include these aswell.
For now, I noticed only the two flags mentioned above.

changelog: `cargo clippy --help` now explains additional flags missing in `cargo check --help`.

2 years agoAuto merge of #7488 - DevinR528:bantype-fix, r=camsteffen
bors [Tue, 27 Jul 2021 14:27:11 +0000 (14:27 +0000)]
Auto merge of #7488 - DevinR528:bantype-fix, r=camsteffen

Add primitive type support to disallowed_type lint

Closes #6845

changelog: Enable the banning of primitive types in [`disallowed_type`]

2 years agoAdd primitive type support to disallowed_type lint
Devin Ragotzy [Thu, 22 Jul 2021 12:40:24 +0000 (08:40 -0400)]
Add primitive type support to disallowed_type lint

Fix docs of disallowed_type

Add ability to name primitive types without import path

Move primitive resolution to clippy_utils path_to_res fn

Refactor Res matching, fix naming and docs from review

Use tcx.def_path_str when emitting the lint

2 years agoAuto merge of #87509 - JohnTitor:rollup-8iqn6cl, r=JohnTitor
bors [Tue, 27 Jul 2021 13:31:40 +0000 (13:31 +0000)]
Auto merge of #87509 - JohnTitor:rollup-8iqn6cl, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #86450 (Add flag to configure `large_assignments` lint)
 - #86764 (Avoid ICE on type error recovery)
 - #87354 (Update VxWork's UNIX support)
 - #87427 (get rid of NoMirFor error variant)
 - #87446 (macos current_exe using directly libc instead.)
 - #87494 (fix typo: whenver -> whenever)
 - #87497 (Add long explanation for E0544.)
 - #87499 (Remove ASCII fast path from `rustc_lexer::{is_id_continue, is_id_start}`)
 - #87502 (Update cargo)
 - #87503 (Update books)

Failed merges:

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

2 years agoAdd explanations for why we use Variant::Struct instead of Variant::Tuple for tuple...
Guillaume Gomez [Tue, 27 Jul 2021 11:52:15 +0000 (13:52 +0200)]
Add explanations for why we use Variant::Struct instead of Variant::Tuple for tuple structs in enums

2 years agoRollup merge of #87503 - ehuss:update-books, r=ehuss
Yuki Okushi [Tue, 27 Jul 2021 10:52:52 +0000 (19:52 +0900)]
Rollup merge of #87503 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in 7a13537f96af4b9b8e3ea296d6e5c3c7ab72ce9f..f51734eb5566c826b471977747ea3d7d6915bbe9
2021-07-05 23:34:47 -0400 to 2021-07-23 18:24:35 +0900
- Add cloning example for dot operator behaviour (rust-lang/nomicon#292)

## reference

3 commits in 82d75cf423e4a7824fb36e73ccb18519d6900610..3b7be075af5d6e402a18efff672a8a265b4596fd
2021-07-15 06:49:08 -0700 to 2021-07-26 13:20:11 -0700
- Fix typos + grammar (rust-lang/reference#1037)
- Expand on Unicode identifiers. (rust-lang/reference#1022)
- Remove incorrect apostrophe (rust-lang/reference#1076)

## book

17 commits in eac55314210519238652f12b30fec9daea61f7fe..a07036f864b37896b31eb996cd7aedb489f69a1f
2021-07-19 11:08:01 -0400 to 2021-07-26 20:19:46 -0400
- Set expectations a bit more realistically
- Snapshot of chapter 4 for nostarch
- A few small wording tweaks in ch 4
- Clarify that it's not stack/heap exactly that matters for copy/non copy, fixes rust-lang/book#2799
- Clarify a detail around move. Fixes rust-lang/book#2413.
- Clarify places that changed because of NLL. Fixes rust-lang/book#1939.
- nostarch ch3
- Small edits to chapter 3
-  (rust-lang/book#2797)
- Update ch03-03-how-functions-work.md: Pervasive -> Prevalent. (rust-lang/book#2796)
- Address loop labels and continue. Fixes rust-lang/book#1392.
- Clarify behavior of integer division. Fixes rust-lang/book#2248.
- Demonstrate how scope interacts with shadowing
- Add another cross-reference to the new unit type introduction
- Introduce the unit type with tuples. Fixes rust-lang/book#1933.
- Reword sentence to not have numbers separated only by a comma
- Link directly to other installation page. Fixes rust-lang/book#1609

## rust-by-example

1 commits in 1db6bb483cc87ad3b424d9aba764fe622960a1be..0dc9cd4e89f00cb5230f120e1a083916386e422b
2021-07-15 06:17:42 -0300 to 2021-07-23 09:14:27 -0300
- Grammatical mistake: Comparison as ... as the (rust-lang/rust-by-example#1453)

## rustc-dev-guide

2 commits in 93422c21baca585dc88357ec886a48f6ddc7d665..09343d6f921d2a07c66f8c41ec3d65bf1fa52556
2021-07-13 12:45:58 -0400 to 2021-07-26 00:37:28 +0200
- Fix typo in building/bootstrapping.md (rust-lang/rustc-dev-guide#1175)
- Link directly to stabilization report comments (rust-lang/rustc-dev-guide#1173)

## edition-guide

4 commits in af696ce8ea526445590ae0ca66a8128d2a95a69a..3710b0cae783d0bcd2b42452a63b081473f5970a
2021-07-20 11:38:03 -0400 to 2021-07-26 11:34:46 -0700
- Add more consistent headings and add a migration section to reserving-syntax (rust-lang/edition-guide#263)
- reserving-syntax.md: Expand and add detail (rust-lang/edition-guide#249)
- Fix typo in or-patterns section (rust-lang/edition-guide#262)
- Fix typo (rust-lang/edition-guide#261)

2 years agoRollup merge of #87502 - ehuss:update-cargo, r=ehuss
Yuki Okushi [Tue, 27 Jul 2021 10:52:51 +0000 (19:52 +0900)]
Rollup merge of #87502 - ehuss:update-cargo, r=ehuss

Update cargo

8 commits in cebef2951ee69617852844894164b54ed478a7da..d21c22870e58499d6c31f1bef3bf1255eb021666
2021-07-22 13:01:52 +0000 to 2021-07-26 20:23:21 +0000
- Fix version string. (rust-lang/cargo#9727)
- Allow publishing from workspace root. (rust-lang/cargo#9559)
- Better msg for wrong position (rust-lang/cargo#9723)
- Stabilize the rustc-link-arg option (rust-lang/cargo#9557)
- Warning when using features in replace (rust-lang/cargo#9681)
- Refactor if let chains to matches! macro (rust-lang/cargo#9721)
- Weather is not nice today.. (rust-lang/cargo#9720)
- Update should_use_metadata function (rust-lang/cargo#9653)

2 years agoRollup merge of #87499 - ibraheemdev:patch-6, r=dtolnay
Yuki Okushi [Tue, 27 Jul 2021 10:52:50 +0000 (19:52 +0900)]
Rollup merge of #87499 - ibraheemdev:patch-6, r=dtolnay

Remove ASCII fast path from `rustc_lexer::{is_id_continue, is_id_start}`

`unicode_xid` now has a fast path built-in: https://github.com/unicode-rs/unicode-xid/commit/122b38775cf077570025c8294280f57d2004096f

2 years agoRollup merge of #87497 - midgleyc:long-E0544, r=GuillaumeGomez
Yuki Okushi [Tue, 27 Jul 2021 10:52:49 +0000 (19:52 +0900)]
Rollup merge of #87497 - midgleyc:long-E0544, r=GuillaumeGomez

Add long explanation for E0544.

Helps with #61137

2 years agoRollup merge of #87494 - midgleyc:comment-typos, r=joshtriplett
Yuki Okushi [Tue, 27 Jul 2021 10:52:48 +0000 (19:52 +0900)]
Rollup merge of #87494 - midgleyc:comment-typos, r=joshtriplett

fix typo: whenver -> whenever

Fix a typo in a comment in RefCell: "whenver" -> "whenever".

2 years agoRollup merge of #87446 - devnexen:macos_update, r=dtolnay
Yuki Okushi [Tue, 27 Jul 2021 10:52:47 +0000 (19:52 +0900)]
Rollup merge of #87446 - devnexen:macos_update, r=dtolnay

macos current_exe using directly libc instead.

2 years agoRollup merge of #87427 - RalfJung:no-mir-for, r=oli-obk
Yuki Okushi [Tue, 27 Jul 2021 10:52:46 +0000 (19:52 +0900)]
Rollup merge of #87427 - RalfJung:no-mir-for, r=oli-obk

get rid of NoMirFor error variant

The only place where we throw that error, it is very quickly caught again and turned into a different error. So raise that other error immediately.

2 years agoRollup merge of #87354 - Wind-River:2021_master, r=kennytm
Yuki Okushi [Tue, 27 Jul 2021 10:52:42 +0000 (19:52 +0900)]
Rollup merge of #87354 - Wind-River:2021_master, r=kennytm

Update VxWork's UNIX support

1. VxWorks does not provide glibc
2. VxWorks does provide `sigemptyset` and `sigaddset`

Note: these changes are concurrent to [this PR](https://github.com/rust-lang/libc/pull/2295) in libc.

2 years agoRollup merge of #86764 - estebank:issue-86756, r=pnkfelix
Yuki Okushi [Tue, 27 Jul 2021 10:52:41 +0000 (19:52 +0900)]
Rollup merge of #86764 - estebank:issue-86756, r=pnkfelix

Avoid ICE on type error recovery

Fix #86756

2 years agoRollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelix
Yuki Okushi [Tue, 27 Jul 2021 10:52:40 +0000 (19:52 +0900)]
Rollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelix

Add flag to configure `large_assignments` lint

The `large_assignments` lints detects moves over specified limit.  The
limit is configured through `move_size_limit = "N"` attribute placed at
the root of a crate. When attribute is absent, the lint is disabled.

Make it possible to enable the lint without making any changes to the
source code, through a new flag `-Zmove-size-limit=N`.  For example, to
detect moves exceeding 1023 bytes in a cargo crate, including all
dependencies one could use:

```
$ env RUSTFLAGS=-Zmove-size-limit=1024 cargo build -vv
```

Lint tracking issue #83518.

2 years agoAuto merge of #87431 - the8472:array-iter-fold, r=kennytm
bors [Tue, 27 Jul 2021 10:38:41 +0000 (10:38 +0000)]
Auto merge of #87431 - the8472:array-iter-fold, r=kennytm

implement fold() on array::IntoIter to improve flatten().collect() perf

With #87168 flattening `array::IntoIter`s is now `TrustedLen`, the `FromIterator` implementation for `Vec` has a specialization for `TrustedLen` iterators which uses internal iteration. This implements one of the main internal iteration methods on `array::Into` to optimize the combination of those two features.

This should address the main issue in #87411

```
# old
test vec::bench_flat_map_collect                         ... bench:   2,244,024 ns/iter (+/- 18,903)

# new
test vec::bench_flat_map_collect                         ... bench:     172,863 ns/iter (+/- 2,141)
```

2 years agoAdd warning to SGX mutex implementation
Jethro Beekman [Tue, 27 Jul 2021 10:11:20 +0000 (12:11 +0200)]
Add warning to SGX mutex implementation

2 years agoRevert "SGX mutex is movable"
Jethro Beekman [Tue, 27 Jul 2021 10:10:24 +0000 (12:10 +0200)]
Revert "SGX mutex is movable"

This reverts commit 30b82e0f96579d9f897c4e2a780af82662d89772.

2 years agoHandle `--no-deps` flag same as `--fix` flag.
Nadir Fejzic [Tue, 27 Jul 2021 09:13:42 +0000 (11:13 +0200)]
Handle `--no-deps` flag same as `--fix` flag.

As proposed in the pull request thread, there is some inconsistency in
handling the `--no-deps` flag which requires `--` before it, and
`--fix` flag which does not.
In this commit the `--no-deps` flag does not need the `--` anymore.
However, it can still be used that way: `cargo clipyy -- --no-deps`.

2 years agoAuto merge of #7466 - xFrednet:5393-use-more-diagnostic-items, r=flip1995
bors [Tue, 27 Jul 2021 08:19:23 +0000 (08:19 +0000)]
Auto merge of #7466 - xFrednet:5393-use-more-diagnostic-items, r=flip1995

Use diagnostic items where possible

Clippy still uses a bunch of paths in places that could easily use already defined diagnostic items. This PR updates all references to such paths and also removes a bunch of them that are no longer needed after this cleanup.

Some paths are also used to construct new paths and can therefore not be removed that easily. I've added a doc comment to those instances that recommends the use of the diagnostic item where possible.

And that's it, cleaning crew signing off :broom: :wastebasket:

---

changelog: none

(only internal improvements)

cc: #5393

2 years agoAuto merge of #85305 - MarcusDunn:master, r=pnkfelix
bors [Tue, 27 Jul 2021 05:53:31 +0000 (05:53 +0000)]
Auto merge of #85305 - MarcusDunn:master, r=pnkfelix

Stabilize bindings_after_at

attempting to stabilze bindings_after_at [#65490](https://github.com/rust-lang/rust/issues/65490), im pretty new to the whole thing so any pointers are greatly appreciated.

2 years agoUpdate books
Eric Huss [Tue, 27 Jul 2021 04:46:55 +0000 (21:46 -0700)]
Update books

2 years agoUpdate cargo
Eric Huss [Tue, 27 Jul 2021 04:39:58 +0000 (21:39 -0700)]
Update cargo

2 years agoAuto merge of #83491 - jyn514:remove-pretty, r=pnkfelix
bors [Tue, 27 Jul 2021 03:12:40 +0000 (03:12 +0000)]
Auto merge of #83491 - jyn514:remove-pretty, r=pnkfelix

Remove unstable `--pretty` flag

It doesn't do anything `--unpretty` doesn't, and due to a bug, also
didn't show up in `--help`. I don't think there's any reason to keep it
around, I haven't seen anyone using it.

Closes https://github.com/rust-lang/rust/issues/36473.

2 years agoupdate unicode-xid dependency
ibraheemdev [Tue, 27 Jul 2021 00:55:31 +0000 (20:55 -0400)]
update unicode-xid dependency

2 years agoAuto merge of #87062 - poliorcetics:fix-85462, r=dtolnay
bors [Tue, 27 Jul 2021 00:31:20 +0000 (00:31 +0000)]
Auto merge of #87062 - poliorcetics:fix-85462, r=dtolnay

Make StrSearcher behave correctly on empty needle

Fix #85462.

This will not affect ABI since the other variant of the enum is bigger.
It may break some code, but that would be very strange: usually people
don't continue after the first `Done` (or `None` for a normal iterator).

`@rustbot` label T-libs A-str A-patterns

2 years agoDocument math behind MIN/MAX consts on integers
Smitty [Tue, 27 Jul 2021 00:22:44 +0000 (20:22 -0400)]
Document math behind MIN/MAX consts on integers

2 years agoRemove ASCII fast path from rustc_lexer::{is_id_continue, is_id_start}
Ibraheem Ahmed [Tue, 27 Jul 2021 00:17:28 +0000 (20:17 -0400)]
Remove ASCII fast path from rustc_lexer::{is_id_continue, is_id_start}

2 years agofrom review: add a comment why try_fold was chosen instead of fold
The8472 [Mon, 26 Jul 2021 22:14:19 +0000 (00:14 +0200)]
from review: add a comment why try_fold was chosen instead of fold

2 years agoAdd long explanation for E0544.
Chris Midgley [Mon, 26 Jul 2021 21:13:32 +0000 (22:13 +0100)]
Add long explanation for E0544.

2 years agoAuto merge of #87480 - GuillaumeGomez:rollup-3ly8t5d, r=GuillaumeGomez
bors [Mon, 26 Jul 2021 21:50:24 +0000 (21:50 +0000)]
Auto merge of #87480 - GuillaumeGomez:rollup-3ly8t5d, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #87436 (Suggest `;` on parse error where applicable)
 - #87444 (Flatten nested `format!` calls)
 - #87447 (Miri: santiy check that null pointer can never have an AllocId)
 - #87457 (freebsd remove compiler workaround.)
 - #87458 (Fix help message for modification to &T created by &{t})
 - #87464 (Remove unnecessary `structhead` parameter from `render_union`)
 - #87473 (Notify the Rust 2021 edition working group in zulip of edition bugs)
 - #87474 (Add missing whitespace after attribute in HTML template)

Failed merges:

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

2 years agoActually infer args in visitors
kadmin [Thu, 6 May 2021 15:33:44 +0000 (15:33 +0000)]
Actually infer args in visitors

2 years agoActually infer args in visitors
kadmin [Thu, 6 May 2021 15:33:44 +0000 (15:33 +0000)]
Actually infer args in visitors

2 years agofix typo: whenver -> whenever
Chris Midgley [Mon, 26 Jul 2021 21:12:35 +0000 (22:12 +0100)]
fix typo: whenver -> whenever

2 years agoIntegrate context into the memorial to Anna
James Munns [Mon, 26 Jul 2021 19:09:04 +0000 (21:09 +0200)]
Integrate context into the memorial to Anna

2 years agoAuto merge of #87469 - sexxi-goose:union, r=nikomatsakis
bors [Mon, 26 Jul 2021 19:04:01 +0000 (19:04 +0000)]
Auto merge of #87469 - sexxi-goose:union, r=nikomatsakis

2229: Don't capture preicese paths on top of a union

- Accessing fields of a union require unsafe block
- As part of 2229 we don't allow precision where we need an unsafe block
to capture.

Fixes: #87378
r? `@nikomatsakis`

2 years agoTrack caller of Vec::remove()
Kornel [Mon, 26 Jul 2021 17:39:59 +0000 (18:39 +0100)]
Track caller of Vec::remove()

2 years agoAuto merge of #7495 - camsteffen:extern-conflict, r=Manishearth
bors [Mon, 26 Jul 2021 16:56:05 +0000 (16:56 +0000)]
Auto merge of #7495 - camsteffen:extern-conflict, r=Manishearth

Improve conflicting rlibs error again

changelog: none

Now you can do `rm <paste>` and 🐇💨

```text
thread 'compile_test' panicked at '
----------------------------------------------------------------------
ERROR: Found multiple rlibs for crates: `clippy_lints`, `clippy_utils`
Try running `cargo clean` or remove the following files:

target/debug/deps/libclippy_lints-9117c875159004e0.rlib \
target/debug/deps/libclippy_lints-fe45157be7ff9444.rlib \
target/debug/deps/libclippy_utils-5eba1e07a9846ed0.rlib \
target/debug/deps/libclippy_utils-ccbc08fcf64de262.rlib

For details on this error see https://github.com/rust-lang/rust-clippy/issues/7343
----------------------------------------------------------------------
```

2 years agoImprove conflicting rlibs error again
Cameron Steffen [Mon, 26 Jul 2021 15:32:26 +0000 (10:32 -0500)]
Improve conflicting rlibs error again

2 years agoMir borrowck does not generate lifetime variables for 'static lifetimes during opaque...
Oli Scherer [Mon, 26 Jul 2021 14:59:26 +0000 (14:59 +0000)]
Mir borrowck does not generate lifetime variables for 'static lifetimes during opaque type resolution

2 years agoInclude more information in --help
Nadir Fejzic [Mon, 26 Jul 2021 14:14:29 +0000 (16:14 +0200)]
Include more information in --help

`--no-deps` filled in with a little more information. Explain that
`--fix` implies `--no-deps`.
Explain that `--no-deps` is used with `cargo clippy --`, including
one example.

2 years agoRollup merge of #87474 - GuillaumeGomez:missing-whitespace-after-attr, r=notriddle
Guillaume Gomez [Mon, 26 Jul 2021 14:04:39 +0000 (16:04 +0200)]
Rollup merge of #87474 - GuillaumeGomez:missing-whitespace-after-attr, r=notriddle

Add missing whitespace after attribute in HTML template

Firefox (even though it worked) highlights it as red when you look at the source code because there is a missing whitespace.

r? `@notriddle`

2 years agoRollup merge of #87473 - rylev:zulip-notify-edition-bugs, r=jyn514
Guillaume Gomez [Mon, 26 Jul 2021 14:04:38 +0000 (16:04 +0200)]
Rollup merge of #87473 - rylev:zulip-notify-edition-bugs, r=jyn514

Notify the Rust 2021 edition working group in zulip of edition bugs

Notifying the group of these issues will make it easier for us to track them.

r? `@jyn514`

2 years agoRollup merge of #87464 - camelid:rm-union-structhead, r=jyn514
Guillaume Gomez [Mon, 26 Jul 2021 14:04:37 +0000 (16:04 +0200)]
Rollup merge of #87464 - camelid:rm-union-structhead, r=jyn514

Remove unnecessary `structhead` parameter from `render_union`

`structhead` is used for `render_struct` so that the logic for rendering
structs can be shared between struct variants and struct items. However,
`render_union` is not used anywhere except for rendering union items, so
its `structhead` parameter is unnecessary.

2 years agoRollup merge of #87458 - ibraheemdev:help-msg-block-borrow, r=oli-obk
Guillaume Gomez [Mon, 26 Jul 2021 14:04:36 +0000 (16:04 +0200)]
Rollup merge of #87458 - ibraheemdev:help-msg-block-borrow, r=oli-obk

Fix help message for modification to &T created by &{t}

Previous:
```rust
error[E0594]: cannot assign to `*x` which is behind a `&` reference
 --> src/main.rs:3:5
  |
2 |     let x: &usize = &mut{0};
  |                     ------- help: consider changing this to be a mutable reference: `&mut mut{0}`
3 |     *x = 1;
  |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
```

2 years agoRollup merge of #87457 - devnexen:fbsd_remove_workaround, r=petrochenkov
Guillaume Gomez [Mon, 26 Jul 2021 14:04:35 +0000 (16:04 +0200)]
Rollup merge of #87457 - devnexen:fbsd_remove_workaround, r=petrochenkov

freebsd remove compiler workaround.

related issue #43575

2 years agoRollup merge of #87447 - RalfJung:not-null, r=oli-obk
Guillaume Gomez [Mon, 26 Jul 2021 14:04:34 +0000 (16:04 +0200)]
Rollup merge of #87447 - RalfJung:not-null, r=oli-obk

Miri: santiy check that null pointer can never have an AllocId

2 years agoRollup merge of #87444 - camelid:flatten-nested-format, r=jyn514
Guillaume Gomez [Mon, 26 Jul 2021 14:04:32 +0000 (16:04 +0200)]
Rollup merge of #87444 - camelid:flatten-nested-format, r=jyn514

Flatten nested `format!` calls

2 years agoRollup merge of #87436 - ebobrow:suggest-semicolon, r=oli-obk
Guillaume Gomez [Mon, 26 Jul 2021 14:04:26 +0000 (16:04 +0200)]
Rollup merge of #87436 - ebobrow:suggest-semicolon, r=oli-obk

Suggest `;` on parse error where applicable

fixes #87197

2 years agoAuto merge of #7493 - xFrednet:7220-fix-new-without-default-impl-type, r=camsteffen
bors [Mon, 26 Jul 2021 12:20:54 +0000 (12:20 +0000)]
Auto merge of #7493 - xFrednet:7220-fix-new-without-default-impl-type, r=camsteffen

Prefer a code snipped over formatting the self type (`new_without_default`)

Fixes: rust-lang/rust-clippy#7220
changelog: [`new_without_default`]: The `Default` impl block type doesn't use the full type path qualification

Have a nice day to everyone reading this :upside_down_face:

2 years agoAuto merge of #7485 - camsteffen:add-test-externs, r=flip1995
bors [Mon, 26 Jul 2021 12:06:07 +0000 (12:06 +0000)]
Auto merge of #7485 - camsteffen:add-test-externs, r=flip1995

Add to test third party crates list

changelog: none

2 years agoAuto merge of #7477 - F3real:needless_continue, r=flip1995
bors [Mon, 26 Jul 2021 11:52:55 +0000 (11:52 +0000)]
Auto merge of #7477 - F3real:needless_continue, r=flip1995

Enhance needless continue to detect loop {continue;}

Fixes #7417

changelog: Report [`needless_continue`] in `loop { continue; }` case

2 years agoAuto merge of #7484 - camsteffen:author, r=flip1995
bors [Mon, 26 Jul 2021 11:41:46 +0000 (11:41 +0000)]
Auto merge of #7484 - camsteffen:author, r=flip1995

Some `clippy::author` improvements

changelog: none

* Use `Debug` instead of re-implementing it for some things
* Fix block trailing expression handing
* Don't double print on stmt/expr with `#[clippy::author]` attribute

2 years agoAuto merge of #86696 - rust-lang:relnotes-1.54.0, r=pietroalbini
bors [Mon, 26 Jul 2021 11:41:37 +0000 (11:41 +0000)]
Auto merge of #86696 - rust-lang:relnotes-1.54.0, r=pietroalbini

Update RELEASES.md for 1.54.0

### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.54.0/RELEASES.md)

r? `@Mark-Simulacrum`
cc `@rust-lang/release`

2 years agoUse correct syntax
Ryan Levick [Mon, 26 Jul 2021 09:38:46 +0000 (11:38 +0200)]
Use correct syntax

2 years agoAdd missing whitespace after attribute in HTML template
Guillaume Gomez [Mon, 26 Jul 2021 09:37:34 +0000 (11:37 +0200)]
Add missing whitespace after attribute in HTML template

2 years agoAdd test for enum item tuple fields documentation
Guillaume Gomez [Sun, 25 Jul 2021 19:18:11 +0000 (21:18 +0200)]
Add test for enum item tuple fields documentation

2 years agoAdd support for tuple struct fields documentation in enums as well
Guillaume Gomez [Sun, 25 Jul 2021 19:18:02 +0000 (21:18 +0200)]
Add support for tuple struct fields documentation in enums as well

2 years agoUpdate RELEASES.md
XAMPPRocky [Mon, 26 Jul 2021 08:58:37 +0000 (10:58 +0200)]
Update RELEASES.md

2 years agoAuto merge of #87442 - mystor:patch-2, r=m-ou-se
bors [Mon, 26 Jul 2021 08:42:15 +0000 (08:42 +0000)]
Auto merge of #87442 - mystor:patch-2, r=m-ou-se

Fix my email in .mailmap

2 years agoNotify the Rust 2021 edition working group in zulip of edition bugs
Ryan Levick [Mon, 26 Jul 2021 08:31:28 +0000 (10:31 +0200)]
Notify the Rust 2021 edition working group in zulip of edition bugs

2 years agoPrefer a code snipped over formatting the self type (`new_without_default`)
xFrednet [Sun, 25 Jul 2021 18:35:51 +0000 (20:35 +0200)]
Prefer a code snipped over formatting the self type (`new_without_default`)

2 years ago2229: Don't capture preicese paths on top of a union
Aman Arora [Mon, 26 Jul 2021 06:01:52 +0000 (02:01 -0400)]
2229: Don't capture preicese paths on top of a union

- Accessing fields of a union require unsafe block
- As part of 2229 we don't allow precision where we need an unsafe block
to capture.

Fixes: #87378
r? @nikomatsakis

2 years agoAuto merge of #87439 - ThibsG:FixDocTypo, r=jonas-schievink
bors [Mon, 26 Jul 2021 05:51:40 +0000 (05:51 +0000)]
Auto merge of #87439 - ThibsG:FixDocTypo, r=jonas-schievink

Fix doc typo

Just a typo in doc that has a bad rendering here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/struct.ExprUseVisitor.html#method.walk_captures

2 years agoAuto merge of #87424 - RalfJung:const-check, r=oli-obk
bors [Mon, 26 Jul 2021 03:10:42 +0000 (03:10 +0000)]
Auto merge of #87424 - RalfJung:const-check, r=oli-obk

rename const checking visitor module to check_consts::check

This avoids naming ambiguities with "const validation" which is in `interpret/validity.rs` and checks *values*.

r? `@oli-obk`

2 years agoRestrict field visibility
Aaron Hill [Mon, 26 Jul 2021 01:43:27 +0000 (20:43 -0500)]
Restrict field visibility

2 years agoCreate `QuerySideEffects` and use it for diagnostics
Aaron Hill [Fri, 23 Jul 2021 21:40:26 +0000 (16:40 -0500)]
Create `QuerySideEffects` and use it for diagnostics

2 years agoAuto merge of #87430 - devnexen:netbsd_ucred_enabled, r=joshtriplett
bors [Mon, 26 Jul 2021 00:22:45 +0000 (00:22 +0000)]
Auto merge of #87430 - devnexen:netbsd_ucred_enabled, r=joshtriplett

netbsd enabled ucred

2 years agoRemove unnecessary `structhead` parameter from `render_union`
Noah Lev [Sun, 25 Jul 2021 23:28:52 +0000 (16:28 -0700)]
Remove unnecessary `structhead` parameter from `render_union`

`structhead` is used for `render_struct` so that the logic for rendering
structs can be shared between struct variants and struct items. However,
`render_union` is not used anywhere except for rendering union items, so
its `structhead` parameter is unnecessary.

2 years agoauthor: check block.expr: None
Cameron Steffen [Sun, 25 Jul 2021 21:35:35 +0000 (16:35 -0500)]
author: check block.expr: None

2 years agoAuto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, r=GuillaumeGomez
bors [Sun, 25 Jul 2021 21:41:57 +0000 (21:41 +0000)]
Auto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, r=GuillaumeGomez

Rustdoc accessibility: use real headers for doc items

Part of #87059

Partially reverts #84703

Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html

2 years agoRustdoc accessibility: use real headers for doc items
bors [Sun, 25 Jul 2021 21:41:57 +0000 (21:41 +0000)]
Rustdoc accessibility: use real headers for doc items

Part of #87059

Partially reverts #84703

Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html

2 years agoAdd test for tuple struct documentation fields
Guillaume Gomez [Sun, 25 Jul 2021 12:57:45 +0000 (14:57 +0200)]
Add test for tuple struct documentation fields

2 years agoAdd support for tuple structs' fields documentation
Guillaume Gomez [Sun, 25 Jul 2021 12:48:57 +0000 (14:48 +0200)]
Add support for tuple structs' fields documentation

2 years agoAuto merge of #86595 - a1phyr:allocator_api_for_vecdeque, r=Amanieu
bors [Sun, 25 Jul 2021 19:01:10 +0000 (19:01 +0000)]
Auto merge of #86595 - a1phyr:allocator_api_for_vecdeque, r=Amanieu

Add support for custom allocator in `VecDeque`

This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections.

`@rustbot` modify labels: +A-allocators +T-libs

2 years agoFix failing test
Benoît du Garreau [Sun, 25 Jul 2021 18:34:08 +0000 (20:34 +0200)]
Fix failing test

2 years agofmt
ibraheemdev [Sun, 25 Jul 2021 17:35:06 +0000 (13:35 -0400)]
fmt

2 years agofix help message for modification to &T created by &{t}
ibraheemdev [Sun, 25 Jul 2021 17:16:40 +0000 (13:16 -0400)]
fix help message for modification to &T created by &{t}

2 years agofreebsd remove compiler workaround.
David Carlier [Sun, 25 Jul 2021 16:38:44 +0000 (17:38 +0100)]
freebsd remove compiler workaround.

related issue #43575

2 years agoAuto merge of #86438 - FabianWolff:issue-83693, r=jackh726
bors [Sun, 25 Jul 2021 16:17:58 +0000 (16:17 +0000)]
Auto merge of #86438 - FabianWolff:issue-83693, r=jackh726

Fix the ICE described in #83693

This pull request fixes #83693 and fixes #84768.

2 years agofix test/ui/borrowck/issue-33819
ibraheemdev [Sun, 25 Jul 2021 14:56:13 +0000 (10:56 -0400)]
fix test/ui/borrowck/issue-33819

2 years agotidy
ibraheemdev [Sun, 25 Jul 2021 14:38:12 +0000 (10:38 -0400)]
tidy

2 years agosuggest removing unnecessary \&mut as help message
ibraheemdev [Sun, 25 Jul 2021 14:23:48 +0000 (10:23 -0400)]
suggest removing unnecessary \&mut as help message

2 years agoAuto merge of #85646 - Moxinilian:separate-const-switch, r=cjgillot
bors [Sun, 25 Jul 2021 13:51:48 +0000 (13:51 +0000)]
Auto merge of #85646 - Moxinilian:separate-const-switch, r=cjgillot

MIR opt: separate constant predecessors of a switch

For each block S ending with a switch, this pass copies S for each of S's predecessors that seem to assign the value being switched over as a const. This is done using a somewhat simple heuristic to determine what seems to be a const transitively.

More precisely, this is what the pass does:
- find a block that ends in a switch
- track if there is an unique place set before the current basic block that determines the result of the switch (this is the part that resolves switching over discriminants)
- if there is, iterate over the parents that have a reasonable terminator and find if the found determining place is likely to be (transitively) set from a const within that parent block
- if so, add the corresponding edge to a vector of edges to duplicate
- once this is done, iterate over the found edges: copy the target block and replace the reference to the target block in the origin block with the new block

This pass is not optimal and could probably duplicate in more cases, but the intention was mostly to address cases like in #85133 or #85365, to avoid creating new enums that get destroyed immediately afterwards (notably making the new try v2 `?` desugar zero-cost).

A benefit of this pass working the way it does is that it is easy to ensure its correctness: the worst that can happen is for it to needlessly copy a basic block, which is likely to be destroyed by cleanup passes afterwards. The complex parts where aliasing matters are only heuristics and the hard work is left to further passes like ConstProp.

# LLVM blocker

Unfortunately, I believe it would be unwise to enable this optimization by default for now. Indeed, currently switch lowering passes like SimplifyCFG in LLVM lose the information on the set of possible variant values, which means it tends to actually generate worse code with this optimization enabled. A fix would have to be done in LLVM itself. This is something I also want to look into. I have opened [a bug report at the LLVM bug tracker](https://bugs.llvm.org/show_bug.cgi?id=50455).

When this is done, I hope we can enable this pass by default. It should be fairly fast and I think it is beneficial in many cases. Notably, it should be a sound alternative to simplify-arm-identity. By the way, ConstProp only seems to pick up the optimization in functions that are not generic. This is however most likely an issue in ConstProp that I will look into afterwards.

This is my first contribution to rustc, and I would like to thank everyone on the Zulip mir-opt chat for the help and support, and especially `@scottmcm` for the guidance.

2 years agoExplain flags missing in cargo check in --help
Nadir Fejzic [Sun, 25 Jul 2021 12:41:35 +0000 (14:41 +0200)]
Explain flags missing in cargo check in --help

This commit closes #7389. As stated in the issue, `cargo clippy --help`
provides explanation for some flags and states that the rest are same
as in `cargo check --help`, even though some clippy specific flags
exist.

This commit extends the `cargo clippy --help` with two additional flags,
  - `cargo clippy --fix`
  - `cargo clippy --no-deps`

If there are more flags which are not present in `cargo check --help`
please bring these to my attention, I will include these aswell.
For now, I noticed only the two flags mentioned above.

2 years agoAuto merge of #83723 - cjgillot:ownernode, r=petrochenkov
bors [Sun, 25 Jul 2021 11:11:02 +0000 (11:11 +0000)]
Auto merge of #83723 - cjgillot:ownernode, r=petrochenkov

Store all HIR owners in the same container

This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem.
This should allow for a more compact storage.

Based on https://github.com/rust-lang/rust/pull/83114

2 years agoAuto merge of #83723 - cjgillot:ownernode, r=petrochenkov
bors [Sun, 25 Jul 2021 11:11:02 +0000 (11:11 +0000)]
Auto merge of #83723 - cjgillot:ownernode, r=petrochenkov

Store all HIR owners in the same container

This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem.
This should allow for a more compact storage.

Based on https://github.com/rust-lang/rust/pull/83114

2 years agoclippy::useless_format
Matthias Krüger [Wed, 21 Jul 2021 20:43:19 +0000 (22:43 +0200)]
clippy::useless_format

2 years agoclippy::flat_map_identity
Matthias Krüger [Wed, 21 Jul 2021 20:00:44 +0000 (22:00 +0200)]
clippy::flat_map_identity

2 years agoclippy::filter_map_identity
Matthias Krüger [Wed, 21 Jul 2021 19:53:45 +0000 (21:53 +0200)]
clippy::filter_map_identity

2 years agoclippy::filter_next
Matthias Krüger [Wed, 21 Jul 2021 19:46:02 +0000 (21:46 +0200)]
clippy::filter_next

2 years agoclippy:: append_instead_of_extend
Matthias Krüger [Sat, 17 Jul 2021 22:01:59 +0000 (00:01 +0200)]
clippy:: append_instead_of_extend

2 years agoclippy::single_char_pattern
Matthias Krüger [Sat, 17 Jul 2021 21:35:57 +0000 (23:35 +0200)]
clippy::single_char_pattern

2 years agoOnly check macro attributes when checking the crate root.
Camille GILLOT [Sat, 24 Jul 2021 17:30:46 +0000 (19:30 +0200)]
Only check macro attributes when checking the crate root.

2 years agoBless tests.
Camille GILLOT [Mon, 29 Mar 2021 18:10:26 +0000 (20:10 +0200)]
Bless tests.