Commit graph

137803 commits

Author SHA1 Message Date
Jonas Schievink
747abb86db
Rollup merge of #81434 - ssomers:btree_drain_filter_doc_update, r=dtolnay
BTree: fix documentation of unstable public members

As rightfully requested in #62924 & #70530.
r? `@Mark-Simulacrum`
2021-02-06 17:01:43 +01:00
Jonas Schievink
7acf9ecf4f
Rollup merge of #81402 - ehuss:md-tidy, r=jyn514
tidy: Run tidy style against markdown files.

This adds tidy checks for markdown files.  I think it is useful to have some style enforcement (for the same reasons the style is enforced on other files).  I think it is worthwhile to avoid `ignore` on rust examples since having broken code in documentation is frustrating.  Avoiding trailing whitespace is good because it has semantic meaning in markdown, which I think should be avoided.
2021-02-06 17:01:42 +01:00
bors
399b6452b5 Auto merge of #81792 - pietroalbini:bump-nightly, r=Mark-Simulacrum
Bump nightly version to 1.52.0

cc `@rust-lang/release`
2021-02-06 07:55:28 +00:00
bors
cfba499271 Auto merge of #81810 - m-ou-se:rollup-q3nborp, r=m-ou-se
Rollup of 7 pull requests

Successful merges:

 - #80011 (Stabilize `peekable_next_if`)
 - #81580 (Document how `MaybeUninit<Struct>` can be initialized.)
 - #81610 (BTreeMap: make Ord bound explicit, compile-test its absence)
 - #81664 (Avoid a hir access inside get_static)
 - #81675 (Make rustdoc respect `--error-format short` in doctests)
 - #81753 (Never MIR inline functions with a different instruction set)
 - #81795 (Small refactor with Iterator::reduce)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-06 04:55:09 +00:00
Stein Somers
f0b8166870 BTreeMap: fix documentation of unstable public members 2021-02-06 00:33:50 +01:00
Mark Rousskov
83c34ea052 Bump clippy version 2021-02-05 18:32:28 -05:00
Mara Bos
51c68034b9
Rollup merge of #81795 - camsteffen:diagnostics-reduce, r=oli-obk
Small refactor with Iterator::reduce
2021-02-06 00:14:17 +01:00
Mara Bos
728c955ac0
Rollup merge of #81753 - tmiasko:inline-instruction-set, r=oli-obk
Never MIR inline functions with a different instruction set
2021-02-06 00:14:16 +01:00
Mara Bos
e8aaa1490f
Rollup merge of #81675 - poliorcetics:respect-shortness, r=jyn514
Make rustdoc respect `--error-format short` in doctests

Note that this will not work with `cargo test`, only with `rustdoc --test`, I'll have to modify `cargo` as well.

Fix #81662.

`@rustbot` label +T-rustdoc +A-doctests
2021-02-06 00:14:14 +01:00
Mara Bos
add80c9d4b
Rollup merge of #81664 - bjorn3:no_codegen_hir, r=lcnr
Avoid a hir access inside get_static

Together with #81056 this ensures that the codegen unit DepNode doesn't have a direct dependency on any part of the hir.
2021-02-06 00:14:13 +01:00
Mara Bos
78be1aa226
Rollup merge of #81610 - ssomers:btree_emphasize_ord_bound, r=dtolnay
BTreeMap: make Ord bound explicit, compile-test its absence

Most `BTreeMap` and `BTreeSet` members are subject to an `Ord` bound but a fair number of methods are not. To better convey and perhaps later tune the `Ord` bound, make it stand out in individual `where` clauses, instead of once far away at the beginning of an `impl` block. This PR does not introduce or remove any bounds.

Also adds compilation test cases checking that the bound doesn't creep in unintended on the historically unbounded methods.
2021-02-06 00:14:11 +01:00
Mara Bos
43b3adb4e2
Rollup merge of #81580 - rodrimati1992:patch-2, r=dtolnay
Document how `MaybeUninit<Struct>` can be initialized.
2021-02-06 00:14:09 +01:00
Mara Bos
cc882fc3be
Rollup merge of #80011 - Stupremee:stabilize-peekable-next-if, r=dtolnay
Stabilize `peekable_next_if`

This PR stabilizes the `peekable_next_if` feature

Resolves #72480
2021-02-06 00:14:06 +01:00
bors
16b805713c Auto merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisa
Fix rustc sysroot in systems using CAS

Change filesearch::get_or_default_sysroot() to check if sysroot is found using env::args().next() if rustc in argv[0] is a symlink; otherwise, or if it is not found, use env::current_exe() to imply sysroot. This makes the rustc binary able to locate Rust libraries in systems using content-addressable storage (CAS).
2021-02-05 22:58:13 +00:00
David Tolnay
ceda547c68
Bump peekable_next_if to rust 1.51.0 2021-02-05 14:25:21 -08:00
bors
23adf9fd84 Auto merge of #81215 - cjgillot:defkey-mir, r=oli-obk
Encode MIR metadata by iterating on DefId instead of traversing the HIR tree

Split out of https://github.com/rust-lang/rust/pull/80347.

This part only traverses `mir_keys` and encodes MIR according to the def kind.

r? `@oli-obk`
2021-02-05 18:21:47 +00:00
Cameron Steffen
c89b9d97e2 Small refactor with Iterator::reduce 2021-02-05 09:34:40 -06:00
Pietro Albini
c51e432426
bump nightly version to 1.52.0 2021-02-05 16:25:08 +01:00
bors
5605b5d693 Auto merge of #81257 - pnkfelix:issue-80949-short-term-resolution-via-revert-of-pr-78373, r=matthewjasper
Revert 78373 ("dont leak return value after panic in drop")

Short term resolution for issue #80949.

Reopen #47949 after this lands.

(We plan to fine-tune PR #78373 to not run into this problem.)
2021-02-05 14:52:57 +00:00
bors
f9435f4c92 Auto merge of #81784 - m-ou-se:rollup-s23fow7, r=m-ou-se
Rollup of 15 pull requests

Successful merges:

 - #79554 (Generic associated types in trait paths)
 - #80726 (relax adt unsizing requirements)
 - #81307 (Handle `Span`s for byte and raw strings and add more detail )
 - #81318 (rustdoc-json: Fix has_body)
 - #81456 (Make remote-test-server easier to use with new targets)
 - #81497 (rustdoc: Move `display_fn` struct inside `display_fn`)
 - #81500 (Remove struct_type from union output)
 - #81542 (Expose correct symlink API on WASI)
 - #81676 (Add more information to the error code for 'crate not found')
 - #81682 (Add additional bitset benchmarks)
 - #81730 (Make `Allocator` object-safe)
 - #81763 (Cleanup rustdoc pass descriptions a bit)
 - #81767 (Update LayoutError/LayoutErr stability attributes)
 - #81771 (Indicate change in RSS from start to end of pass in time-passes output)
 - #81781 (Fix `install-awscli.sh` error in CI)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-05 12:11:05 +00:00
Wesley Wiser
dce5e9e1bf Run x.py fmt to fix tidy issues 2021-02-05 06:35:32 -05:00
Mara Bos
2383cd4b2d
Rollup merge of #81781 - m-ou-se:fix-ci, r=pietroalbini
Fix `install-awscli.sh` error in CI

This fixes the `install-awscli.sh` error about missing `'bdist_wheel'`.
2021-02-05 12:26:10 +01:00
Mara Bos
08d8fc14be
Rollup merge of #81771 - tgnottingham:time-passes-rss-delta, r=oli-obk
Indicate change in RSS from start to end of pass in time-passes output

Previously, this was omitted because it could be misleading, but the
functionality seems too useful not to include.

r? ``@oli-obk``
2021-02-05 12:26:08 +01:00
Mara Bos
e077dffaec
Rollup merge of #81767 - exrook:layout-error-stability, r=Mark-Simulacrum
Update LayoutError/LayoutErr stability attributes

`LayoutError` ended up not making it into 1.49.0, updating the stability attributes to reflect that.

I also pushed `LayoutErr` deprecation back a release to allow 2 releases before the deprecation comes into effect.

This change should be backported to beta.
2021-02-05 12:26:07 +01:00
Mara Bos
469d535c13
Rollup merge of #81763 - camelid:rustdoc-passes-desc-up, r=GuillaumeGomez
Cleanup rustdoc pass descriptions a bit

Also changed a couple of comments from "intra-doc-links" to
"intra-doc links" (my understanding is that "intra-doc links" is the
standard way to refer to them).
2021-02-05 12:26:06 +01:00
Mara Bos
ff3c85fd65
Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
Make `Allocator` object-safe

This allows rust-lang/wg-allocators#83: polymorphic allocators
2021-02-05 12:26:05 +01:00
Mara Bos
21c276f9c8
Rollup merge of #81682 - JulianKnodt:bit_set_iter_benchmarks, r=oli-obk
Add additional bitset benchmarks

Add additional benchmarks for operations in bitset, I realize that it was a bit lacking when I intended to optimize it earlier, so I was hoping to put some in so I can verify my work later.
2021-02-05 12:26:03 +01:00
Mara Bos
29371c2504
Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obk
Add more information to the error code for 'crate not found'

This comes up a lot when bootstrapping.
2021-02-05 12:26:02 +01:00
Mara Bos
ce1020fc55
Rollup merge of #81542 - RReverser:wasi-symlink, r=alexcrichton
Expose correct symlink API on WASI

As described in https://github.com/rust-lang/rust/issues/68574, the currently exposed API for symlinks is, in fact, a thin wrapper around the corresponding syscall, and not suitable for public usage.

The reason is that the 2nd param in the call is expected to be a handle of a "preopened directory" (a WASI concept for exposing dirs), and the only way to retrieve such handle right now is by tinkering with a private `__wasilibc_find_relpath` API, which is an implementation detail and definitely not something we want users to call directly.

Making matters worse, the semantics of this param aren't obvious from its name (`fd`), and easy to misinterpret, resulting in people trying to pass a handle of the target file itself (as in https://github.com/vitiral/path_abs/pull/50), which doesn't work as expected.

I did a [codesearch among open-source repos](https://sourcegraph.com/search?q=std%3A%3Aos%3A%3Awasi%3A%3Afs%3A%3Asymlink&patternType=literal), and the usage above is so far the only usage of this API at all, but we should fix it before more people start using it incorrectly.

While this is technically a breaking API change, I believe it's a justified one, as 1) it's OS-specific and 2) there was strictly no way to correctly use the previous form of the API, and if someone does use it, they're likely doing it wrong like in the example above.

The new API does not lead to the same confusion, as it mirrors `std::os::unix::fs::symlink` and `std::os::windows::fs::symlink_{file,dir}` variants by accepting source/target paths.

Fixes #68574.

r? ``@alexcrichton``
2021-02-05 12:26:00 +01:00
Mara Bos
e98e42b881
Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514
Remove struct_type from union output

Also bumps the format number and adds a test

Rationale: It's illegal to have unions of the form `union Union(i32, f32);`, or `union Union;`. The struct_type field was recently removed from the rustdoc Union AST, at which time this field was changed to always just read "union". It makes sense to completely remove it, as it provides no information.
2021-02-05 12:25:59 +01:00
Mara Bos
2451bf90db
Rollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jyn514
rustdoc: Move `display_fn` struct inside `display_fn`

This makes it clear that it's an implementation detail of `display_fn`
and shouldn't be used elsewhere, and it enforces in the compiler that no
one else can use it.

r? ````@GuillaumeGomez````
2021-02-05 12:25:58 +01:00
Mara Bos
b5438e2230
Rollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
Make remote-test-server easier to use with new targets

While testing #81455 I encountered 2 issues with `remote-test-server`:
- It is built with the stage 0 toolchain, which does not support a newly added target.
- It overwrites `LD_LIBRARY_PATH` instead of appending to it, which prevents the use of a custom sysroot for target libraries.
2021-02-05 12:25:56 +01:00
Mara Bos
0493e3aa88
Rollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514
rustdoc-json: Fix has_body

Previously, `has_body` was always true. Now propagate the type of the method to set it correctly. Relies on #81287, that will need to be merged first.
2021-02-05 12:25:54 +01:00
Mara Bos
8d49ca11a2
Rollup merge of #81307 - estebank:invalid-byte-str-span, r=petrochenkov
Handle `Span`s for byte and raw strings and add more detail

CC #81208.
2021-02-05 12:25:53 +01:00
Mara Bos
676ff77fb7
Rollup merge of #80726 - lcnr:unsize-query, r=oli-obk
relax adt unsizing requirements

Changes unsizing of structs in case the last struct field shares generic params with other adt fields which do not change.
This change is currently insta stable and changes the language, so it at least requires a lang fcp. I feel like the current state is fairly unintuitive.

An example for what's now allowed would be https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6dd331d23f5c9ffc8c978175aae2e967
```rust
struct A<T, U: ?Sized>(T, B<T, U>); // previously ERR
// struct A<T, U: ?Sized>(T, B<[u32; 1], U>); // ok
struct B<T, U: ?Sized>(T, U);

fn main() {
    let x = A([0; 1], B([0; 1], [0; 1]));
    let y: &A<[u32; 1], [u32]> = &x;
    assert_eq!(y.1.1.len(), 1);
}
```
2021-02-05 12:25:52 +01:00
Mara Bos
deec6a96d4
Rollup merge of #79554 - b-naber:generic-associated-types-in-trait-paths, r=jackh726
Generic associated types in trait paths

This is the second part of https://github.com/rust-lang/rust/pull/78978

This should fix:

Fixes #67510
Fixes #68648
Fixes #68649
Fixes #68650
Fixes #68652
Fixes #74684
Fixes #76535
Fixes #79422
Fixes #80433

and implement the remaining functionality needed for https://github.com/rust-lang/rust/issues/44265

r? ``@matthewjasper``
2021-02-05 12:25:50 +01:00
Mara Bos
573f1c059f Fix install-awscli.sh error in CI. 2021-02-05 12:17:50 +01:00
bors
730d6dfddd Auto merge of #81736 - tgnottingham:tune-cgu-scheduling-for-memory, r=nagisa
rustc_codegen_ssa: tune codegen scheduling to reduce memory usage

For better throughput during parallel processing by LLVM, we used to sort
CGUs largest to smallest. This would lead to better thread utilization
by, for example, preventing a large CGU from being processed last and
having only one LLVM thread working while the rest remained idle.

However, this strategy would lead to high memory usage, as it meant the
LLVM-IR for all of the largest CGUs would be resident in memory at once.

Instead, we can compromise by ordering CGUs such that the largest and
smallest are first, second largest and smallest are next, etc. If there
are large size variations, this can reduce memory usage significantly.
2021-02-05 09:20:51 +00:00
Tyson Nottingham
4253919f1d Indicate change in RSS from start to end of pass in time-passes output
Previously, this was omitted because it could be misleading, but the
functionality seems too useful not to include.
2021-02-05 01:11:52 -08:00
bors
9e5d58fb42 Auto merge of #81688 - pnkfelix:fix-llvm-version-check-in-run-make-tests, r=simulacrum
Use `# min-llvm-version: 11.0` to force a minimum LLVM version

Use `# min-llvm-version: 11.0` to force a minimum LLVM version, rather than ad-hoc internal solution.

In particular: the specific code to define LLVM_VERSION_11_PLUS here was, for some reason, using `$(shell ...)` with bash-specific variable replacement code. On non-bash platforms like dash, that `shell` invocation would fail, and the
LLVM_VERSION_11_PLUS check would always fail, the test would always be ignored, and thus be treated as a "success" (in the sense that `--bless` would never do anything).

 * Note in particular that GNU Make treats the SHELL variable as a very special case: it does not inherit the value of SHELL from the user's environment. Except on Windows. See more explanation in the [GNU Make docs](https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html).
 * The effect of this is that these tests end up using `/bin/sh` (except on Windows) for their `$(shell ...)` invocations, and thus we see differing behaviors depending on whether your `/bin/sh` links to `/bin/dash` or to `/bin/bash`.

This was causing me a lot of pain.
2021-02-05 06:12:26 +00:00
Wesley Wiser
7c7f10ba38 Bless code coverage test 2021-02-04 21:29:50 -05:00
Felix S. Klock II
fb0e41f6b3 regression test for issue 80949. 2021-02-04 21:29:50 -05:00
Felix S. Klock II
dac354fc32 Revert "Simplify unscheduling of drops after moves"
This reverts commit b766abc88f.
2021-02-04 21:29:50 -05:00
Felix S. Klock II
bed69c6134 Revert "Use record_operands_moved more aggresively"
This reverts commit 7f3e8551dd.
2021-02-04 21:29:50 -05:00
Felix S. Klock II
a71a819480 Revert "Avoid leaking block expression values"
This reverts commit 4fef39113a.
2021-02-04 21:29:49 -05:00
bors
6a388dcfbb Auto merge of #81756 - ehuss:update-cargo, r=ehuss
Update cargo

5 commits in e099df243bb2495b9b197f79c19f124032b1e778..34170fcd6e0947808a1ac63ac85ffc0da7dace2f
2021-02-01 16:24:34 +0000 to 2021-02-04 15:52:52 +0000
- Fix permission issue with `cargo vendor`. (rust-lang/cargo#9131)
- Add split-debuginfo profile option (rust-lang/cargo#9112)
- Add RegistryBuilder for tests, and update crates-io error handling. (rust-lang/cargo#9126)
- Add some documentation for index and registry stuff. (rust-lang/cargo#9125)
- Fix env/cfg set for `cargo test` and `cargo run`. (rust-lang/cargo#9122)
2021-02-05 02:13:59 +00:00
Jacob Hughes
0c3a7d8b85 Update LayoutError/LayoutErr stability attributes 2021-02-04 19:02:57 -05:00
Tomasz Miąsko
eb5e2d08c7 Never MIR inline functions with a different instruction set 2021-02-05 00:00:00 +00:00
bors
dab3a80f23 Auto merge of #81761 - m-ou-se:rollup-xp7v07n, r=m-ou-se
Rollup of 9 pull requests

Successful merges:

 - #74304 (Stabilize the Wake trait)
 - #79805 (Rename Iterator::fold_first to reduce and stabilize it)
 - #81556 (introduce future-compatibility warning for forbidden lint groups)
 - #81645 (Add lint for `panic!(123)` which is not accepted in Rust 2021.)
 - #81710 (OsStr eq_ignore_ascii_case takes arg by value)
 - #81711 (add #[inline] to all the public IpAddr functions)
 - #81725 (Move test to be with the others)
 - #81727 (Revert stabilizing integer::BITS.)
 - #81745 (Stabilize poison API of Once, rename poisoned())

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-04 23:16:08 +00:00
b-naber
12d411febb add tests 2021-02-04 22:56:25 +01:00