]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillot
bors [Sat, 9 Oct 2021 13:13:07 +0000 (13:13 +0000)]
Auto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillot

Refactor fingerprint reconstruction

This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds.

This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.

2 years agoAdd a test that -Zquery-dep-graph -Zdump-dep-graph works
Mark Rousskov [Sat, 2 Oct 2021 16:23:18 +0000 (12:23 -0400)]
Add a test that -Zquery-dep-graph -Zdump-dep-graph works

2 years agoAuto merge of #89698 - matthiaskrgr:rollup-gna54x6, r=matthiaskrgr
bors [Sat, 9 Oct 2021 10:00:54 +0000 (10:00 +0000)]
Auto merge of #89698 - matthiaskrgr:rollup-gna54x6, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #88707 (String.split_terminator: Add an example when using a slice of chars)
 - #89605 (Fix stabilization version for `bindings_after_at`)
 - #89634 (rustc_driver: Enable the `WARN` log level by default)
 - #89641 (make #[target_feature] work with `asm` register classes)
 - #89678 (Fix minor std::thread documentation typo)
 - #89684 (Fix asm docs typo)
 - #89687 (Move `read2_abbreviated` function into read2.rs)
 - #89693 (Add #[must_use] to stdin/stdout/stderr locks)
 - #89694 (Add #[must_use] to string/char transformation methods)
 - #89697 (Fix min LLVM version for bpf-types test)

Failed merges:

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

2 years agoRollup merge of #89697 - alessandrod:issue-89689, r=nikic
Matthias Krüger [Sat, 9 Oct 2021 09:56:08 +0000 (11:56 +0200)]
Rollup merge of #89697 - alessandrod:issue-89689, r=nikic

Fix min LLVM version for bpf-types test

The test requires https://reviews.llvm.org/D102118 which was released in LLVM 13.

Closes #89689

2 years agoRollup merge of #89694 - jkugelman:must-use-string-transforms, r=joshtriplett
Matthias Krüger [Sat, 9 Oct 2021 09:56:07 +0000 (11:56 +0200)]
Rollup merge of #89694 - jkugelman:must-use-string-transforms, r=joshtriplett

Add #[must_use] to string/char transformation methods

These methods could be misconstrued as modifying their arguments instead of returning new values.

Where possible I made the note recommend a method that does mutate in place.

Parent issue: #89692

2 years agoRollup merge of #89693 - jkugelman:must-use-stdin-stdout-stderr-locks, r=joshtriplett
Matthias Krüger [Sat, 9 Oct 2021 09:56:07 +0000 (11:56 +0200)]
Rollup merge of #89693 - jkugelman:must-use-stdin-stdout-stderr-locks, r=joshtriplett

Add #[must_use] to stdin/stdout/stderr locks

Affected methods:

```rust
std::io           fn stdin_locked() -> StdinLock<'static>;
std::io::Stdin    fn lock(&self) -> StdinLock<'_>;
std::io           fn stdout_locked() -> StdoutLock<'static>;
std::io::Stdout   fn lock(&self) -> StdoutLock<'_>;
std::io           fn stderr_locked() -> StderrLock<'static>;
std::io::Stderr   fn lock(&self) -> StderrLock<'_>;
```

Parent issue: https://github.com/rust-lang/rust/issues/89692

2 years agoRollup merge of #89687 - Nicholas-Baron:move_read2_abbreviated, r=Mark-Simulacrum
Matthias Krüger [Sat, 9 Oct 2021 09:56:06 +0000 (11:56 +0200)]
Rollup merge of #89687 - Nicholas-Baron:move_read2_abbreviated, r=Mark-Simulacrum

Move `read2_abbreviated` function into read2.rs

Work towards #89475.

2 years agoRollup merge of #89684 - asquared31415:asm-doc-fix, r=joshtriplett
Matthias Krüger [Sat, 9 Oct 2021 09:56:02 +0000 (11:56 +0200)]
Rollup merge of #89684 - asquared31415:asm-doc-fix, r=joshtriplett

Fix asm docs typo

Fixes a typo in target feature names in the `asm` documentation

2 years agoRollup merge of #89678 - marcelo-gonzalez:master, r=joshtriplett
Matthias Krüger [Sat, 9 Oct 2021 09:56:01 +0000 (11:56 +0200)]
Rollup merge of #89678 - marcelo-gonzalez:master, r=joshtriplett

Fix minor std::thread documentation typo

callers of spawn_unchecked() need to make sure that the thread
not outlive references in the passed closure, not the other way around.

2 years agoRollup merge of #89641 - asquared31415:asm-feature-attr-regs, r=oli-obk
Matthias Krüger [Sat, 9 Oct 2021 09:56:00 +0000 (11:56 +0200)]
Rollup merge of #89641 - asquared31415:asm-feature-attr-regs, r=oli-obk

make #[target_feature] work with `asm` register classes

Fixes #89289

2 years agoRollup merge of #89634 - hawkw:eliza/enable-err-warn, r=oli-obk
Matthias Krüger [Sat, 9 Oct 2021 09:55:59 +0000 (11:55 +0200)]
Rollup merge of #89634 - hawkw:eliza/enable-err-warn, r=oli-obk

rustc_driver: Enable the `WARN` log level by default

This commit changes the `tracing_subscriber` initialization in
`rustc_driver` so that the `WARN` verbosity level is enabled by default
when the `RUSTC_LOG` env variable is empty. If the `RUSTC_LOG` env
variable is set, the filter string in the environment variable is
honored, instead.

Fixes #76824
Closes #89623

cc ``@eddyb,`` ``@oli-obk``

2 years agoRollup merge of #89605 - camelid:fix-version, r=nagisa
Matthias Krüger [Sat, 9 Oct 2021 09:55:58 +0000 (11:55 +0200)]
Rollup merge of #89605 - camelid:fix-version, r=nagisa

Fix stabilization version for `bindings_after_at`

According to the release notes and its PR milestone, it was stabilized
in 1.56.0.

2 years agoRollup merge of #88707 - sylvestre:split_example, r=yaahc
Matthias Krüger [Sat, 9 Oct 2021 09:55:58 +0000 (11:55 +0200)]
Rollup merge of #88707 - sylvestre:split_example, r=yaahc

String.split_terminator: Add an example when using a slice of chars

2 years agoFix min LLVM version for bpf-types test
Alessandro Decina [Sat, 9 Oct 2021 08:18:37 +0000 (19:18 +1100)]
Fix min LLVM version for bpf-types test

Closes #89689

2 years agoUpdate library/core/src/num/mod.rs
John Kugelman [Sat, 9 Oct 2021 06:05:03 +0000 (02:05 -0400)]
Update library/core/src/num/mod.rs

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2 years agoAuto merge of #89582 - jkugelman:optimize-file-read-to-end, r=joshtriplett
bors [Sat, 9 Oct 2021 05:24:47 +0000 (05:24 +0000)]
Auto merge of #89582 - jkugelman:optimize-file-read-to-end, r=joshtriplett

Optimize File::read_to_end and read_to_string

Reading a file into an empty vector or string buffer can incur unnecessary `read` syscalls and memory re-allocations as the buffer "warms up" and grows to its final size. This is perhaps a necessary evil with generic readers, but files can be read in smarter by checking the file size and reserving that much capacity.

`std::fs::read` and `std::fs::read_to_string` already perform this optimization: they open the file, reads its metadata, and call `with_capacity` with the file size. This ensures that the buffer does not need to be resized and an initial string of small `read` syscalls.

However, if a user opens the `File` themselves and calls `file.read_to_end` or `file.read_to_string` they do not get this optimization.

```rust
let mut buf = Vec::new();
file.read_to_end(&mut buf)?;
```

I searched through this project's codebase and even here are a *lot* of examples of this. They're found all over in unit tests, which isn't a big deal, but there are also several real instances in the compiler and in Cargo. I've documented the ones I found in a comment here:

https://github.com/rust-lang/rust/issues/89516#issuecomment-934423999

Most telling, the documentation for both the `Read` trait and the `Read::read_to_end` method both show this exact pattern as examples of how to use readers. What this says to me is that this shouldn't be solved by simply fixing the instances of it in this codebase. If it's here it's certain to be prevalent in the wider Rust ecosystem.

To that end, this commit adds specializations of `read_to_end` and `read_to_string` directly on `File`. This way it's no longer a minor footgun to start with an empty buffer when reading a file in.

A nice side effect of this change is that code that accesses a `File` as `impl Read` or `dyn Read` will benefit. For example, this code from `compiler/rustc_serialize/src/json.rs`:

```rust
pub fn from_reader(rdr: &mut dyn Read) -> Result<Json, BuilderError> {
    let mut contents = Vec::new();
    match rdr.read_to_end(&mut contents) {
```

Related changes:

- I also added specializations to `BufReader` to delegate to `self.inner`'s methods. That way it can call `File`'s optimized  implementations if the inner reader is a file.

- The private `std::io::append_to_string` function is now marked `unsafe`.

- `File::read_to_string` being more efficient means that the performance note for `io::read_to_string` can be softened. I've added `@camelid's` suggested wording from https://github.com/rust-lang/rust/issues/80218#issuecomment-936806502.

r? `@joshtriplett`

2 years agoAdd #[must_use] to string/char transformation methods
John Kugelman [Sat, 9 Oct 2021 05:01:40 +0000 (01:01 -0400)]
Add #[must_use] to string/char transformation methods

These methods could be misconstrued as modifying their arguments instead
of returning new values.

Where possible I made the note recommend a method that does mutate in
place.

2 years agoAdd #[must_use] to stdin/stdout/stderr locks
John Kugelman [Sat, 9 Oct 2021 03:31:57 +0000 (23:31 -0400)]
Add #[must_use] to stdin/stdout/stderr locks

2 years agoMove read2_abbreviated function into read2.rs
Nicholas-Baron [Fri, 8 Oct 2021 22:12:21 +0000 (15:12 -0700)]
Move read2_abbreviated function into read2.rs

2 years agoAuto merge of #89683 - GuillaumeGomez:rollup-q2mjd9m, r=GuillaumeGomez
bors [Fri, 8 Oct 2021 21:13:27 +0000 (21:13 +0000)]
Auto merge of #89683 - GuillaumeGomez:rollup-q2mjd9m, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #86506 (Don't normalize xform_ret_ty during method candidate assembly )
 - #89538 (Make rustdoc not highlight `->` and `=>` as operators)
 - #89649 (clippy::complexity fixes)
 - #89668 (Cfg hide more conditions for core and alloc)
 - #89669 (Remove special-casing of never primitive in rustdoc-json-types)
 - #89672 (Remove unwrap_or! macro)

Failed merges:

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

2 years agoFix asm docs typo
asquared31415 [Fri, 8 Oct 2021 20:50:35 +0000 (16:50 -0400)]
Fix asm docs typo

2 years agoRollup merge of #89672 - klensy:unwrap-or-macro, r=jackh726
Guillaume Gomez [Fri, 8 Oct 2021 20:30:43 +0000 (22:30 +0200)]
Rollup merge of #89672 - klensy:unwrap-or-macro, r=jackh726

Remove unwrap_or! macro

Removes `unwrap_or!` macro and replaces it with `match`.

It's kinda cleanup, as rustc_ast not the best place for this macro and this is used only in 2 places anyway.

2 years agoRollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomez
Guillaume Gomez [Fri, 8 Oct 2021 20:30:42 +0000 (22:30 +0200)]
Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomez

Remove special-casing of never primitive in rustdoc-json-types

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

r? `@GuillaumeGomez`

2 years agoRollup merge of #89668 - Urgau:core-cfg-hide, r=GuillaumeGomez
Guillaume Gomez [Fri, 8 Oct 2021 20:30:41 +0000 (22:30 +0200)]
Rollup merge of #89668 - Urgau:core-cfg-hide, r=GuillaumeGomez

Cfg hide more conditions for core and alloc

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

Before:
![image](https://user-images.githubusercontent.com/3616612/136572816-a7844ac7-dc2f-4d79-87b4-7f9766421a83.png)

After:
![image](https://user-images.githubusercontent.com/3616612/136572745-7d890726-8efd-4d74-83ac-ed06f4687741.png)

*Same for alloc*

r? ``@GuillaumeGomez``

2 years agoRollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514
Guillaume Gomez [Fri, 8 Oct 2021 20:30:40 +0000 (22:30 +0200)]
Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514

clippy::complexity fixes

2 years agoRollup merge of #89538 - notriddle:notriddle/arrow-highlight, r=GuillaumeGomez
Guillaume Gomez [Fri, 8 Oct 2021 20:30:39 +0000 (22:30 +0200)]
Rollup merge of #89538 - notriddle:notriddle/arrow-highlight, r=GuillaumeGomez

Make rustdoc not highlight `->` and `=>` as operators

It was marking them up as `<span class="op">=</span><span class="op">&gt;</span>`,
which is bloaty and wrong (at least, I think `<=` and `=>` should probably be different colors, since they're so different and yet made from the same symbols).

Before:

![image](https://user-images.githubusercontent.com/1593513/135939748-f49b0f9e-6a7d-4d65-935a-e31cdf688a81.png)

After:

![image](https://user-images.githubusercontent.com/1593513/135940063-5ef1f6b1-7e03-4227-b46b-572b063aba05.png)

2 years agoRollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726
Guillaume Gomez [Fri, 8 Oct 2021 20:30:38 +0000 (22:30 +0200)]
Rollup merge of #86506 - b-naber:gen_trait_impl_inconsistent, r=jackh726

Don't normalize xform_ret_ty during method candidate assembly

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

Normalizing the return type of a method candidate together with the expected receiver type of the method can lead to valid method candidates being rejected during probing. Specifically in the example of the fixed issue we have a `self_ty` of the form `&A<&[Coef]>` whereas the `impl_ty` of the method would be `&A<_>`, if we normalize the projection in the return type we unify the inference variable with `Cont`, which will lead us to reject the candidate in the sup type check in `consider_probe`. Since we don't actually need the normalized return type during candidate assembly, we postpone the normalization until we consider candidates in `consider_probe`.

2 years agoFix minor std::thread documentation typo
Marcelo Diop-Gonzalez [Fri, 8 Oct 2021 19:29:04 +0000 (15:29 -0400)]
Fix minor std::thread documentation typo

callers of spawn_unchecked() need to make sure that the thread
not outlive references in the passed closure, not the other way around.

2 years agoAuto merge of #89666 - rusticstuff:disable_new_llvm_pass_manager_on_s390x_take_two...
bors [Fri, 8 Oct 2021 18:12:50 +0000 (18:12 +0000)]
Auto merge of #89666 - rusticstuff:disable_new_llvm_pass_manager_on_s390x_take_two, r=nagisa

Default to disabling the new pass manager for the s390x arch targets.

This hack disables the new LLVM pass manager by default for s390x arch targets until the performance issues are fixed (see #89609). The command line option `-Z new-llvm-pass-manager=(yes|no)` continues to take precedence over this default.

2 years agoclippy::complexity fixes
Matthias Krüger [Thu, 7 Oct 2021 21:18:39 +0000 (23:18 +0200)]
clippy::complexity fixes

2 years agobless warnings
Eliza Weisman [Fri, 8 Oct 2021 17:56:08 +0000 (10:56 -0700)]
bless warnings

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agoremove unwrap_or! macro
klensy [Fri, 8 Oct 2021 16:32:16 +0000 (19:32 +0300)]
remove unwrap_or! macro

2 years agoCfg hide more conditions for alloc
Loïc BRANSTETT [Fri, 8 Oct 2021 15:11:57 +0000 (17:11 +0200)]
Cfg hide more conditions for alloc

2 years agoRemove special-casing of never primitive in rustdoc-json-types
Loïc BRANSTETT [Fri, 8 Oct 2021 14:53:39 +0000 (16:53 +0200)]
Remove special-casing of never primitive in rustdoc-json-types

2 years agoAuto merge of #89644 - matthiaskrgr:clippy_perf_okt, r=jyn514
bors [Fri, 8 Oct 2021 14:35:00 +0000 (14:35 +0000)]
Auto merge of #89644 - matthiaskrgr:clippy_perf_okt, r=jyn514

some clippy::perf fixes

2 years agoCfg hide more conditions for core
Loïc BRANSTETT [Fri, 8 Oct 2021 14:13:49 +0000 (16:13 +0200)]
Cfg hide more conditions for core

2 years agoDefault to disabling the new pass manager for the s390x targets.
Hans Kratz [Fri, 8 Oct 2021 10:10:52 +0000 (12:10 +0200)]
Default to disabling the new pass manager for the s390x targets.

2 years agoAuto merge of #89576 - tom7980:issue-89275-fix, r=estebank
bors [Fri, 8 Oct 2021 11:44:45 +0000 (11:44 +0000)]
Auto merge of #89576 - tom7980:issue-89275-fix, r=estebank

Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions

Closes #89275

This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait.

Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway

2 years agoAuto merge of #89619 - michaelwoerister:incr-vtables, r=nagisa
bors [Fri, 8 Oct 2021 09:04:06 +0000 (09:04 +0000)]
Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisa

Turn vtable_allocation() into a query

This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query.

The change is pretty straightforward and should be backportable without too much effort.

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

2 years agotests
b-naber [Thu, 7 Oct 2021 23:38:33 +0000 (01:38 +0200)]
tests

2 years agodont normalize return type during candidate assembly in method probing
b-naber [Thu, 7 Oct 2021 23:32:03 +0000 (01:32 +0200)]
dont normalize return type during candidate assembly in method probing

2 years agoAuto merge of #89659 - workingjubilee:rollup-0vggc69, r=workingjubilee
bors [Fri, 8 Oct 2021 06:16:31 +0000 (06:16 +0000)]
Auto merge of #89659 - workingjubilee:rollup-0vggc69, r=workingjubilee

Rollup of 8 pull requests

Successful merges:

 - #87918 (Enable AutoFDO.)
 - #88137 (On macOS, make strip="symbols" not pass any options to strip)
 - #88772 (Fixed confusing wording on Result::map_or_else.)
 - #89025 (Implement `#[link_ordinal(n)]`)
 - #89082 (Implement #85440 (Random test ordering))
 - #89288 (Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor)
 - #89476 (Correct decoding of foreign expansions during incr. comp.)
 - #89622 (Use correct edition for panic in [debug_]assert!().)

Failed merges:

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

2 years agoRollup merge of #89622 - m-ou-se:debug-assert-2021, r=estebank
Jubilee [Fri, 8 Oct 2021 03:26:15 +0000 (20:26 -0700)]
Rollup merge of #89622 - m-ou-se:debug-assert-2021, r=estebank

Use correct edition for panic in [debug_]assert!().

See https://github.com/rust-lang/rust/issues/88638#issuecomment-915472783

2 years agoRollup merge of #89476 - cjgillot:expn-id, r=petrochenkov
Jubilee [Fri, 8 Oct 2021 03:26:14 +0000 (20:26 -0700)]
Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkov

Correct decoding of foreign expansions during incr. comp.

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

The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.

The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.

2 years agoRollup merge of #89288 - rusticstuff:lld_wrapper, r=Mark-Simulacrum
Jubilee [Fri, 8 Oct 2021 03:26:13 +0000 (20:26 -0700)]
Rollup merge of #89288 - rusticstuff:lld_wrapper, r=Mark-Simulacrum

Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor

This PR adds an `lld-wrapper` tool which is installed as `ld` and `ld64` in `lib\rustlib\<host_target>\bin\gcc-ld` directory and whose sole purpose is to invoke `rust-lld` in the parent directory with the correct flavor. Lld decides which flavor to use from either the first two commandline arguments or from the name of the executable (`ld` for GNU/ld flavor, `ld64` for Darwin/Macos/ld64 flavor and so on). Symbolic links could not be used as they are not supported by rustup and on Windows.

The wrapper replaces full copies of rust-lld which added some significant bloat. On UNIXish operating systems it exec rust-lld, on Windows it spawns it as a child process.

Fixes #88869.

r? ```@Mark-Simulacrum```
cc ```@nagisa``` ```@petrochenkov``` ```@1000teslas```

2 years agoRollup merge of #89082 - smoelius:master, r=kennytm
Jubilee [Fri, 8 Oct 2021 03:26:12 +0000 (20:26 -0700)]
Rollup merge of #89082 - smoelius:master, r=kennytm

Implement #85440 (Random test ordering)

This PR adds `--shuffle` and `--shuffle-seed` options to `libtest`. The options are similar to the [`-shuffle` option](https://github.com/golang/go/blob/c894b442d1e5e150ad33fa3ce13dbfab1c037b3a/src/testing/testing.go#L1482-L1499) that was recently added to Go.

Here are the relevant parts of the help message:
```
        --shuffle       Run tests in random order
        --shuffle-seed SEED
                        Run tests in random order; seed the random number
                        generator with SEED
...
By default, the tests are run in alphabetical order. Use --shuffle or set
RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated
"shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the
tests in the same order again. Note that --shuffle and --shuffle-seed do not
affect whether the tests are run in parallel.
```
Is an RFC needed for this?

2 years agoRollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoerister
Jubilee [Fri, 8 Oct 2021 03:26:11 +0000 (20:26 -0700)]
Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoerister

Implement `#[link_ordinal(n)]`

Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name.  As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL.

Part of #58713.

2 years agoRollup merge of #88772 - orlp:result-map-or-else-docfix, r=yaahc
Jubilee [Fri, 8 Oct 2021 03:26:11 +0000 (20:26 -0700)]
Rollup merge of #88772 - orlp:result-map-or-else-docfix, r=yaahc

Fixed confusing wording on Result::map_or_else.

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

2 years agoRollup merge of #88137 - joshtriplett:osx-strip-symbols-no-option, r=michaelwoerister
Jubilee [Fri, 8 Oct 2021 03:26:10 +0000 (20:26 -0700)]
Rollup merge of #88137 - joshtriplett:osx-strip-symbols-no-option, r=michaelwoerister

On macOS, make strip="symbols" not pass any options to strip

This makes the output with `strip="symbols"` match the result of just
calling `strip` on the output binary, minimizing the size of the binary.

2 years agoRollup merge of #87918 - mikebenfield:pr-afdo, r=nikic
Jubilee [Fri, 8 Oct 2021 03:26:09 +0000 (20:26 -0700)]
Rollup merge of #87918 - mikebenfield:pr-afdo, r=nikic

Enable AutoFDO.

This largely involves implementing the options debug-info-for-profiling
and profile-sample-use and forwarding them on to LLVM.

AutoFDO can be used on x86-64 Linux like this:
rustc -O -Clink-arg='Wl,--no-rosegment' -Cdebug-info-for-profiling main.rs -o main
perf record -b ./main
create_llvm_prof --binary=main --out=code.prof
rustc -O -Cprofile-sample-use=code.prof main.rs -o main2

Now `main2` will have feedback directed optimization applied to it.

The create_llvm_prof tool can be obtained from this github repository:
https://github.com/google/autofdo

The option -Clink-arg='Wl,--no-rosegment' is necessary to avoid lld
putting an extra RO segment before the executable code, which would make
the binary silently incompatible with create_llvm_prof.

2 years agoAuto merge of #89646 - camelid:miri-up, r=RalfJung
bors [Fri, 8 Oct 2021 03:14:19 +0000 (03:14 +0000)]
Auto merge of #89646 - camelid:miri-up, r=RalfJung

Update Miri

Fixes #89612.

r? `@RalfJung`

2 years agoAuto merge of #89638 - rust-lang:revert-88548-intersperse, r=Mark-Simulacrum
bors [Thu, 7 Oct 2021 23:50:54 +0000 (23:50 +0000)]
Auto merge of #89638 - rust-lang:revert-88548-intersperse, r=Mark-Simulacrum

Revert "Stabilize `Iterator::intersperse()`"

Reverts rust-lang/rust#88548

First step in resolving https://github.com/rust-lang/rust/issues/88967

2 years agoOptimize File::read_to_end and read_to_string
John Kugelman [Tue, 5 Oct 2021 23:50:28 +0000 (19:50 -0400)]
Optimize File::read_to_end and read_to_string

Reading a file into an empty vector or string buffer can incur
unnecessary `read` syscalls and memory re-allocations as the buffer
"warms up" and grows to its final size. This is perhaps a necessary evil
with generic readers, but files can be read in smarter by checking the
file size and reserving that much capacity.

`std::fs::read` and `read_to_string` already perform this optimization:
they open the file, reads its metadata, and call `with_capacity` with
the file size. This ensures that the buffer does not need to be resized
and an initial string of small `read` syscalls.

However, if a user opens the `File` themselves and calls
`file.read_to_end` or `file.read_to_string` they do not get this
optimization.

```rust
let mut buf = Vec::new();
file.read_to_end(&mut buf)?;
```

I searched through this project's codebase and even here are a *lot* of
examples of this. They're found all over in unit tests, which isn't a
big deal, but there are also several real instances in the compiler and
in Cargo. I've documented the ones I found in a comment here:

https://github.com/rust-lang/rust/issues/89516#issuecomment-934423999

Most telling, the `Read` trait and the `read_to_end` method both show
this exact pattern as examples of how to use readers. What this says to
me is that this shouldn't be solved by simply fixing the instances of it
in this codebase. If it's here it's certain to be prevalent in the wider
Rust ecosystem.

To that end, this commit adds specializations of `read_to_end` and
`read_to_string` directly on `File`. This way it's no longer a minor
footgun to start with an empty buffer when reading a file in.

A nice side effect of this change is that code that accesses a `File` as
a bare `Read` constraint or via a `dyn Read` trait object will benefit.
For example, this code from `compiler/rustc_serialize/src/json.rs`:

```rust
pub fn from_reader(rdr: &mut dyn Read) -> Result<Json, BuilderError> {
    let mut contents = Vec::new();
    match rdr.read_to_end(&mut contents) {
```

Related changes:

- I also added specializations to `BufReader` to delegate to
  `self.inner`'s methods. That way it can call `File`'s optimized
  implementations if the inner reader is a file.

- The private `std::io::append_to_string` function is now marked
  `unsafe`.

- `File::read_to_string` being more efficient means that the performance
  note for `io::read_to_string` can be softened. I've added @camelid's
  suggested wording from:

  https://github.com/rust-lang/rust/issues/80218#issuecomment-936806502

2 years agoUpdate Miri
Noah Lev [Thu, 7 Oct 2021 20:47:00 +0000 (13:47 -0700)]
Update Miri

2 years agosome clippy::perf fixes
Matthias Krüger [Thu, 7 Oct 2021 20:31:33 +0000 (22:31 +0200)]
some clippy::perf fixes

2 years agoAuto merge of #89617 - flip1995:clippyup, r=Manishearth
bors [Thu, 7 Oct 2021 20:26:27 +0000 (20:26 +0000)]
Auto merge of #89617 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

2 years agomake #[target_feature] work with `asm` register classes
asquared31415 [Thu, 7 Oct 2021 19:42:18 +0000 (15:42 -0400)]
make #[target_feature] work with `asm` register classes

2 years agolol i forgot the syntax for my own crate's macros
Eliza Weisman [Thu, 7 Oct 2021 19:03:15 +0000 (12:03 -0700)]
lol i forgot the syntax for my own crate's macros

T_____T

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agocomma-related changes
Eliza Weisman [Thu, 7 Oct 2021 18:29:47 +0000 (11:29 -0700)]
comma-related changes

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agoTurn tcx.vtable_allocation() into a query.
Michael Woerister [Thu, 7 Oct 2021 09:29:01 +0000 (11:29 +0200)]
Turn tcx.vtable_allocation() into a query.

2 years agouse structured fields in some existing warnings
Eliza Weisman [Thu, 7 Oct 2021 17:48:48 +0000 (10:48 -0700)]
use structured fields in some existing warnings

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agomake them structured while i'm here
Eliza Weisman [Thu, 7 Oct 2021 17:46:47 +0000 (10:46 -0700)]
make them structured while i'm here

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agodemote `rustc_peek` traces look not user-facing
Eliza Weisman [Thu, 7 Oct 2021 17:45:39 +0000 (10:45 -0700)]
demote `rustc_peek` traces look not user-facing

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2 years agoRevert "Stabilize `Iterator::intersperse()`"
Jane Lusby [Thu, 7 Oct 2021 17:39:36 +0000 (10:39 -0700)]
Revert "Stabilize `Iterator::intersperse()`"

2 years agoAuto merge of #89629 - GuillaumeGomez:rollup-s4r8me6, r=GuillaumeGomez
bors [Thu, 7 Oct 2021 17:17:25 +0000 (17:17 +0000)]
Auto merge of #89629 - GuillaumeGomez:rollup-s4r8me6, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #89298 (Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers )
 - #89461 (Add `deref_into_dyn_supertrait` lint.)
 - #89477 (Move items related to computing diffs to a separate file)
 - #89559 (RustWrapper: adapt for LLVM API change)
 - #89585 (Emit item no type error even if type inference fails)
 - #89596 (Make cfg imply doc(cfg))
 - #89615 (Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts)

Failed merges:

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

2 years agoUpdate compiler/rustc_driver/src/lib.rs
Eliza Weisman [Thu, 7 Oct 2021 16:52:51 +0000 (09:52 -0700)]
Update compiler/rustc_driver/src/lib.rs

Co-authored-by: Joshua Nelson <github@jyn.dev>
2 years agorustc_driver: Enable the `WARN` log level by default
Eliza Weisman [Thu, 7 Oct 2021 16:17:57 +0000 (09:17 -0700)]
rustc_driver: Enable the `WARN` log level by default

This commit changes the `tracing_subscriber` initialization in
`rustc_driver` so that the `WARN` verbosity level is enabled by default
when the `RUSTC_LOG` env variable is empty. If the `RUSTC_LOG` env
variable is set, the filter string in the environment variable is
honored, instead.

Fixes #76824
Closes #89623

cc @eddyb, @oli-obk

2 years agoAdd wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor
Hans Kratz [Sat, 25 Sep 2021 13:25:08 +0000 (15:25 +0200)]
Add wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor

The wrapper is installed as `ld` and `ld64` in the `lib\rustlib\<host_target>\bin\gcc-ld`
directory and its sole purpose is to invoke `rust-lld` in the parent directory with
the correct flavor.

2 years agoRollup merge of #89615 - willcrichton:fix-get-body-with-borrowck-facts, r=oli-obk
Guillaume Gomez [Thu, 7 Oct 2021 14:24:54 +0000 (16:24 +0200)]
Rollup merge of #89615 - willcrichton:fix-get-body-with-borrowck-facts, r=oli-obk

Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts

`mir_borrowck` uses `with_opaque_type_inference` before calling `do_mir_borrowck`: https://github.com/rust-lang/rust/blob/0eabf25b90396dead0b2a1aaa275af18a1ae6008/compiler/rustc_borrowck/src/lib.rs#L132

However `get_body_with_borrowck_facts` does not. Therefore I get an ICE eg when calling this function on the bodies of an async function as described here: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20ICE.20when.20using.20get_body_with_borrowck_facts.20with.20async

This change fixes that bug.

r? `@nikomatsakis`

2 years agoRollup merge of #89596 - GuillaumeGomez:implicit-doc-cfg, r=jyn514
Guillaume Gomez [Thu, 7 Oct 2021 14:24:53 +0000 (16:24 +0200)]
Rollup merge of #89596 - GuillaumeGomez:implicit-doc-cfg, r=jyn514

Make cfg imply doc(cfg)

This is a reopening of #79341, rebased and modified a bit (we made a lot of refactoring in rustdoc's types so they needed to be reflected in this PR as well):

 * `hidden_cfg` is now in the `Cache` instead of `DocContext` because `cfg` information isn't stored anymore on `clean::Attributes` type but instead computed on-demand, so we need this information in later parts of rustdoc.
 * I removed the `bool_to_options` feature (which makes the code a bit simpler to read for `SingleExt` trait implementation.
 * I updated the version for the feature.

There is only one thing I couldn't figure out: [this comment](https://github.com/rust-lang/rust/pull/79341#discussion_r561855624)

> I think I'll likely scrap the whole `SingleExt` extension trait as the diagnostics for 0 and >1 items should be different.

How/why should they differ?

EDIT: this part has been solved, the current code was fine, just needed a little simplification.

cc `@Nemo157`
r? `@jyn514`

Original PR description:

This is only active when the `doc_cfg` feature is active.

The implicit cfg can be overridden via `#[doc(cfg(...))]`, so e.g. to hide a `#[cfg]` you can use something like:

```rust
#[cfg(unix)]
#[doc(cfg(all()))]
pub struct Unix;
```

By adding `#![doc(cfg_hide(foobar))]` to the crate attributes the cfg `#[cfg(foobar)]` (and _only_ that _exact_ cfg) will not be implicitly treated as a `doc(cfg)` to render a message in the documentation.

2 years agoRollup merge of #89585 - nbdd0121:issue-89574, r=estebank
Guillaume Gomez [Thu, 7 Oct 2021 14:24:52 +0000 (16:24 +0200)]
Rollup merge of #89585 - nbdd0121:issue-89574, r=estebank

Emit item no type error even if type inference fails

Fix #89574

The stashed error should be emitted regardless whether ty references error or not.

2 years agoRollup merge of #89559 - krasimirgg:llvm-14-fatal_error_handler_t, r=nagisa
Guillaume Gomez [Thu, 7 Oct 2021 14:24:51 +0000 (16:24 +0200)]
Rollup merge of #89559 - krasimirgg:llvm-14-fatal_error_handler_t, r=nagisa

RustWrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit
https://github.com/llvm/llvm-project/commit/e463b69736da8b0a950ecd937cf990401bdfcdeb
changed an argument of fatal_error_handler_t from std::string to char*.
This adapts RustWrapper accordingly.

2 years agoRollup merge of #89477 - Nicholas-Baron:compute_diff_rs, r=Mark-Simulacrum
Guillaume Gomez [Thu, 7 Oct 2021 14:24:50 +0000 (16:24 +0200)]
Rollup merge of #89477 - Nicholas-Baron:compute_diff_rs, r=Mark-Simulacrum

Move items related to computing diffs to a separate file

Work towards #89475.

2 years agoRollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakis
Guillaume Gomez [Thu, 7 Oct 2021 14:24:49 +0000 (16:24 +0200)]
Rollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakis

Add `deref_into_dyn_supertrait` lint.

Initial implementation of #89460. Resolves #89190.
Maybe also worth a beta backport if necessary.

r? `@nikomatsakis`

2 years agoRollup merge of #89298 - gcohara:issue89193, r=workingjubilee
Guillaume Gomez [Thu, 7 Oct 2021 14:24:48 +0000 (16:24 +0200)]
Rollup merge of #89298 - gcohara:issue89193, r=workingjubilee

Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers

closes #89193
r? `@workingjubilee`

2 years agoAuto merge of #89534 - camsteffen:diag-name, r=oli-obk
bors [Thu, 7 Oct 2021 14:22:16 +0000 (14:22 +0000)]
Auto merge of #89534 - camsteffen:diag-name, r=oli-obk

Introduce `tcx.get_diagnostic_name`

Introduces a "reverse lookup" for diagnostic items. This is mainly intended for `@rust-lang/clippy` which often does a long series of `is_diagnostic_item` calls for the same `DefId`.

r? `@oli-obk`

2 years agoAdd tests for panic and [debug_]assert in Rust 2021.
Mara Bos [Thu, 7 Oct 2021 10:45:01 +0000 (12:45 +0200)]
Add tests for panic and [debug_]assert in Rust 2021.

2 years agoUse correct edition for panic in [debug_]assert!() etc.
Mara Bos [Thu, 7 Oct 2021 10:44:46 +0000 (12:44 +0200)]
Use correct edition for panic in [debug_]assert!() etc.

2 years agoAuto merge of #86525 - shamatar:array_len_opt, r=oli-obk
bors [Thu, 7 Oct 2021 11:34:40 +0000 (11:34 +0000)]
Auto merge of #86525 - shamatar:array_len_opt, r=oli-obk

Array `.len()` MIR optimization pass

This pass kind-of works back the `[T; N].len()` call that at the moment is first coerced as `&[T; N]` -> `&[T]` and then uses `&[T].len()`. Depends on #86383

2 years agoRemove untracked vtable-const-allocation cache from tcx
Michael Woerister [Wed, 6 Oct 2021 15:43:13 +0000 (17:43 +0200)]
Remove untracked vtable-const-allocation cache from tcx

2 years agoMerge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
flip1995 [Thu, 7 Oct 2021 09:21:30 +0000 (11:21 +0200)]
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup

2 years agoAuto merge of #7783 - flip1995:rustup, r=flip1995
bors [Thu, 7 Oct 2021 09:18:25 +0000 (09:18 +0000)]
Auto merge of #7783 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

Finally an easy, conflict free rustup again :tada:

changelog: none

2 years agoBump nightly version -> 2021-10-07
flip1995 [Thu, 7 Oct 2021 09:12:27 +0000 (11:12 +0200)]
Bump nightly version -> 2021-10-07

2 years agoAllow invalid-paths for regex paths
flip1995 [Thu, 7 Oct 2021 09:12:02 +0000 (11:12 +0200)]
Allow invalid-paths for regex paths

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 7 Oct 2021 09:11:23 +0000 (11:11 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #89495 - Mark-Simulacrum:add-inlines, r=michaelwoerister
bors [Thu, 7 Oct 2021 06:23:23 +0000 (06:23 +0000)]
Auto merge of #89495 - Mark-Simulacrum:add-inlines, r=michaelwoerister

Add two inline annotations for hot functions

These two functions are essentially no-ops (and compile to just a load and
return), but show up in process_obligations profiles with a high call count --
so worthwhile to try and inline them. This is not normally possible as they're
non-generic, so they don't get offered for inlining by our current algorithm.

2 years agoAuto merge of #7780 - mikerite:update_lints_mod_revert, r=llogiq
bors [Thu, 7 Oct 2021 05:00:53 +0000 (05:00 +0000)]
Auto merge of #7780 - mikerite:update_lints_mod_revert, r=llogiq

Revert `update_lints` module list generating code

This commit reverts the module list generation code to what it was
before the change to `include!` it and generates better output.

changelog: none

2 years agoRevert `update_lints` module list generating code
Michael Wright [Thu, 7 Oct 2021 04:37:56 +0000 (06:37 +0200)]
Revert `update_lints` module list generating code

This commit reverts the module list generation code to what it was
before the change to `include!` it and generates better output.

2 years agoAuto merge of #89454 - erikdesjardins:perfattrcheck, r=nikomatsakis
bors [Thu, 7 Oct 2021 03:42:05 +0000 (03:42 +0000)]
Auto merge of #89454 - erikdesjardins:perfattrcheck, r=nikomatsakis

perf: only check for `rustc_trivial_field_reads` attribute on traits, not items, impls, etc.

The checks that are removed in this PR (originally added in #85200) caused a small perf regression: https://github.com/rust-lang/rust/pull/88824#issuecomment-932664761

Since the attribute is currently only applied to traits, I don't think it's worth keeping the additional checks for now.
If/when we decide to apply the attribute somewhere else, we can (partially) revert this and reevaluate the perf impact.

r? `@nikomatsakis` cc `@FabianWolff`

2 years agoQuery the fingerprint style during key reconstruction
Mark Rousskov [Sat, 2 Oct 2021 16:06:42 +0000 (12:06 -0400)]
Query the fingerprint style during key reconstruction

Keys can be reconstructed from fingerprints that are not DefPathHash, but then
we cannot extract a DefId from them.

2 years agoAdd InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts
Will Crichton [Thu, 7 Oct 2021 02:07:56 +0000 (19:07 -0700)]
Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts

2 years agoAuto merge of #89608 - Manishearth:rollup-m7kd76f, r=Manishearth
bors [Wed, 6 Oct 2021 20:17:28 +0000 (20:17 +0000)]
Auto merge of #89608 - Manishearth:rollup-m7kd76f, r=Manishearth

Rollup of 12 pull requests

Successful merges:

 - #87601 (Add functions to add unsigned and signed integers)
 - #88523 (Expand documentation for `FpCategory`.)
 - #89050 (refactor: VecDeques Drain fields to private)
 - #89245 (refactor: make VecDeque's IterMut fields module-private, not just crate-private)
 - #89324 (Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism`)
 - #89329 (print-type-sizes: skip field printing for primitives)
 - #89501 (Note specific regions involved in 'borrowed data escapes' error)
 - #89506 (librustdoc: Use correct heading levels.)
 - #89528 (Fix suggestion to borrow when casting from pointer to reference)
 - #89531 (library std, libc dependency update)
 - #89588 (Add a test for generic_const_exprs)
 - #89591 (fix: alloc-optimisation is only for rust llvm)

Failed merges:

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

2 years agoEnable AutoFDO.
Michael Benfield [Fri, 7 May 2021 07:41:37 +0000 (07:41 +0000)]
Enable AutoFDO.

This largely involves implementing the options debug-info-for-profiling
and profile-sample-use and forwarding them on to LLVM.

AutoFDO can be used on x86-64 Linux like this:
rustc -O -Cdebug-info-for-profiling main.rs -o main
perf record -b ./main
create_llvm_prof --binary=main --out=code.prof
rustc -O -Cprofile-sample-use=code.prof main.rs -o main2

Now `main2` will have feedback directed optimization applied to it.

The create_llvm_prof tool can be obtained from this github repository:
https://github.com/google/autofdo

Fixes #64892.

2 years agoRollup merge of #89591 - infinity0:master, r=Amanieu
Manish Goregaokar [Wed, 6 Oct 2021 19:33:24 +0000 (12:33 -0700)]
Rollup merge of #89591 - infinity0:master, r=Amanieu

fix: alloc-optimisation is only for rust llvm

As discussed at the bottom of #83485.

On a separate note I'll take this chance ask, is it worth pulling in that patch (to recognise `__rust_dealloc`) into Debian's system LLVM? The main factors for us to consider would be (1) is the optimisation significant and (2) is there not any significant negative impact to non-rust packages that use LLVM.

2 years agoRollup merge of #89588 - BoxyUwU:add_a_test_uwu, r=lcnr
Manish Goregaokar [Wed, 6 Oct 2021 19:33:23 +0000 (12:33 -0700)]
Rollup merge of #89588 - BoxyUwU:add_a_test_uwu, r=lcnr

Add a test for generic_const_exprs

Test that const_eval_resolve evaluates consts with unused inference vars in substs

r? ``@lcnr``

2 years agoRollup merge of #89531 - devnexen:stack_overflow_bsd_libc_upd, r=dtolnay
Manish Goregaokar [Wed, 6 Oct 2021 19:33:22 +0000 (12:33 -0700)]
Rollup merge of #89531 - devnexen:stack_overflow_bsd_libc_upd, r=dtolnay

library std, libc dependency update

to solve #87528 build.

2 years agoRollup merge of #89528 - FabianWolff:issue-89497, r=jackh726
Manish Goregaokar [Wed, 6 Oct 2021 19:33:21 +0000 (12:33 -0700)]
Rollup merge of #89528 - FabianWolff:issue-89497, r=jackh726

Fix suggestion to borrow when casting from pointer to reference

Fixes #89497.

2 years agoRollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomez
Manish Goregaokar [Wed, 6 Oct 2021 19:33:20 +0000 (12:33 -0700)]
Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomez

librustdoc: Use correct heading levels.

Closes #89309

This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy.

- I ran a script to manually check that we don't have any files with multiple `<h1>` tags.
- Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`.
- I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).

2 years agoRollup merge of #89501 - Aaron1011:escaping-name-regions, r=davidtwco
Manish Goregaokar [Wed, 6 Oct 2021 19:33:19 +0000 (12:33 -0700)]
Rollup merge of #89501 - Aaron1011:escaping-name-regions, r=davidtwco

Note specific regions involved in 'borrowed data escapes' error

Fixes #67007

Currently, a 'borrowed data escapes' error does not mention
the specific lifetime involved (except indirectly through a suggestion
about adding a lifetime bound). We now explain the specific lifetime
relationship that failed to hold, which improves otherwise vague
error messages.

2 years agoRollup merge of #89329 - tmiasko:print-type-sizes-no-fields, r=jackh726
Manish Goregaokar [Wed, 6 Oct 2021 19:33:18 +0000 (12:33 -0700)]
Rollup merge of #89329 - tmiasko:print-type-sizes-no-fields, r=jackh726

print-type-sizes: skip field printing for primitives

Fixes #86528.