]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #81821 - nikic:update-wasm32, r=sanxiyn
bors [Sun, 7 Feb 2021 02:36:08 +0000 (02:36 +0000)]
Auto merge of #81821 - nikic:update-wasm32, r=sanxiyn

Upgrade wasm32 image to Ubuntu 20.04

This switches the wasm32 image, which is used to test
wasm32-unknown-emscripten, to Ubuntu 20.04. While at it, enable
most of the excluded tests, as they seem to work fine with some
minor fixes.

3 years agoAuto merge of #78052 - da-x:path-trimming-type-aliases, r=davidtwco
bors [Sat, 6 Feb 2021 23:44:42 +0000 (23:44 +0000)]
Auto merge of #78052 - da-x:path-trimming-type-aliases, r=davidtwco

path trimming: ignore type aliases

Continuation of #73996.

3 years agoAuto merge of #80883 - GuillaumeGomez:remove-some-function-fields, r=ollie27
bors [Sat, 6 Feb 2021 20:55:36 +0000 (20:55 +0000)]
Auto merge of #80883 - GuillaumeGomez:remove-some-function-fields, r=ollie27

Remove some function fields

Same kind as #80845.

This PR removes the `all_types` and `ret_types` from the `clean::Function` type.

Another change that I had to do was implementing the `From` trait to be able to convert `hir::def::DefKind` into `clean::TypeKind` without requiring `DocContext` (and so I updated the `clean` method so that it's taken into account).

The last two commits improve a bit the `get_real_types` function and the `Type::generics` method.

r? `@jyn514`

3 years agoAuto merge of #81832 - jonas-schievink:rollup-3nw53p0, r=jonas-schievink
bors [Sat, 6 Feb 2021 18:03:37 +0000 (18:03 +0000)]
Auto merge of #81832 - jonas-schievink:rollup-3nw53p0, r=jonas-schievink

Rollup of 7 pull requests

Successful merges:

 - #81402 (tidy: Run tidy style against markdown files.)
 - #81434 (BTree: fix documentation of unstable public members)
 - #81680 (Refactor `PrimitiveTypeTable` for Clippy)
 - #81737 (typeck: Emit structured suggestions for tuple struct syntax)
 - #81738 (Miscellaneous small diagnostics cleanup)
 - #81766 (Enable 'task list' markdown extension)
 - #81812 (Add a test for escaping LLVMisms in inline asm)

Failed merges:

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

3 years agoRollup merge of #81812 - nagisa:nagisa/escape-the-escape-hatch, r=Amanieu
Jonas Schievink [Sat, 6 Feb 2021 16:01:52 +0000 (17:01 +0100)]
Rollup merge of #81812 - nagisa:nagisa/escape-the-escape-hatch, r=Amanieu

Add a test for escaping LLVMisms in inline asm

We escape certain LLVM-specific features when passing the inline
assembly string to the LLVM. Until now, however, there was no test
making sure this behaviour stays intact. This commit adds such a test!

r? `@Amanieu`
cc `@joshtriplett`

3 years agoRollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomez
Jonas Schievink [Sat, 6 Feb 2021 16:01:50 +0000 (17:01 +0100)]
Rollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomez

Enable 'task list' markdown extension

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

3 years agoRollup merge of #81738 - camelid:misc-small-diag-cleanup, r=lcnr
Jonas Schievink [Sat, 6 Feb 2021 16:01:49 +0000 (17:01 +0100)]
Rollup merge of #81738 - camelid:misc-small-diag-cleanup, r=lcnr

Miscellaneous small diagnostics cleanup

3 years agoRollup merge of #81737 - camelid:typeck-structure-sugg, r=lcnr
Jonas Schievink [Sat, 6 Feb 2021 16:01:47 +0000 (17:01 +0100)]
Rollup merge of #81737 - camelid:typeck-structure-sugg, r=lcnr

typeck: Emit structured suggestions for tuple struct syntax

And tuple variant syntax, but that didn't fit in the subject :)

Now the fact that these are suggestions is exposed both to the layout
engine and to IDEs and rustfix for automatic application.

3 years agoRollup merge of #81680 - camsteffen:primty, r=oli-obk
Jonas Schievink [Sat, 6 Feb 2021 16:01:45 +0000 (17:01 +0100)]
Rollup merge of #81680 - camsteffen:primty, r=oli-obk

Refactor `PrimitiveTypeTable` for Clippy

I removed `PrimitiveTypeTable` and added `PrimTy::ALL` and `PrimTy::from_name` in its place. This allows Clippy to use `PrimTy::from_name` for the `builtin_type_shadow` lint, and a `const` list of primitive types is deleted from Clippy code (the goal). All changes should be a little faster, if anything.

3 years agoRollup merge of #81434 - ssomers:btree_drain_filter_doc_update, r=dtolnay
Jonas Schievink [Sat, 6 Feb 2021 16:01:43 +0000 (17:01 +0100)]
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`

3 years agoRollup merge of #81402 - ehuss:md-tidy, r=jyn514
Jonas Schievink [Sat, 6 Feb 2021 16:01:42 +0000 (17:01 +0100)]
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.

3 years agoAuto merge of #81824 - RalfJung:miri, r=RalfJung
bors [Sat, 6 Feb 2021 15:14:44 +0000 (15:14 +0000)]
Auto merge of #81824 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoAdd a test for escaping LLVMisms in inline asm
Simonas Kazlauskas [Sat, 6 Feb 2021 00:26:35 +0000 (02:26 +0200)]
Add a test for escaping LLVMisms in inline asm

We escape certain LLVM-specific features when passing the inline
assembly string to the LLVM. Until now, however, there was no test
making sure this behaviour stays intact. This commit adds such a test!

3 years agoupdate Miri
Ralf Jung [Sat, 6 Feb 2021 12:18:51 +0000 (13:18 +0100)]
update Miri

3 years agoUpgrade wasm32 image to Ubuntu 20.04
Nikita Popov [Fri, 5 Feb 2021 14:52:49 +0000 (15:52 +0100)]
Upgrade wasm32 image to Ubuntu 20.04

This switches the wasm32 image, which is used to test
wasm32-unknown-emscripten to Ubuntu 20.04. While at it, enable
most of the excluded tests, as they seem to work fine with some
minor fixes.

3 years agopath trimming: disable on src/test/run-make-fulldeps/coverage-spanview
Dan Aloni [Thu, 28 Jan 2021 06:47:53 +0000 (08:47 +0200)]
path trimming: disable on src/test/run-make-fulldeps/coverage-spanview

3 years agopath trimming: ignore type aliases
Dan Aloni [Thu, 28 Jan 2021 16:01:36 +0000 (18:01 +0200)]
path trimming: ignore type aliases

3 years agoAuto merge of #81792 - pietroalbini:bump-nightly, r=Mark-Simulacrum
bors [Sat, 6 Feb 2021 07:55:28 +0000 (07:55 +0000)]
Auto merge of #81792 - pietroalbini:bump-nightly, r=Mark-Simulacrum

Bump nightly version to 1.52.0

cc `@rust-lang/release`

3 years agoEnable 'task list' markdown extension
Joshua Nelson [Thu, 4 Feb 2021 23:10:33 +0000 (18:10 -0500)]
Enable 'task list' markdown extension

- Add documentation about task lists

3 years agoAuto merge of #81810 - m-ou-se:rollup-q3nborp, r=m-ou-se
bors [Sat, 6 Feb 2021 04:55:09 +0000 (04:55 +0000)]
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

3 years agoBTreeMap: fix documentation of unstable public members
Stein Somers [Wed, 27 Jan 2021 12:21:02 +0000 (13:21 +0100)]
BTreeMap: fix documentation of unstable public members

3 years agoBump clippy version
Mark Rousskov [Fri, 5 Feb 2021 23:29:05 +0000 (18:29 -0500)]
Bump clippy version

3 years agoRollup merge of #81795 - camsteffen:diagnostics-reduce, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 23:14:17 +0000 (00:14 +0100)]
Rollup merge of #81795 - camsteffen:diagnostics-reduce, r=oli-obk

Small refactor with Iterator::reduce

3 years agoRollup merge of #81753 - tmiasko:inline-instruction-set, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 23:14:16 +0000 (00:14 +0100)]
Rollup merge of #81753 - tmiasko:inline-instruction-set, r=oli-obk

Never MIR inline functions with a different instruction set

3 years agoRollup merge of #81675 - poliorcetics:respect-shortness, r=jyn514
Mara Bos [Fri, 5 Feb 2021 23:14:14 +0000 (00:14 +0100)]
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

3 years agoRollup merge of #81664 - bjorn3:no_codegen_hir, r=lcnr
Mara Bos [Fri, 5 Feb 2021 23:14:13 +0000 (00:14 +0100)]
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.

3 years agoRollup merge of #81610 - ssomers:btree_emphasize_ord_bound, r=dtolnay
Mara Bos [Fri, 5 Feb 2021 23:14:11 +0000 (00:14 +0100)]
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.

3 years agoRollup merge of #81580 - rodrimati1992:patch-2, r=dtolnay
Mara Bos [Fri, 5 Feb 2021 23:14:09 +0000 (00:14 +0100)]
Rollup merge of #81580 - rodrimati1992:patch-2, r=dtolnay

Document how `MaybeUninit<Struct>` can be initialized.

3 years agoRollup merge of #80011 - Stupremee:stabilize-peekable-next-if, r=dtolnay
Mara Bos [Fri, 5 Feb 2021 23:14:06 +0000 (00:14 +0100)]
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

3 years agoAuto merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisa
bors [Fri, 5 Feb 2021 22:58:13 +0000 (22:58 +0000)]
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).

3 years agoBump peekable_next_if to rust 1.51.0
David Tolnay [Fri, 5 Feb 2021 22:25:21 +0000 (14:25 -0800)]
Bump peekable_next_if to rust 1.51.0

3 years agoAuto merge of #81215 - cjgillot:defkey-mir, r=oli-obk
bors [Fri, 5 Feb 2021 18:21:47 +0000 (18:21 +0000)]
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`

3 years agoRemove unneeded From trait impl for DefKind
Guillaume Gomez [Tue, 2 Feb 2021 23:46:48 +0000 (00:46 +0100)]
Remove unneeded From trait impl for DefKind

3 years agoRemove unused cache argument
Guillaume Gomez [Tue, 2 Feb 2021 23:42:39 +0000 (00:42 +0100)]
Remove unused cache argument

3 years agoImprove code
Guillaume Gomez [Fri, 29 Jan 2021 13:45:03 +0000 (14:45 +0100)]
Improve code

3 years agoImprove html::render::cache::get_real_types code
Guillaume Gomez [Thu, 28 Jan 2021 15:23:41 +0000 (16:23 +0100)]
Improve html::render::cache::get_real_types code

3 years agoRemove Function all_types and ret_types fields
Guillaume Gomez [Thu, 28 Jan 2021 15:07:24 +0000 (16:07 +0100)]
Remove Function all_types and ret_types fields

3 years agoExplicitly match all DefKind item in conversion to TypeKind
Guillaume Gomez [Tue, 12 Jan 2021 12:58:16 +0000 (13:58 +0100)]
Explicitly match all DefKind item in conversion to TypeKind

3 years agoSmall refactor with Iterator::reduce
Cameron Steffen [Thu, 4 Feb 2021 21:44:24 +0000 (15:44 -0600)]
Small refactor with Iterator::reduce

3 years agobump nightly version to 1.52.0
Pietro Albini [Fri, 5 Feb 2021 15:24:49 +0000 (16:24 +0100)]
bump nightly version to 1.52.0

3 years agoAuto merge of #81257 - pnkfelix:issue-80949-short-term-resolution-via-revert-of-pr...
bors [Fri, 5 Feb 2021 14:52:57 +0000 (14:52 +0000)]
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.)

3 years agoAuto merge of #81784 - m-ou-se:rollup-s23fow7, r=m-ou-se
bors [Fri, 5 Feb 2021 12:11:05 +0000 (12:11 +0000)]
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

3 years agoRun x.py fmt to fix tidy issues
Wesley Wiser [Fri, 5 Feb 2021 11:35:32 +0000 (06:35 -0500)]
Run x.py fmt to fix tidy issues

3 years agoRollup merge of #81781 - m-ou-se:fix-ci, r=pietroalbini
Mara Bos [Fri, 5 Feb 2021 11:26:10 +0000 (12:26 +0100)]
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'`.

3 years agoRollup merge of #81771 - tgnottingham:time-passes-rss-delta, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 11:26:08 +0000 (12:26 +0100)]
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``

3 years agoRollup merge of #81767 - exrook:layout-error-stability, r=Mark-Simulacrum
Mara Bos [Fri, 5 Feb 2021 11:26:07 +0000 (12:26 +0100)]
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.

3 years agoRollup merge of #81763 - camelid:rustdoc-passes-desc-up, r=GuillaumeGomez
Mara Bos [Fri, 5 Feb 2021 11:26:06 +0000 (12:26 +0100)]
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).

3 years agoRollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
Mara Bos [Fri, 5 Feb 2021 11:26:05 +0000 (12:26 +0100)]
Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu

Make `Allocator` object-safe

This allows rust-lang/wg-allocators#83: polymorphic allocators

3 years agoRollup merge of #81682 - JulianKnodt:bit_set_iter_benchmarks, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 11:26:03 +0000 (12:26 +0100)]
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.

3 years agoRollup merge of #81676 - jyn514:crate-not-found, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 11:26:02 +0000 (12:26 +0100)]
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.

3 years agoRollup merge of #81542 - RReverser:wasi-symlink, r=alexcrichton
Mara Bos [Fri, 5 Feb 2021 11:26:00 +0000 (12:26 +0100)]
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``

3 years agoRollup merge of #81500 - CraftSpider:union-kind, r=jyn514
Mara Bos [Fri, 5 Feb 2021 11:25:59 +0000 (12:25 +0100)]
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.

3 years agoRollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jyn514
Mara Bos [Fri, 5 Feb 2021 11:25:58 +0000 (12:25 +0100)]
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````

3 years agoRollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
Mara Bos [Fri, 5 Feb 2021 11:25:56 +0000 (12:25 +0100)]
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.

3 years agoRollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514
Mara Bos [Fri, 5 Feb 2021 11:25:54 +0000 (12:25 +0100)]
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.

3 years agoRollup merge of #81307 - estebank:invalid-byte-str-span, r=petrochenkov
Mara Bos [Fri, 5 Feb 2021 11:25:53 +0000 (12:25 +0100)]
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.

3 years agoRollup merge of #80726 - lcnr:unsize-query, r=oli-obk
Mara Bos [Fri, 5 Feb 2021 11:25:52 +0000 (12:25 +0100)]
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);
}
```

3 years agoRollup merge of #79554 - b-naber:generic-associated-types-in-trait-paths, r=jackh726
Mara Bos [Fri, 5 Feb 2021 11:25:50 +0000 (12:25 +0100)]
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``

3 years agoFix `install-awscli.sh` error in CI.
Mara Bos [Fri, 5 Feb 2021 10:48:43 +0000 (11:48 +0100)]
Fix `install-awscli.sh` error in CI.

3 years agoAuto merge of #81736 - tgnottingham:tune-cgu-scheduling-for-memory, r=nagisa
bors [Fri, 5 Feb 2021 09:20:51 +0000 (09:20 +0000)]
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.

3 years agoIndicate change in RSS from start to end of pass in time-passes output
Tyson Nottingham [Fri, 5 Feb 2021 02:38:06 +0000 (18:38 -0800)]
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.

3 years agoAuto merge of #81688 - pnkfelix:fix-llvm-version-check-in-run-make-tests, r=simulacrum
bors [Fri, 5 Feb 2021 06:12:26 +0000 (06:12 +0000)]
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.

3 years agoBless code coverage test
Wesley Wiser [Fri, 29 Jan 2021 12:39:08 +0000 (07:39 -0500)]
Bless code coverage test

3 years agoregression test for issue 80949.
Felix S. Klock II [Fri, 22 Jan 2021 03:44:30 +0000 (22:44 -0500)]
regression test for issue 80949.

3 years agoRevert "Simplify unscheduling of drops after moves"
Felix S. Klock II [Fri, 22 Jan 2021 03:44:02 +0000 (22:44 -0500)]
Revert "Simplify unscheduling of drops after moves"

This reverts commit b766abc88f78f36193ddefb1079dbc832346b358.

3 years agoRevert "Use `record_operands_moved` more aggresively"
Felix S. Klock II [Fri, 22 Jan 2021 03:38:58 +0000 (22:38 -0500)]
Revert "Use `record_operands_moved` more aggresively"

This reverts commit 7f3e8551dde7f14641618cdb8fda2f99ff1d74b6.

3 years agoRevert "Avoid leaking block expression values"
Felix S. Klock II [Fri, 22 Jan 2021 03:35:05 +0000 (22:35 -0500)]
Revert "Avoid leaking block expression values"

This reverts commit 4fef39113a514bb270f5661a82fdba17d3e41dbb.

3 years agoAuto merge of #81756 - ehuss:update-cargo, r=ehuss
bors [Fri, 5 Feb 2021 02:13:59 +0000 (02:13 +0000)]
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)

3 years agoUpdate LayoutError/LayoutErr stability attributes
Jacob Hughes [Fri, 5 Feb 2021 00:02:57 +0000 (19:02 -0500)]
Update LayoutError/LayoutErr stability attributes

3 years agoNever MIR inline functions with a different instruction set
Tomasz Miąsko [Fri, 5 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Never MIR inline functions with a different instruction set

3 years agoAuto merge of #81761 - m-ou-se:rollup-xp7v07n, r=m-ou-se
bors [Thu, 4 Feb 2021 23:16:08 +0000 (23:16 +0000)]
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

3 years agoadd tests
b-naber [Mon, 30 Nov 2020 08:30:14 +0000 (09:30 +0100)]
add tests

3 years agoCleanup rustdoc pass descriptions a bit
Camelid [Thu, 4 Feb 2021 21:19:01 +0000 (13:19 -0800)]
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).

3 years agoremove subst_supertrait call
b-naber [Mon, 30 Nov 2020 08:28:16 +0000 (09:28 +0100)]
remove subst_supertrait call

3 years agouse generic arguments of associated item in trait_ref method
b-naber [Mon, 30 Nov 2020 08:27:23 +0000 (09:27 +0100)]
use generic arguments of associated item in trait_ref method

3 years agoAuto merge of #81762 - pietroalbini:fix-install-msys2, r=m-ou-se
bors [Thu, 4 Feb 2021 20:30:11 +0000 (20:30 +0000)]
Auto merge of #81762 - pietroalbini:fix-install-msys2, r=m-ou-se

CI: only copy python.exe to python3.exe if the latter does not exist

We're copying the binary to make sure we can call `python3.exe` around, but it seems like the base image of GitHub Actions changed, copying the file before we do so. This PR changes the CI script to only copy the file if it doesn't already exist.

r? `@m-ou-se`
cc `@Mark-Simulacrum`

3 years agoci: only copy python.exe to python3.exe if the latter does not exist
Pietro Albini [Thu, 4 Feb 2021 20:24:41 +0000 (21:24 +0100)]
ci: only copy python.exe to python3.exe if the latter does not exist

We're copying the binary to make sure we can call python3.exe around,
but it seems like the base image of GitHub Actions changed, copying the
file before we do so.

This commit changes the CI script to only copy the file if it doesn't
already exist.

3 years agoRollup merge of #81745 - Kixunil:stabilize_once_poison, r=m-ou-se
Mara Bos [Thu, 4 Feb 2021 20:10:44 +0000 (21:10 +0100)]
Rollup merge of #81745 - Kixunil:stabilize_once_poison, r=m-ou-se

Stabilize poison API of Once, rename poisoned()

This stabilizes:

* `OnceState`
* `OnceState::is_poisoned()` (previously named `poisoned()`)
* `Once::call_once_force()`

`poisoned()` was renamed because the new name is more clear as a few
people agreed and nobody objected.

Closes #33577

Notes:

* I'm not entirely sure it's supposed to be 1.51, LMK if I did it wrong
* I failed to run tests locally, so we will have to leave it to bors or someone else can try

3 years agoRollup merge of #81727 - m-ou-se:unstabilize-bits, r=Mark-Simulacrum
Mara Bos [Thu, 4 Feb 2021 20:10:42 +0000 (21:10 +0100)]
Rollup merge of #81727 - m-ou-se:unstabilize-bits, r=Mark-Simulacrum

Revert stabilizing integer::BITS.

We agreed in the libs meeting just now to revert stablization, since the [breakage](https://github.com/rust-lang/rust/issues/81654) is significant throughout the ecosystem, through `lexical-core`.

cc https://github.com/rust-lang/rust/issues/76904

Fixes https://github.com/rust-lang/rust/issues/81654

3 years agoRollup merge of #81725 - mark-i-m:mv-test, r=Mark-Simulacrum
Mara Bos [Thu, 4 Feb 2021 20:10:40 +0000 (21:10 +0100)]
Rollup merge of #81725 - mark-i-m:mv-test, r=Mark-Simulacrum

Move test to be with the others

No functional changes. I just created this test in the wrong place in a past PR. All of the other or-pattern tests are in the `or-patterns` directory.

3 years agoRollup merge of #81711 - saethlin:ipaddr-inline, r=m-ou-se
Mara Bos [Thu, 4 Feb 2021 20:10:39 +0000 (21:10 +0100)]
Rollup merge of #81711 - saethlin:ipaddr-inline, r=m-ou-se

add #[inline] to all the public IpAddr functions

3 years agoRollup merge of #81710 - TyPR124:patch-2, r=m-ou-se
Mara Bos [Thu, 4 Feb 2021 20:10:37 +0000 (21:10 +0100)]
Rollup merge of #81710 - TyPR124:patch-2, r=m-ou-se

OsStr eq_ignore_ascii_case takes arg by value

Per a comment on #70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference.

This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`.

Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example.

If this change should be made in some other PR (like #80193) then please just close this.

3 years agoRollup merge of #81645 - m-ou-se:panic-lint, r=estebank,flip1995
Mara Bos [Thu, 4 Feb 2021 20:10:36 +0000 (21:10 +0100)]
Rollup merge of #81645 - m-ou-se:panic-lint, r=estebank,flip1995

Add lint for `panic!(123)` which is not accepted in Rust 2021.

This extends the `panic_fmt` lint to warn for all cases where the first argument cannot be interpreted as a format string, as will happen in Rust 2021.

It suggests to add `"{}",` to format the message as a string. In the case of `std::panic!()`, it also suggests the recently stabilized
`std::panic::panic_any()` function as an alternative.

It renames the lint to `non_fmt_panic` to match the lint naming guidelines.

![image](https://user-images.githubusercontent.com/783247/106520928-675ea680-64d5-11eb-81f7-d8fa48b93a0b.png)

This is part of #80162.

r? ```@estebank```

3 years agoRollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelix
Mara Bos [Thu, 4 Feb 2021 20:10:34 +0000 (21:10 +0100)]
Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelix

introduce future-compatibility warning for forbidden lint groups

We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218).

This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect.

r? ``@Mark-Simulacrum``

3 years agoRollup merge of #79805 - m-ou-se:iterator-reduce, r=KodrAus
Mara Bos [Thu, 4 Feb 2021 20:10:33 +0000 (21:10 +0100)]
Rollup merge of #79805 - m-ou-se:iterator-reduce, r=KodrAus

Rename Iterator::fold_first to reduce and stabilize it

This stabilizes `#![feature(iterator_fold_self)]`.

The name for this function (originally `fold_first`) was still an open question, but the discussion on [the tracking issue](https://github.com/rust-lang/rust/issues/68125) seems to have converged to `reduce`.

3 years agoRollup merge of #74304 - yoshuawuyts:stabilize-wake, r=KodrAus
Mara Bos [Thu, 4 Feb 2021 20:10:31 +0000 (21:10 +0100)]
Rollup merge of #74304 - yoshuawuyts:stabilize-wake, r=KodrAus

Stabilize the Wake trait

This PR proposes stabilizing the `wake_trait` feature, tracking issue https://github.com/rust-lang/rust/issues/69912.

## Motivation

The surface area this trait introduces is small, and it has been on nightly for 4 months without any reported issues. Given the surface area of this trait is small and only serves to provide a safe interface around the already stable [`std::task::RawWakerVTable`](https://doc.rust-lang.org/std/task/struct.RawWaker.html) it seems unlikely this trait will require any further changes. So I'm proposing we stabilize this.

Personally I would love to have this available on stable, since it would enable cleaning up some runtime internals by removing the tedious pointer required to construct a [`RawWakerVTable`](https://doc.rust-lang.org/std/task/struct.RawWakerVTable.html). I believe the intent was always to introduce a `Wake` counterpart to `RawWaker` in order to safely construct `Waker` instances. And the `Wake` trait feels like it does that job as intended.

## Implementation notes

This PR itself fixes a link in the docs, and introduces an example of how to use the trait: a minimal `block_on` example that runs a future to completion on the current thread. It doesn't include fancier features such as support for nesting, but is intended to serve as a teaching device for both `task::Wake` and futures alike.

3 years agotypeck: Emit structured suggestions for tuple struct syntax
Camelid [Thu, 4 Feb 2021 05:29:00 +0000 (21:29 -0800)]
typeck: Emit structured suggestions for tuple struct syntax

And tuple variant syntax, but that didn't fit in the subject :)

Now the fact that these are suggestions is exposed both to the layout
engine and to IDEs and rustfix for automatic application.

3 years agoUpdate cargo
Eric Huss [Thu, 4 Feb 2021 18:08:54 +0000 (10:08 -0800)]
Update cargo

3 years agoAdd a test for the shortness format in rustdoc
Alexis Bourget [Thu, 4 Feb 2021 17:59:42 +0000 (18:59 +0100)]
Add a test for the shortness format in rustdoc

3 years agoAdjust global_asm doc test to work on all platforms.
Eric Huss [Thu, 4 Feb 2021 17:41:15 +0000 (09:41 -0800)]
Adjust global_asm doc test to work on all platforms.

The cfg isn't actually necessary, since `--emit=metadata` does not
actually do enough validation for it to fail on any platform. However,
I feel a little more comfortable leaving it in.

Unhide the feature flag, since I think that is important to display.

3 years agoEncode less consts.
Camille GILLOT [Thu, 4 Feb 2021 17:02:14 +0000 (18:02 +0100)]
Encode less consts.

3 years agoElaborate on rustdoc example reason for being ignored.
Eric Huss [Tue, 26 Jan 2021 02:15:34 +0000 (18:15 -0800)]
Elaborate on rustdoc example reason for being ignored.

3 years agotidy: Run tidy style against markdown files.
Eric Huss [Tue, 26 Jan 2021 00:19:57 +0000 (16:19 -0800)]
tidy: Run tidy style against markdown files.

3 years agoAuto merge of #81743 - RalfJung:miri, r=RalfJung
bors [Thu, 4 Feb 2021 16:46:38 +0000 (16:46 +0000)]
Auto merge of #81743 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agosubstitutions in trait predicates
b-naber [Mon, 30 Nov 2020 08:26:22 +0000 (09:26 +0100)]
substitutions in trait predicates

3 years agolowering of generic args in AssocTyConstraint
b-naber [Mon, 30 Nov 2020 08:24:54 +0000 (09:24 +0100)]
lowering of generic args in AssocTyConstraint

3 years agohir pretty printing
b-naber [Mon, 30 Nov 2020 08:23:59 +0000 (09:23 +0100)]
hir pretty printing

3 years agoadd generic args to hir::TypeBinding
b-naber [Mon, 30 Nov 2020 08:23:00 +0000 (09:23 +0100)]
add generic args to hir::TypeBinding

3 years agoStabilize poison API of Once, rename poisoned()
Martin Habovstiak [Thu, 4 Feb 2021 10:13:03 +0000 (11:13 +0100)]
Stabilize poison API of Once, rename poisoned()

This stabilizes:

* `OnceState`
* `OnceState::is_poisoned()` (previously named `poisoned()`)
* `Once::call_once_force()`

`poisoned()` was renamed because the new name is more clear as a few
people agreed and nobody objected.

Closes #33577

3 years agoStabilize feature(iterator_fold_self): Iterator::reduce
Mara Bos [Mon, 7 Dec 2020 20:24:07 +0000 (21:24 +0100)]
Stabilize feature(iterator_fold_self): Iterator::reduce