]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoupdate Miri
Ralf Jung [Sun, 28 Feb 2021 11:07:53 +0000 (12:07 +0100)]
update Miri

3 years agoAuto merge of #81874 - tesuji:spec_slice_fill, r=matthewjasper
bors [Sat, 27 Feb 2021 14:54:31 +0000 (14:54 +0000)]
Auto merge of #81874 - tesuji:spec_slice_fill, r=matthewjasper

Specialize slice::fill with Copy type and u8/i8/bool

I don't expect rustperf could measure any perf improvements with this changes
since `slice::fill` is newly added.

Godbolt link for this change: <https://rust.godbolt.org/z/r3fzee>.

r? `@matthewjasper` since this patch added new specialization.

3 years agoAuto merge of #82448 - Aaron1011:merge-hastokens-hasattrs, r=petrochenkov
bors [Sat, 27 Feb 2021 07:52:11 +0000 (07:52 +0000)]
Auto merge of #82448 - Aaron1011:merge-hastokens-hasattrs, r=petrochenkov

Combine HasAttrs and HasTokens into AstLike

When token-based attribute handling is implemeneted in #80689,
we will need to access tokens from `HasAttrs` (to perform
cfg-stripping), and we will to access attributes from `HasTokens` (to
construct a `PreexpTokenStream`).

This PR merges the `HasAttrs` and `HasTokens` traits into a new
`AstLike` trait. The previous `HasAttrs` impls from `Vec<Attribute>` and `AttrVec`
are removed - they aren't attribute targets, so the impls never really
made sense.

3 years agoCombine HasAttrs and HasTokens into AstLike
Aaron Hill [Tue, 23 Feb 2021 15:21:20 +0000 (10:21 -0500)]
Combine HasAttrs and HasTokens into AstLike

When token-based attribute handling is implemeneted in #80689,
we will need to access tokens from `HasAttrs` (to perform
cfg-stripping), and we will to access attributes from `HasTokens` (to
construct a `PreexpTokenStream`).

This PR merges the `HasAttrs` and `HasTokens` traits into a new
`AstLike` trait. The previous `HasAttrs` impls from `Vec<Attribute>` and `AttrVec`
are removed - they aren't attribute targets, so the impls never really
made sense.

3 years agoAuto merge of #82511 - jsha:fix-bfcache2, r=GuillaumeGomez
bors [Sat, 27 Feb 2021 05:06:05 +0000 (05:06 +0000)]
Auto merge of #82511 - jsha:fix-bfcache2, r=GuillaumeGomez

Fix back-forward cache in rustdoc frontend

Rustdoc's frontend set a no-op unload handler, specifically to disable
Firefox's back-forward cache because it caused a bug. It's nice to
allow the back-forward cache because it permits faster navigations.

This change addresses the issues that were caused by back-forward cache.

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching
https://web.dev/bfcache/

Demo: https://jacob.hoffman-andrews.com/rust/fix-bfcache/std/string/struct.String.html

Related: #72272

3 years agoAuto merge of #82577 - Dylan-DPC:rollup-c3si8ju, r=Dylan-DPC
bors [Sat, 27 Feb 2021 02:18:11 +0000 (02:18 +0000)]
Auto merge of #82577 - Dylan-DPC:rollup-c3si8ju, r=Dylan-DPC

Rollup of 14 pull requests

Successful merges:

 - #81794 (update tracking issue for `relaxed_struct_unsize`)
 - #82057 (Replace const_cstr with cstr crate)
 - #82370 (Improve anonymous lifetime note to indicate the target span)
 - #82394 (:arrow_up: rust-analyzer)
 - #82396 (Add Future trait for doc_spotlight feature doc)
 - #82404 (Test hexagon-enum only when llvm target is present)
 - #82419 (expand: Preserve order of inert attributes during expansion)
 - #82420 (Enable API documentation for `std::os::wasi`.)
 - #82421 (Add a `size()` function to WASI's `MetadataExt`.)
 - #82442 (Skip emitting closure diagnostic when closure_kind_origins has no entry)
 - #82473 (Use libc::accept4 on Android instead of raw syscall.)
 - #82482 (Use small hash set in `mir_inliner_callees`)
 - #82490 (Update cargo)
 - #82494 (Substitute erased lifetimes on bad placeholder type)

Failed merges:

 - #82448 (Combine HasAttrs and HasTokens into AstLike)

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

3 years agoRollup merge of #82494 - estebank:issue-82455, r=petrochenkov
Dylan DPC [Sat, 27 Feb 2021 01:34:35 +0000 (02:34 +0100)]
Rollup merge of #82494 - estebank:issue-82455, r=petrochenkov

Substitute erased lifetimes on bad placeholder type

Fix #82455.

3 years agoRollup merge of #82490 - ehuss:update-cargo, r=ehuss
Dylan DPC [Sat, 27 Feb 2021 01:34:33 +0000 (02:34 +0100)]
Rollup merge of #82490 - ehuss:update-cargo, r=ehuss

Update cargo

11 commits in bf5a5d5e5d3ae842a63bfce6d070dfd438cf6070..572e201536dc2e4920346e28037b63c0f4d88b3c
2021-02-18 15:49:14 +0000 to 2021-02-24 16:51:20 +0000
- Pass the error message format to rustdoc (rust-lang/cargo#9128)
- Fix test target_in_environment_contains_lower_case (rust-lang/cargo#9203)
- Fix hang on broken stderr. (rust-lang/cargo#9201)
- Make it more clear which module is being tested when running cargo test (rust-lang/cargo#9195)
- Updates to edition handling. (rust-lang/cargo#9184)
- Add --cfg and --rustc-cfg flags to output compiler configuration (rust-lang/cargo#9002)
- Run rustdoc doctests relative to the workspace (rust-lang/cargo#9105)
- Add support for [env] section in .cargo/config.toml (rust-lang/cargo#9175)
- Add schema field and `features2` to the index. (rust-lang/cargo#9161)
- Document the default location where cargo install emitting build artifacts (rust-lang/cargo#9189)
- Do not exit prematurely if anything failed installing. (rust-lang/cargo#9185)

3 years agoRollup merge of #82482 - tmiasko:small-cycles, r=varkor
Dylan DPC [Sat, 27 Feb 2021 01:34:32 +0000 (02:34 +0100)]
Rollup merge of #82482 - tmiasko:small-cycles, r=varkor

Use small hash set in `mir_inliner_callees`

Use small hash set in `mir_inliner_callees` to avoid temporary
allocation when possible and quadratic behaviour for large number of
callees.

3 years agoRollup merge of #82473 - de-vri-es:android-x86-accept4, r=m-ou-se
Dylan DPC [Sat, 27 Feb 2021 01:34:31 +0000 (02:34 +0100)]
Rollup merge of #82473 - de-vri-es:android-x86-accept4, r=m-ou-se

Use libc::accept4 on Android instead of raw syscall.

This PR replaces the use of a raw `accept4` syscall with `libc::accept4`. This was originally added (by me) because `std` couldn't update to the latest `libc` with `accept4` support for android. By now, libc is already on 0.2.85, so the workaround can be removed.

`@rustbot` label +O-android +T-libs-impl

3 years agoRollup merge of #82442 - Aaron1011:fix/closure-mut-crash, r=matthewjasper
Dylan DPC [Sat, 27 Feb 2021 01:34:30 +0000 (02:34 +0100)]
Rollup merge of #82442 - Aaron1011:fix/closure-mut-crash, r=matthewjasper

Skip emitting closure diagnostic when closure_kind_origins has no entry

Fixes #82438

This map is not guarnateed to have an entry for a closure.

3 years agoRollup merge of #82421 - sunfishcode:wasi-metadata-size, r=alexcrichton
Dylan DPC [Sat, 27 Feb 2021 01:34:28 +0000 (02:34 +0100)]
Rollup merge of #82421 - sunfishcode:wasi-metadata-size, r=alexcrichton

Add a `size()` function to WASI's `MetadataExt`.

WASI's `filestat` type includes a size field, so expose it in
`MetadataExt` via a `size()` function, similar to the corresponding Unix
function.

r? ``````@alexcrichton``````

3 years agoRollup merge of #82420 - sunfishcode:wasi-docs, r=alexcrichton
Dylan DPC [Sat, 27 Feb 2021 01:34:27 +0000 (02:34 +0100)]
Rollup merge of #82420 - sunfishcode:wasi-docs, r=alexcrichton

Enable API documentation for `std::os::wasi`.

This adds API documentation support for `std::os::wasi` modeled after
how `std::os::unix` works, so that WASI can be documented [here] along
with the other platforms.

[here]: https://doc.rust-lang.org/stable/std/os/index.html

Two changes of particular interest:

 - This changes the `AsRawFd` for `io::Stdin` for WASI to return
   `libc::STDIN_FILENO` instead of `sys::stdio::Stdin.as_raw_fd()` (and
   similar for `Stdout` and `Stderr`), which matches how the `unix`
   version works. `STDIN_FILENO` etc. may not always be explicitly
   reserved at the WASI level, but as long as we have Rust's `std` and
   `libc`, I think it's reasonable to guarantee that we'll always use
   `libc::STDIN_FILENO` for stdin.

 - This duplicates the `osstr2str` utility function, rather than
   trying to share it across all the configurations that need it.

r? ```@alexcrichton```

3 years agoRollup merge of #82419 - petrochenkov:inertord, r=Aaron1011
Dylan DPC [Sat, 27 Feb 2021 01:34:26 +0000 (02:34 +0100)]
Rollup merge of #82419 - petrochenkov:inertord, r=Aaron1011

expand: Preserve order of inert attributes during expansion

Fixes https://github.com/rust-lang/rust/issues/67839
Fixes https://github.com/rust-lang/rust/issues/81871
r? `````@Aaron1011`````

3 years agoRollup merge of #82404 - nagisa:nagisa/hexagon-enums-llvm-comps, r=petrochenkov
Dylan DPC [Sat, 27 Feb 2021 01:34:25 +0000 (02:34 +0100)]
Rollup merge of #82404 - nagisa:nagisa/hexagon-enums-llvm-comps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See https://github.com/rust-lang/rust/pull/82379#issuecomment-783439754

r? ``````@petrochenkov``````

``````@bors`````` rollup

3 years agoRollup merge of #82396 - pickfire:patch-5, r=GuillaumeGomez
Dylan DPC [Sat, 27 Feb 2021 01:34:24 +0000 (02:34 +0100)]
Rollup merge of #82396 - pickfire:patch-5, r=GuillaumeGomez

Add Future trait for doc_spotlight feature doc

3 years agoRollup merge of #82394 - lnicola:rust-analyzer-2021-02-22, r=jonas-schievink
Dylan DPC [Sat, 27 Feb 2021 01:34:23 +0000 (02:34 +0100)]
Rollup merge of #82394 - lnicola:rust-analyzer-2021-02-22, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #82370 - 0yoyoyo:update-issue-81650-point-anonymous-lifetime, r=estebank
Dylan DPC [Sat, 27 Feb 2021 01:34:22 +0000 (02:34 +0100)]
Rollup merge of #82370 - 0yoyoyo:update-issue-81650-point-anonymous-lifetime, r=estebank

Improve anonymous lifetime note to indicate the target span

Improvement for  #81650
Cc #81995

Message after this improvement:
(Improve note in the middle)

```
error[E0311]: the parameter type `T` may not live long enough
  --> src/main.rs:25:11
   |
24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
   |              -- help: consider adding an explicit lifetime bound...: `T: 'a +`
25 |     scope.spawn(move |_| {
   |           ^^^^^
   |
note: the parameter type `T` must be valid for the anonymous lifetime defined on the function body at 24:40...
  --> src/main.rs:24:40
   |
24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
   |                                        ^^^^^
note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds
  --> src/main.rs:25:11
   |
25 |     scope.spawn(move |_| {
   |           ^^^^^
```

r? ``````@estebank``````

3 years agoRollup merge of #82057 - upsuper-forks:cstr, r=davidtwco,wesleywiser
Dylan DPC [Sat, 27 Feb 2021 01:34:21 +0000 (02:34 +0100)]
Rollup merge of #82057 - upsuper-forks:cstr, r=davidtwco,wesleywiser

Replace const_cstr with cstr crate

This PR replaces the `const_cstr` macro inside `rustc_data_structures` with `cstr` macro from [cstr](https://crates.io/crates/cstr) crate.

The two macros basically serve the same purpose, which is to generate `&'static CStr` from a string literal. `cstr` is better because it validates the literal at compile time, while the existing `const_cstr` does it at runtime when `debug_assertions` is enabled. In addition, the value `cstr` generates can be used in constant context (which is seemingly not needed anywhere currently, though).

3 years agoRollup merge of #81794 - lcnr:relaxed_adt_unsize-tracking-issue, r=camelid
Dylan DPC [Sat, 27 Feb 2021 01:34:20 +0000 (02:34 +0100)]
Rollup merge of #81794 - lcnr:relaxed_adt_unsize-tracking-issue, r=camelid

update tracking issue for `relaxed_struct_unsize`

forgot to do this before #80726 got merged. The tracking issue is #81793

3 years agoAuto merge of #82559 - tmiasko:inlined, r=petrochenkov
bors [Fri, 26 Feb 2021 21:58:58 +0000 (21:58 +0000)]
Auto merge of #82559 - tmiasko:inlined, r=petrochenkov

Miscellaneous inlining improvements

Inline a few small and hot functions.

3 years agoAuto merge of #82552 - GuillaumeGomez:rollup-8dn1ztn, r=GuillaumeGomez
bors [Fri, 26 Feb 2021 19:17:00 +0000 (19:17 +0000)]
Auto merge of #82552 - GuillaumeGomez:rollup-8dn1ztn, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #81940 (Stabilize str_split_once)
 - #82165 (Reword labels on E0308 involving async fn return type)
 - #82456 (Replaced some unwrap_or and map_or with lazy variants)
 - #82491 (Consider inexpensive inlining criteria first)
 - #82506 (Properly account for non-shorthand pattern field in unused variable lint)
 - #82535 (Set codegen thread names)
 - #82545 (rustdoc: add optional woff2 versions of FiraSans.)
 - #82549 (Revert "Update normalize.css to 8.0.1")

Failed merges:

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

3 years agoAdd for example word to spotlight doc
Ivan Tham [Fri, 26 Feb 2021 17:29:56 +0000 (01:29 +0800)]
Add for example word to spotlight doc

As suggested by GuillaumeGomez

3 years agoRollup merge of #82549 - rust-lang:revert-82313-update-normalize-css, r=apiraino
Guillaume Gomez [Fri, 26 Feb 2021 14:52:37 +0000 (15:52 +0100)]
Rollup merge of #82549 - rust-lang:revert-82313-update-normalize-css, r=apiraino

Revert "Update normalize.css to 8.0.1"

Reverts rust-lang/rust#82313

Fixes #82548
Fixes #82542

``@jsha:`` I'm reverting until we can come up with a new version which is fully working.

r? ``@jyn514``

3 years agoRollup merge of #82545 - jsha:woff2, r=GuillaumeGomez
Guillaume Gomez [Fri, 26 Feb 2021 14:52:36 +0000 (15:52 +0100)]
Rollup merge of #82545 - jsha:woff2, r=GuillaumeGomez

rustdoc: add optional woff2 versions of FiraSans.

For browsers that support woff2 (most modern ones:
https://caniuse.com/woff2), this offers a reduction in download size
for these two fonts from 362k to 257k (32% reduction). It decreases the
total page size for `struct.String.html` (counting all subresources) by
about 2.5%.

If this is interesting, I'm happy to apply the same treatment to the
other fonts, but these two are the biggest.

3 years agoRollup merge of #82535 - wesleywiser:wip_codegen_thread_names, r=nagisa
Guillaume Gomez [Fri, 26 Feb 2021 14:52:35 +0000 (15:52 +0100)]
Rollup merge of #82535 - wesleywiser:wip_codegen_thread_names, r=nagisa

Set codegen thread names

Set names on threads spawned during codegen. Various debugging and profiling tools can take advantage of this to show a more useful identifier for threads.

For example, gdb will show thread names in `info threads`:

```
(gdb) info threads
  Id   Target Id                                          Frame
  1    Thread 0x7fffefa7ec40 (LWP 2905) "rustc"           __pthread_clockjoin_ex (threadid=140737214134016, thread_return=0x0, clockid=<optimized out>, abstime=<optimized out>, block=<optimized out>)
    at pthread_join_common.c:145
  2    Thread 0x7fffefa7b700 (LWP 2957) "rustc"           0x00007ffff125eaa8 in llvm::X86_MC::initLLVMToSEHAndCVRegMapping(llvm::MCRegisterInfo*) ()
   from /home/wesley/.rustup/toolchains/stage1/lib/librustc_driver-f866439e29074957.so
  3    Thread 0x7fffeef0f700 (LWP 3116) "rustc"           futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffe8602ac8) at ../sysdeps/nptl/futex-internal.h:183
* 4    Thread 0x7fffeed0e700 (LWP 3123) "rustc"           rustc_codegen_ssa::back::write::spawn_work (cgcx=..., work=...) at /home/wesley/code/rust/rust/compiler/rustc_codegen_ssa/src/back/write.rs:1573
  6    Thread 0x7fffe113b700 (LWP 3150) "opt foof.7rcbfp" 0x00007ffff2940e62 in llvm::CallGraph::populateCallGraphNode(llvm::CallGraphNode*) ()
   from /home/wesley/.rustup/toolchains/stage1/lib/librustc_driver-f866439e29074957.so
  8    Thread 0x7fffe0d39700 (LWP 3158) "opt foof.7rcbfp" 0x00007fffefe8998e in malloc_consolidate (av=av@entry=0x7ffe2c000020) at malloc.c:4492
  9    Thread 0x7fffe0f3a700 (LWP 3162) "opt foof.7rcbfp" 0x00007fffefef27c4 in __libc_open64 (file=0x7fffe0f38608 "foof.foof.7rcbfp3g-cgu.6.rcgu.o", oflag=524865) at ../sysdeps/unix/sysv/linux/open64.c:48
(gdb)
```

and Windows Performance Analyzer will also show this information when profiling:

![image](https://user-images.githubusercontent.com/831192/109231017-d311f780-7793-11eb-8072-ab836a830e90.png)

3 years agoRollup merge of #82506 - estebank:unused_variable_lint, r=lcnr
Guillaume Gomez [Fri, 26 Feb 2021 14:52:33 +0000 (15:52 +0100)]
Rollup merge of #82506 - estebank:unused_variable_lint, r=lcnr

Properly account for non-shorthand pattern field in unused variable lint

Fix #82488

3 years agoRollup merge of #82491 - tmiasko:i, r=lcnr
Guillaume Gomez [Fri, 26 Feb 2021 14:52:32 +0000 (15:52 +0100)]
Rollup merge of #82491 - tmiasko:i, r=lcnr

Consider inexpensive inlining criteria first

Refactor inlining decisions so that inexpensive criteria are considered first:

1. Based on code generation attributes.
2. Based on MIR availability (examines call graph).
3. Based on MIR body.

3 years agoRollup merge of #82456 - klensy:or-else, r=estebank
Guillaume Gomez [Fri, 26 Feb 2021 14:52:31 +0000 (15:52 +0100)]
Rollup merge of #82456 - klensy:or-else, r=estebank

Replaced some unwrap_or and map_or with lazy variants

Replaced some `unwrap_or` and `map_or` with `unwrap_or_else` and `map_or_else`.

3 years agoRollup merge of #82165 - nellshamrell:nell/fix-80658-B, r=estebank
Guillaume Gomez [Fri, 26 Feb 2021 14:52:30 +0000 (15:52 +0100)]
Rollup merge of #82165 - nellshamrell:nell/fix-80658-B, r=estebank

Reword labels on E0308 involving async fn return type

Fix for #80658.

When someone writes code like this:

```rust
fn foo() -> u8 {
    async fn async_fn() -> () {}

    async_fn()
}
```

And they try to compile it, they will see an error that looks like this:

```bash
error[E0308]: mismatched types
 --> test.rs:4:5
  |
1 | fn foo() -> u8 {
  |             -- expected `u8` because of return type
2 |     async fn async_fn() -> () {}
  |                            -- checked the `Output` of this `async fn`, found opaque type
3 |
4 |     async_fn()
  |     ^^^^^^^^^^ expected `u8`, found opaque type
  |
  = note: while checking the return type of this `async fn`
  = note:     expected type `u8`
          found opaque type `impl Future`
```

3 years agoRollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-se
Guillaume Gomez [Fri, 26 Feb 2021 14:52:29 +0000 (15:52 +0100)]
Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-se

Stabilize str_split_once

Closes #74773

3 years agoRevert "Update normalize.css to 8.0.1"
Guillaume Gomez [Fri, 26 Feb 2021 13:59:24 +0000 (14:59 +0100)]
Revert "Update normalize.css to 8.0.1"

3 years agoAuto merge of #81458 - estebank:match-stmt-remove-semi, r=oli-obk
bors [Fri, 26 Feb 2021 12:03:38 +0000 (12:03 +0000)]
Auto merge of #81458 - estebank:match-stmt-remove-semi, r=oli-obk

Detect match statement intended to be tail expression

CC #24157

3 years agoEmbed woff2 files in rustdoc binary.
Jacob Hoffman-Andrews [Fri, 26 Feb 2021 08:38:05 +0000 (00:38 -0800)]
Embed woff2 files in rustdoc binary.

3 years agoAdd optional woff2 versions of FiraSans.
Jacob Hoffman-Andrews [Fri, 26 Feb 2021 08:02:11 +0000 (00:02 -0800)]
Add optional woff2 versions of FiraSans.

For browsers that support woff2 (most modern ones:
https://caniuse.com/woff2), this offers a reduction in download size
for these two fonts from 362k to 257k (32% reduction). It decreases the
total page size for `struct.String.html` (counting all subresources) by
about 2.5%.

If this is interesting, I'm happy to apply the same treatment to the
other fonts, but these two are the biggest.

3 years agoupdate tracking issue for `relaxed_struct_unsize`
lcnr [Fri, 26 Feb 2021 07:32:38 +0000 (08:32 +0100)]
update tracking issue for `relaxed_struct_unsize`

3 years agoAuto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514
bors [Fri, 26 Feb 2021 00:17:22 +0000 (00:17 +0000)]
Auto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514

[librustdoc] Only split lang string on `,`, ` `, and `\t`

Split markdown lang strings into tokens on `,`.

The previous behavior was to split lang strings into tokens on any
character that wasn't a `_`, `_`, or alphanumeric.

This is a potentially breaking change, so please scrutinize! See discussion in #78344.

I noticed some test cases that made me wonder if there might have been some reason for the original behavior:

```
t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None);
t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None);
t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None);
t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None);
```

It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`.

I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.`

It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted.

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

3 years agoMiscellaneous inlining improvements
Tomasz Miąsko [Fri, 26 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Miscellaneous inlining improvements

Inline a few small and hot functions.

3 years agoSet codegen thread names
Wesley Wiser [Thu, 18 Feb 2021 19:27:37 +0000 (14:27 -0500)]
Set codegen thread names

For example, gdb:

```
(gdb) info threads
  Id   Target Id                                          Frame
  1    Thread 0x7fffefa7ec40 (LWP 2905) "rustc"           __pthread_clockjoin_ex (threadid=140737214134016, thread_return=0x0, clockid=<optimized out>, abstime=<optimized out>, block=<optimized out>)
    at pthread_join_common.c:145
  2    Thread 0x7fffefa7b700 (LWP 2957) "rustc"           0x00007ffff125eaa8 in llvm::X86_MC::initLLVMToSEHAndCVRegMapping(llvm::MCRegisterInfo*) ()
   from /home/wesley/.rustup/toolchains/stage1/lib/librustc_driver-f866439e29074957.so
  3    Thread 0x7fffeef0f700 (LWP 3116) "rustc"           futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffe8602ac8) at ../sysdeps/nptl/futex-internal.h:183
* 4    Thread 0x7fffeed0e700 (LWP 3123) "rustc"           rustc_codegen_ssa::back::write::spawn_work (cgcx=..., work=...) at /home/wesley/code/rust/rust/compiler/rustc_codegen_ssa/src/back/write.rs:1573
  6    Thread 0x7fffe113b700 (LWP 3150) "opt foof.7rcbfp" 0x00007ffff2940e62 in llvm::CallGraph::populateCallGraphNode(llvm::CallGraphNode*) ()
   from /home/wesley/.rustup/toolchains/stage1/lib/librustc_driver-f866439e29074957.so
  8    Thread 0x7fffe0d39700 (LWP 3158) "opt foof.7rcbfp" 0x00007fffefe8998e in malloc_consolidate (av=av@entry=0x7ffe2c000020) at malloc.c:4492
  9    Thread 0x7fffe0f3a700 (LWP 3162) "opt foof.7rcbfp" 0x00007fffefef27c4 in __libc_open64 (file=0x7fffe0f38608 "foof.foof.7rcbfp3g-cgu.6.rcgu.o", oflag=524865) at ../sysdeps/unix/sysv/linux/open64.c:48
(gdb)
```

3 years agoAuto merge of #82530 - Aaron1011:rollup-aalwq15, r=Aaron1011
bors [Thu, 25 Feb 2021 21:34:55 +0000 (21:34 +0000)]
Auto merge of #82530 - Aaron1011:rollup-aalwq15, r=Aaron1011

Rollup of 11 pull requests

Successful merges:

 - #82269 (Cleanup `PpMode` and friends)
 - #82431 (Set RUST_BACKTRACE=0 when running `treat-err-as-bug` tests)
 - #82441 (Fix typo in sanitizer flag in unstable book.)
 - #82463 (panic_bounds_checks should be panic_bounds_check)
 - #82464 (Update outdated comment in unix Command.)
 - #82467 (library: Normalize safety-for-unsafe-block comments)
 - #82468 (Move pick_by_value_method docs above function header)
 - #82484 (rustdoc: Remove duplicate "List of all items")
 - #82502 (Only look for HTML `tidy` when running rustdoc tests)
 - #82503 (fix typo in `pre-commit.sh`)
 - #82510 (Fix typo in `param_env_reveal_all_normalized`)

Failed merges:

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

3 years agoRollup merge of #82510 - jyn514:fix-typo, r=Dylan-DPC
Aaron Hill [Thu, 25 Feb 2021 21:06:26 +0000 (16:06 -0500)]
Rollup merge of #82510 - jyn514:fix-typo, r=Dylan-DPC

Fix typo in `param_env_reveal_all_normalized`

This made the generated docs look strange: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.param_env_reveal_all_normalized

3 years agoRollup merge of #82503 - cratelyn:patch-1, r=Mark-Simulacrum
Aaron Hill [Thu, 25 Feb 2021 21:06:25 +0000 (16:06 -0500)]
Rollup merge of #82503 - cratelyn:patch-1, r=Mark-Simulacrum

fix typo in `pre-commit.sh`

This updates a small typo I found, no more no less :slightly_smiling_face:

3 years agoRollup merge of #82502 - jyn514:tidy, r=petrochenkov
Aaron Hill [Thu, 25 Feb 2021 21:06:24 +0000 (16:06 -0500)]
Rollup merge of #82502 - jyn514:tidy, r=petrochenkov

Only look for HTML `tidy` when running rustdoc tests

This avoids printing lots of unnecessary errors, as well as making the
test suite slightly faster. This doesn't fix the windows bug tracked by https://github.com/rust-lang/rust/issues/82501, though.

r? `@petrochenkov`

3 years agoRollup merge of #82484 - bugadani:docfix, r=jyn514
Aaron Hill [Thu, 25 Feb 2021 21:06:23 +0000 (16:06 -0500)]
Rollup merge of #82484 - bugadani:docfix, r=jyn514

rustdoc: Remove duplicate "List of all items"

Closes #82477

r? `@jyn514`

3 years agoRollup merge of #82468 - osa1:pick_by_value_method_docs, r=petrochenkov
Aaron Hill [Thu, 25 Feb 2021 21:06:22 +0000 (16:06 -0500)]
Rollup merge of #82468 - osa1:pick_by_value_method_docs, r=petrochenkov

Move pick_by_value_method docs above function header

- Currently style triggers #81183 so we can't add `#[instrument]` to
  this function.

- Having docs above the header is more consistent with the rest of the
  code base.

3 years agoRollup merge of #82467 - ojeda:tidy-normalize-safety-comments, r=kennytm
Aaron Hill [Thu, 25 Feb 2021 21:06:21 +0000 (16:06 -0500)]
Rollup merge of #82467 - ojeda:tidy-normalize-safety-comments, r=kennytm

library: Normalize safety-for-unsafe-block comments

Almost all safety comments are of the form `// SAFETY:`,
so normalize the rest and fix a few of them that should
have been a `/// # Safety` section instead.

Furthermore, make `tidy` only allow the uppercase form. While
currently `tidy` only checks `core`, it is a good idea to prevent
`core` from drifting to non-uppercase comments, so that later
we can start checking `alloc` etc. too.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
3 years agoRollup merge of #82464 - ehuss:unix-command-comment, r=kennytm
Aaron Hill [Thu, 25 Feb 2021 21:06:20 +0000 (16:06 -0500)]
Rollup merge of #82464 - ehuss:unix-command-comment, r=kennytm

Update outdated comment in unix Command.

The big comment in the `Command` struct has been incorrect for some time (at least since #46789 which removed `envp`). Rather than try to remove the allocations, this PR just updates the comment to reflect reality. There is an explanation for the reasoning at https://github.com/rust-lang/rust/pull/31409#issuecomment-182122895, discussing the potential of being able to call `Command::exec` after `libc::fork`.  That can still be done in the future, but I think for now it would be good to just correct the comment.

3 years agoRollup merge of #82463 - jrmuizel:patch-1, r=steveklabnik
Aaron Hill [Thu, 25 Feb 2021 21:06:19 +0000 (16:06 -0500)]
Rollup merge of #82463 - jrmuizel:patch-1, r=steveklabnik

panic_bounds_checks should be panic_bounds_check

3 years agoRollup merge of #82441 - frewsxcv:frewsxcv-docs, r=GuillaumeGomez
Aaron Hill [Thu, 25 Feb 2021 21:06:18 +0000 (16:06 -0500)]
Rollup merge of #82441 - frewsxcv:frewsxcv-docs, r=GuillaumeGomez

Fix typo in sanitizer flag in unstable book.

3 years agoRollup merge of #82431 - Aaron1011:fix/bug-env, r=jyn514
Aaron Hill [Thu, 25 Feb 2021 21:06:17 +0000 (16:06 -0500)]
Rollup merge of #82431 - Aaron1011:fix/bug-env, r=jyn514

Set RUST_BACKTRACE=0 when running `treat-err-as-bug` tests

These ensure that these tests pass regardless of what RUST_BACKTRACE is
set to in the user's shell.

3 years agoRollup merge of #82269 - LeSeulArtichaut:cleanup-ppmode, r=spastorino
Aaron Hill [Thu, 25 Feb 2021 21:06:16 +0000 (16:06 -0500)]
Rollup merge of #82269 - LeSeulArtichaut:cleanup-ppmode, r=spastorino

Cleanup `PpMode` and friends

This PR:
 - Separates `PpSourceMode` and `PpHirMode` to remove invalid states
 - Renames the variant to remove the redundant `Ppm` prefix
 - Adds basic documentation for the different pretty-print modes
 - Cleanups some code to make it more idiomatic

Not sure if this is actually useful, but it looks cleaner to me.

3 years agoAuto merge of #82447 - Amanieu:legacy_const_generics, r=oli-obk
bors [Thu, 25 Feb 2021 18:14:50 +0000 (18:14 +0000)]
Auto merge of #82447 - Amanieu:legacy_const_generics, r=oli-obk

Add #[rustc_legacy_const_generics]

This is the first step towards removing `#[rustc_args_required_const]`: a new attribute is added which rewrites function calls of the form `func(a, b, c)` to `func::<{b}>(a, c)`. This allows previously stabilized functions in `stdarch` which use `rustc_args_required_const` to use const generics instead.

This new attribute is not intended to ever be stabilized, it is only intended for use in `stdarch` as a replacement for `#[rustc_args_required_const]`.

```rust
#[rustc_legacy_const_generics(1)]
pub fn foo<const Y: usize>(x: usize, z: usize) -> [usize; 3] {
    [x, Y, z]
}

fn main() {
    assert_eq!(foo(0 + 0, 1 + 1, 2 + 2), [0, 2, 4]);
    assert_eq!(foo::<{1 + 1}>(0 + 0, 2 + 2), [0, 2, 4]);
}
```

r? `@oli-obk`

3 years agoDetect match statement intended to be tail expression
Esteban Küber [Thu, 28 Jan 2021 02:27:13 +0000 (18:27 -0800)]
Detect match statement intended to be tail expression

CC #24157

3 years agoAuto merge of #82517 - Dylan-DPC:rollup-a1958gb, r=Dylan-DPC
bors [Thu, 25 Feb 2021 15:15:59 +0000 (15:15 +0000)]
Auto merge of #82517 - Dylan-DPC:rollup-a1958gb, r=Dylan-DPC

Rollup of 16 pull requests

Successful merges:

 - #75807 (Convert core/num/mod.rs to intra-doc links)
 - #80534 (Use #[doc = include_str!()] in std)
 - #80553 (Add an impl of Error on `Arc<impl Error>`.)
 - #81167 (Make ptr::write const)
 - #81575 (rustdoc: Name fields of `ResolutionFailure::WrongNamespace`)
 - #81713 (Account for associated consts in the "unstable assoc item name colission" lint)
 - #82078 (Make char and u8 methods const)
 - #82087 (Fix ICE caused by suggestion with no code substitutions)
 - #82090 (Do not consider using a semicolon inside of a different-crate macro)
 - #82213 (Slices for vecs)
 - #82214 (Remove redundant to_string calls)
 - #82220 (fix the false 'defined here' messages)
 - #82313 (Update normalize.css to 8.0.1)
 - #82321 (AST: Remove some unnecessary boxes)
 - #82364 (Improve error msgs when found type is deref of expected)
 - #82514 (Update Clippy)

Failed merges:

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

3 years agoRollup merge of #82514 - flip1995:clippyup, r=Manishearth
Dylan DPC [Thu, 25 Feb 2021 13:34:05 +0000 (14:34 +0100)]
Rollup merge of #82514 - flip1995:clippyup, r=Manishearth

Update Clippy

Bi-weekly Clippy update.

This updates `Cargo.lock`, so probably needs rollup=never. (https://github.com/rust-lang/rust/commit/0046d7c33e944e87a5cabc940f21bacdce5af307)

https://github.com/rust-lang/rust/commit/a6dd9b96068800fd548a72b3aa7ac4712d1d0c49 fixes things in Clippy, so that it can be build and tested. This needs proper fixing in Clippy, but I didn't want this to block the sync.

r? `@Manishearth`

3 years agoRollup merge of #82364 - osa1:issue82361, r=estebank
Dylan DPC [Thu, 25 Feb 2021 13:34:04 +0000 (14:34 +0100)]
Rollup merge of #82364 - osa1:issue82361, r=estebank

Improve error msgs when found type is deref of expected

This improves help messages in two cases:

- When expected type is `T` and found type is `&T`, we now look through blocks
  and suggest dereferencing the expression of the block, rather than the whole
  block.

- In the above case, if the expression is an `&`, we not suggest removing the
  `&` instead of adding `*`.

Both of these are demonstrated in the regression test. Before this patch the
first error in the test would be:

    error[E0308]: `if` and `else` have incompatible types
     --> test.rs:8:9
      |
    5 | /     if true {
    6 | |         a
      | |         - expected because of this
    7 | |     } else {
    8 | |         b
      | |         ^ expected `usize`, found `&usize`
    9 | |     };
      | |_____- `if` and `else` have incompatible types
      |
    help: consider dereferencing the borrow
      |
    7 |     } else *{
    8 |         b
    9 |     };
      |

Now:

    error[E0308]: `if` and `else` have incompatible types
     --> test.rs:8:9
      |
    5 | /     if true {
    6 | |         a
      | |         - expected because of this
    7 | |     } else {
    8 | |         b
      | |         ^
      | |         |
      | |         expected `usize`, found `&usize`
      | |         help: consider dereferencing the borrow: `*b`
    9 | |     };
      | |_____- `if` and `else` have incompatible types

The second error:

    error[E0308]: `if` and `else` have incompatible types
      --> test.rs:14:9
       |
    11 | /     if true {
    12 | |         1
       | |         - expected because of this
    13 | |     } else {
    14 | |         &1
       | |         ^^ expected integer, found `&{integer}`
    15 | |     };
       | |_____- `if` and `else` have incompatible types
       |
    help: consider dereferencing the borrow
       |
    13 |     } else *{
    14 |         &1
    15 |     };
       |

now:

    error[E0308]: `if` and `else` have incompatible types
      --> test.rs:14:9
       |
    11 | /     if true {
    12 | |         1
       | |         - expected because of this
    13 | |     } else {
    14 | |         &1
       | |         ^-
       | |         ||
       | |         |help: consider removing the `&`: `1`
       | |         expected integer, found `&{integer}`
    15 | |     };
       | |_____- `if` and `else` have incompatible types

Fixes #82361

---

r? ````@estebank````

3 years agoRollup merge of #82321 - bugadani:ast3, r=varkor
Dylan DPC [Thu, 25 Feb 2021 13:34:03 +0000 (14:34 +0100)]
Rollup merge of #82321 - bugadani:ast3, r=varkor

AST: Remove some unnecessary boxes

3 years agoRollup merge of #82313 - jsha:update-normalize-css, r=GuillaumeGomez
Dylan DPC [Thu, 25 Feb 2021 13:34:02 +0000 (14:34 +0100)]
Rollup merge of #82313 - jsha:update-normalize-css, r=GuillaumeGomez

Update normalize.css to 8.0.1

From From https://github.com/necolas/normalize.css/releases/tag/8.0.1.

The old version was 3.0.0, from 2014. The new version is from 2018.

I noticed when looking at frontend performance for rustdoc that this file was out of date. The URL in the 3.0.0 license header now resolves to an incorrect destination. And generally it seems good to be up-to-date.

Before-and-after images, plus diff, under details. TL;DR: Nothing changes except a slight adjustment to line height.

<details>

![with-normalize-8 0 1](https://user-images.githubusercontent.com/220205/108581849-bd5c8800-72e4-11eb-9150-78c8d67ca37a.png)

![with-normalize-3 0 0](https://user-images.githubusercontent.com/220205/108581848-bcc3f180-72e4-11eb-8b45-0cd1415a51e5.png)

![diff](https://user-images.githubusercontent.com/220205/108581890-dfeea100-72e4-11eb-93c5-6284492f54a9.png)

</details>

3 years agoRollup merge of #82220 - henryboisdequin:fixes-80853, r=varkor
Dylan DPC [Thu, 25 Feb 2021 13:34:00 +0000 (14:34 +0100)]
Rollup merge of #82220 - henryboisdequin:fixes-80853, r=varkor

fix the false 'defined here' messages

Closes #80853.

Take this code:

```rust
struct S;

fn repro_ref(thing: S) {
    thing();
}
```

Previously, the error message would be this:

```
error[E0618]: expected function, found `S`
 --> src/lib.rs:4:5
  |
3 | fn repro_ref(thing: S) {
  |              ----- `S` defined here
4 |     thing();
  |     ^^^^^--
  |     |
  |     call expression requires function

error: aborting due to previous error
```

This is incorrect as `S` is not defined in the function arguments, `thing` is defined there. With this change, the following is emitted:

```
error[E0618]: expected function, found `S`
  --> $DIR/80853.rs:4:5
   |
LL | fn repro_ref(thing: S) {
   |              ----- is of type `S`
LL |     thing();
   |     ^^^^^--
   |     |
   |     call expression requires function
   |
   = note: local variable `S` is not a function

error: aborting due to previous error
```

As you can see, this error message points out that `thing` is of type `S` and later in a note, that `S` is not a function. This change does seem like a downside for some error messages. Take this example:

```
LL | struct Empty2;
   | -------------- is of type `Empty2`
```

As you can see, the error message shows that the definition of `Empty2` is of type `Empty2`. Although this isn't wrong, it would be more helpful if it would say something like this (which was there previously):

```
LL | struct Empty2;
   | -------------- `Empty2` defined here
```

If there is a better way of doing this, where the `Empty2` example would stay the same as without this change, please inform me.

**Update: This is now fixed**

CC `@camelid`

3 years agoRollup merge of #82214 - est31:no_to_string, r=oli-obk
Dylan DPC [Thu, 25 Feb 2021 13:33:59 +0000 (14:33 +0100)]
Rollup merge of #82214 - est31:no_to_string, r=oli-obk

Remove redundant to_string calls

3 years agoRollup merge of #82213 - est31:slices_for_vecs, r=jyn514
Dylan DPC [Thu, 25 Feb 2021 13:33:58 +0000 (14:33 +0100)]
Rollup merge of #82213 - est31:slices_for_vecs, r=jyn514

Slices for vecs

3 years agoRollup merge of #82090 - notriddle:consider-using-a-semicolon-here, r=estebank
Dylan DPC [Thu, 25 Feb 2021 13:33:57 +0000 (14:33 +0100)]
Rollup merge of #82090 - notriddle:consider-using-a-semicolon-here, r=estebank

Do not consider using a semicolon inside of a different-crate macro

Fixes #81943

3 years agoRollup merge of #82087 - estebank:abolish-ice, r=oli-obk
Dylan DPC [Thu, 25 Feb 2021 13:33:56 +0000 (14:33 +0100)]
Rollup merge of #82087 - estebank:abolish-ice, r=oli-obk

Fix ICE caused by suggestion with no code substitutions

Change suggestion logic to filter and checking _before_ creating
specific resolution suggestion.

Assert earlier that suggestions contain code substitions to make it
easier in the future to debug invalid uses. If we find this becomes too
noisy in the wild, we can always make the emitter resilient to these
cases and remove the assertions.

Fix #78651.

3 years agoRollup merge of #82078 - lopopolo:char-u8-const-fn, r=m-ou-se
Dylan DPC [Thu, 25 Feb 2021 13:33:55 +0000 (14:33 +0100)]
Rollup merge of #82078 - lopopolo:char-u8-const-fn, r=m-ou-se

Make char and u8 methods const

char methods `len_utf8`, `len_utf16`, `to_ascii_lowercase`, `eq_ignore_ascii_case` can be made const.

`u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` are required to be const as well.

`u8::eq_ignore_ascii_case` was additionally made const.

Rebase of https://github.com/rust-lang/rust/pull/79549 originally authored by ``@YenForYang.`` Changes from that PR:

- Squashed all commits from #79549.
- rebased to latest upstream master.
- Removed const attributes for `char::escape_unicode` and `char::escape_default`.
- Updated `since` attributes for `const` stabilization to 1.52.0.

cc ``@m-ou-se.``

3 years agoRollup merge of #81713 - estebank:unstable-assoc-item-lint, r=oli-obk
Dylan DPC [Thu, 25 Feb 2021 13:33:53 +0000 (14:33 +0100)]
Rollup merge of #81713 - estebank:unstable-assoc-item-lint, r=oli-obk

Account for associated consts in the "unstable assoc item name colission" lint

Fix #81663.

3 years agoRollup merge of #81575 - camelid:rustdoc-wrongnamespace-cleanup, r=jyn514
Dylan DPC [Thu, 25 Feb 2021 13:33:52 +0000 (14:33 +0100)]
Rollup merge of #81575 - camelid:rustdoc-wrongnamespace-cleanup, r=jyn514

rustdoc: Name fields of `ResolutionFailure::WrongNamespace`

It makes it clearer that the `Namespace` is the one requested by the
disambiguator, rather than the actual namespace of the item. It said
that in the docs before, but now you can tell in the code so it reduces
the potential for confusion.

3 years agoRollup merge of #81167 - usbalbin:const_write, r=oli-obk
Dylan DPC [Thu, 25 Feb 2021 13:33:51 +0000 (14:33 +0100)]
Rollup merge of #81167 - usbalbin:const_write, r=oli-obk

Make ptr::write const

~~The code in this PR as of right now is not much more than an experiment.~~

~~This should, if I am not mistaken, in theory compile and pass the tests once the bootstraping compiler is updated. Thus the PR is blocked on that which should happen some time after the February the 9th. Also we might want to wait for #79989 to avoid regressing performance due to using `mem::forget` over `intrinsics::forget`~~.

3 years agoRollup merge of #80553 - derekdreery:arc_error, r=m-ou-se
Dylan DPC [Thu, 25 Feb 2021 13:33:50 +0000 (14:33 +0100)]
Rollup merge of #80553 - derekdreery:arc_error, r=m-ou-se

Add an impl of Error on `Arc<impl Error>`.

`Display` already exists so this should be a non-controversial change (famous last words).

Would have to be insta-stable.

3 years agoRollup merge of #80534 - LeSeulArtichaut:doc-include, r=jyn514
Dylan DPC [Thu, 25 Feb 2021 13:33:47 +0000 (14:33 +0100)]
Rollup merge of #80534 - LeSeulArtichaut:doc-include, r=jyn514

Use #[doc = include_str!()] in std

cc https://github.com/rust-lang/rust/issues/78835#issuecomment-742531894
r? `````@jyn514`````

3 years agoRollup merge of #75807 - jyn514:num-intra-link, r=poliorcetics
Dylan DPC [Thu, 25 Feb 2021 13:33:44 +0000 (14:33 +0100)]
Rollup merge of #75807 - jyn514:num-intra-link, r=poliorcetics

Convert core/num/mod.rs to intra-doc links

Helps with #75080.
This can't convert the associated constants `MAX` and `MIN` until #74489 is merged.

r? `@poliorcetics`

3 years agoAuto merge of #82265 - GuillaumeGomez:cleanup-attrs-twice, r=jyn514
bors [Thu, 25 Feb 2021 12:33:21 +0000 (12:33 +0000)]
Auto merge of #82265 - GuillaumeGomez:cleanup-attrs-twice, r=jyn514

Prevent to compute Item attributes twice

I came across this case when working on another part of rustdoc. Not a game changer but a nice little improvement.

cc `@camelid`

r? `@jyn514`

3 years agoadd helpful error notes and fix the false 'defined here' messages
Henry Boisdequin [Wed, 17 Feb 2021 14:50:59 +0000 (20:20 +0530)]
add helpful error notes and fix the false 'defined here' messages

3 years agoUpdate Cargo.lock
flip1995 [Thu, 25 Feb 2021 10:26:23 +0000 (11:26 +0100)]
Update Cargo.lock

3 years agoFix Clippy build and test
flip1995 [Thu, 25 Feb 2021 10:25:45 +0000 (11:25 +0100)]
Fix Clippy build and test

3 years agoMerge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup
flip1995 [Thu, 25 Feb 2021 10:25:22 +0000 (11:25 +0100)]
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup

3 years agoAuto merge of #6789 - flip1995:rustup, r=flip1995
bors [Thu, 25 Feb 2021 09:49:12 +0000 (09:49 +0000)]
Auto merge of #6789 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: None

3 years agoBump nightly version -> 2021-02-25
flip1995 [Thu, 25 Feb 2021 09:40:24 +0000 (10:40 +0100)]
Bump nightly version -> 2021-02-25

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 25 Feb 2021 09:40:00 +0000 (10:40 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoImprove checking for attribute
Amanieu d'Antras [Thu, 25 Feb 2021 09:04:43 +0000 (09:04 +0000)]
Improve checking for attribute

3 years agoAuto merge of #6788 - matthiaskrgr:upper_case_acronyms, r=flip1995
bors [Thu, 25 Feb 2021 09:01:41 +0000 (09:01 +0000)]
Auto merge of #6788 - matthiaskrgr:upper_case_acronyms, r=flip1995

move upper_case_acronyms back to style, but make the default behaviour less aggressive by default (can be unleashed via config option)

Previous discussion in the bi-weekly clippy meeting for reference: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202021-02-23/near/227458019

Move the `upper_case_acronyms` lint back to the style group.
Only warn on fully-capitalized names by default.
Add add a clippy-config option `upper-case-acronyms-aggressive: true/false` to enabled more aggressive linting on
all substrings that could be capitalized acronyms.

---
changelog: reenable upper_case_acronyms by default but make the more aggressive linting opt-in via config option

3 years agorun cargo dev update_lints
Matthias Krüger [Wed, 24 Feb 2021 23:10:06 +0000 (00:10 +0100)]
run cargo dev update_lints

fix sentence / address review comments

3 years agoAuto merge of #82338 - RalfJung:interp-error-allocs, r=oli-obk
bors [Thu, 25 Feb 2021 08:27:09 +0000 (08:27 +0000)]
Auto merge of #82338 - RalfJung:interp-error-allocs, r=oli-obk

all InterpError allocate now, so adjust alloc-error-check

Cc https://github.com/rust-lang/rust/pull/82116#discussion_r578310770
r? `@oli-obk`

3 years agoFix back-forward cache in rustdoc frontend.
Jacob Hoffman-Andrews [Thu, 25 Feb 2021 03:31:07 +0000 (19:31 -0800)]
Fix back-forward cache in rustdoc frontend.

Rustdoc's frontend set a no-op unload handler, specifically to disable
Firefox's back-forward cache because it caused a bug. It's nice to
allow the back-forward cache because it permits faster navigations.

This change addresses the issues that were caused by back-forward cache.

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching
https://web.dev/bfcache/

3 years agoFix typo in `param_env_reveal_all_normalized` #82510
Joshua Nelson [Thu, 25 Feb 2021 05:41:38 +0000 (00:41 -0500)]
Fix typo in `param_env_reveal_all_normalized` #82510

This made the generated docs look strange: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.param_env_reveal_all_normalized

3 years agoclarifies error when finding mismatched returned types for async functions
Nell Shamrell [Mon, 15 Feb 2021 22:27:36 +0000 (14:27 -0800)]
clarifies error when finding mismatched returned types for async functions

Signed-off-by: Nell Shamrell <nellshamrell@gmail.com>
3 years agoProperly account for non-shorthand pattern field in unused variable lint
Esteban Küber [Thu, 25 Feb 2021 02:08:37 +0000 (18:08 -0800)]
Properly account for non-shorthand pattern field in unused variable lint

Fix #82488

3 years agofix review
klensy [Thu, 25 Feb 2021 01:13:42 +0000 (04:13 +0300)]
fix review

3 years agoAdd a cache for rustc_legacy_const_generics
Amanieu d'Antras [Thu, 25 Feb 2021 00:37:56 +0000 (00:37 +0000)]
Add a cache for rustc_legacy_const_generics

3 years agoFix tests
Amanieu d'Antras [Thu, 25 Feb 2021 00:37:42 +0000 (00:37 +0000)]
Fix tests

3 years agoAuto merge of #82162 - cuviper:flat-fold, r=Mark-Simulacrum
bors [Thu, 25 Feb 2021 00:36:05 +0000 (00:36 +0000)]
Auto merge of #82162 - cuviper:flat-fold, r=Mark-Simulacrum

Expand FlattenCompat folds

The former `chain`+`chain`+`fold` implementation looked nice from a
functional-programming perspective, but it introduced unnecessary layers
of abstraction on every `flat_map`/`flatten` fold. It's straightforward
to just fold each part in turn, and this makes it look like a simplified
version of the existing `try_fold` implementation.

For the `iter::bench_flat_map*` benchmarks, I get a large improvement in
`bench_flat_map_chain_sum`, from 1,598,473 ns/iter to 499,889 ns/iter,
and the rest are unchanged.

3 years agoAuto merge of #6783 - avitex:add-opendns-ident, r=giraffate
bors [Thu, 25 Feb 2021 00:22:39 +0000 (00:22 +0000)]
Auto merge of #6783 - avitex:add-opendns-ident, r=giraffate

Add OpenDNS to `doc-valid-idents`

changelog: This commit adds `"OpenDNS"` to doc-valid-idents to avoid `doc_markdown` false positives.

3 years agoAddress review comments
Amanieu d'Antras [Thu, 25 Feb 2021 00:09:33 +0000 (00:09 +0000)]
Address review comments

3 years agofix typo in `pre-commit.sh`
katelyn martin [Wed, 24 Feb 2021 23:37:13 +0000 (18:37 -0500)]
fix typo in `pre-commit.sh`

3 years agoAccount for associated consts in the "unstable assoc item name colission" lint
Esteban Küber [Wed, 3 Feb 2021 16:38:05 +0000 (08:38 -0800)]
Account for associated consts in the "unstable assoc item name colission" lint

Fix #81663.

3 years agoOnly look for `tidy` when running rustdoc tests
Joshua Nelson [Wed, 24 Feb 2021 23:13:47 +0000 (18:13 -0500)]
Only look for `tidy` when running rustdoc tests

This avoids printing lots of unnecessary errors, as well as making the
test suite slightly faster.

3 years agoupper_case_acronyms: add io-toml tests and bless previous tests
Matthias Krüger [Wed, 24 Feb 2021 22:41:32 +0000 (23:41 +0100)]
upper_case_acronyms: add io-toml tests and bless previous tests

3 years agoupper_case_acronyms: add optional aggressive mode and relax default
Matthias Krüger [Wed, 24 Feb 2021 22:20:49 +0000 (23:20 +0100)]
upper_case_acronyms: add optional aggressive mode and relax default

Moves the lint back from pedantic to style group.
The lint default now only warns on names that are completely capitalized, like "WORD"
and only if the name is longer than 2 chars (so that names where each of the letter represents a word are still distinguishable).
For example: FP (false positive) would still be "valid" and not warned about (but EOF would warn).

A "upper_case_acronyms_aggressive: true/false" config option was added that restores the original lint behaviour to warn
on any kind of camel case name that had more than one capital letter following another capital letter.

3 years agoadd test coverage for all `doc-valid-idents`
avitex [Wed, 24 Feb 2021 22:26:11 +0000 (09:26 +1100)]
add test coverage for all `doc-valid-idents`

3 years agoAdd OpenDNS to `doc-valid-idents`
avitex [Wed, 24 Feb 2021 04:04:00 +0000 (15:04 +1100)]
Add OpenDNS to `doc-valid-idents`

3 years agoAuto merge of #82159 - BoxyUwU:uwu, r=varkor
bors [Wed, 24 Feb 2021 21:54:52 +0000 (21:54 +0000)]
Auto merge of #82159 - BoxyUwU:uwu, r=varkor

Use correct param_env in conservative_is_privately_uninhabited

cc `@lcnr`
r? `@varkor` since this is your FIXME that was removed ^^