]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #84226 - Aaron1011:track-link-dead-code, r=Mark-Simulacrum
bors [Fri, 16 Apr 2021 00:01:49 +0000 (00:01 +0000)]
Auto merge of #84226 - Aaron1011:track-link-dead-code, r=Mark-Simulacrum

Track `-C link-dead-code` during incremental compilation

This option influences monomorphization, which participates in
incremental compilation.

3 years agoAuto merge of #84205 - workingjubilee:more-simd-intrin, r=bjorn3
bors [Thu, 15 Apr 2021 21:00:11 +0000 (21:00 +0000)]
Auto merge of #84205 - workingjubilee:more-simd-intrin, r=bjorn3

Add simd_{round,trunc} intrinsics

LLVM supports many functions from math.h in its IR. Many of these
have SIMD instructions on various platforms. So, let's add round and
trunc so std::arch can use them.

Yes, exact comparison is intentional: rounding must always return a
valid integer-equal value, except for inf/NAN.

3 years agoTrack `-C link-dead-code` during incremental compilation
Aaron Hill [Thu, 15 Apr 2021 19:05:26 +0000 (15:05 -0400)]
Track `-C link-dead-code` during incremental compilation

This option influences monomorphization, which participates in
incremental compilation.

3 years agoAuto merge of #84222 - Aaron1011:fix/anon-const-lint, r=lcnr
bors [Thu, 15 Apr 2021 18:08:17 +0000 (18:08 +0000)]
Auto merge of #84222 - Aaron1011:fix/anon-const-lint, r=lcnr

Run buffered lints attached to anon consts

Fixes #84195

3 years agoAuto merge of #84209 - pickfire:patch-3, r=jyn514
bors [Thu, 15 Apr 2021 15:18:16 +0000 (15:18 +0000)]
Auto merge of #84209 - pickfire:patch-3, r=jyn514

Merge same condition branch in vec spec_extend

Follow up of https://github.com/rust-lang/rust/pull/83726#discussion_r613438246

3 years agoRun buffered lints attached to anon consts
Aaron Hill [Thu, 15 Apr 2021 15:11:44 +0000 (11:11 -0400)]
Run buffered lints attached to anon consts

Fixes #84195

3 years agoAuto merge of #84088 - m-ou-se:stabilize-option-insert, r=m-ou-se
bors [Thu, 15 Apr 2021 12:37:19 +0000 (12:37 +0000)]
Auto merge of #84088 - m-ou-se:stabilize-option-insert, r=m-ou-se

Stabilize option_insert.

FCP finished here: https://github.com/rust-lang/rust/issues/78271#issuecomment-817201319

3 years agoAuto merge of #84215 - RalfJung:miri, r=RalfJung
bors [Thu, 15 Apr 2021 09:36:48 +0000 (09:36 +0000)]
Auto merge of #84215 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoupdate Miri
Ralf Jung [Thu, 15 Apr 2021 09:06:06 +0000 (11:06 +0200)]
update Miri

3 years agoAuto merge of #84193 - ehuss:unsafe_op_in_unsafe_fn-docs, r=RalfJung
bors [Thu, 15 Apr 2021 07:11:18 +0000 (07:11 +0000)]
Auto merge of #84193 - ehuss:unsafe_op_in_unsafe_fn-docs, r=RalfJung

Update docs for unsafe_op_in_unsafe_fn stability.

The unsafe_op_in_unsafe_fn lint was stabilized in #79208, but the bottom of this documentation wasn't updated.

I'm just guessing at the reason here, hopefully it is close to correct. The only discussion I found is https://github.com/rust-lang/rust/issues/71668#issuecomment-730399862 which didn't really explain the thought process behind the decision.

3 years agoAuto merge of #84198 - mlodato517:patch-1, r=jyn514
bors [Thu, 15 Apr 2021 04:08:33 +0000 (04:08 +0000)]
Auto merge of #84198 - mlodato517:patch-1, r=jyn514

Fix small typo in Drop documentation

3 years agoMerge same condition branch in vec spec_extend
Ivan Tham [Thu, 15 Apr 2021 03:58:02 +0000 (11:58 +0800)]
Merge same condition branch in vec spec_extend

3 years agoAuto merge of #84206 - Dylan-DPC:rollup-knl2jgq, r=Dylan-DPC
bors [Wed, 14 Apr 2021 23:51:33 +0000 (23:51 +0000)]
Auto merge of #84206 - Dylan-DPC:rollup-knl2jgq, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #82492 (Move `std::sys_common::alloc` to new module `std::sys::common`)
 - #84177 (Fix join_paths error display.)
 - #84185 (add more pat2021 tests)
 - #84191 (Update books)
 - #84192 (Fix typos in rustc_codegen_ssa/src/back/write.rs.)
 - #84196 (:arrow_up: rust-analyzer)
 - #84201 (rustdoc: Note that forbidding anchors in links to primitives is a bug)

Failed merges:

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

3 years agoRollup merge of #84201 - jyn514:primitive-warnings, r=cuviper
Dylan DPC [Wed, 14 Apr 2021 23:27:58 +0000 (01:27 +0200)]
Rollup merge of #84201 - jyn514:primitive-warnings, r=cuviper

rustdoc: Note that forbidding anchors in links to primitives is a bug

cc https://github.com/rust-lang/rust/issues/83083, https://github.com/rust-lang/rust/pull/84147#discussion_r613518820

r? `@cuviper`

3 years agoRollup merge of #84196 - lnicola:rust-analyzer-2021-04-12, r=jonas-schievink
Dylan DPC [Wed, 14 Apr 2021 23:27:57 +0000 (01:27 +0200)]
Rollup merge of #84196 - lnicola:rust-analyzer-2021-04-12, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoRollup merge of #84192 - vext01:backend-write-typos, r=wesleywiser
Dylan DPC [Wed, 14 Apr 2021 23:27:56 +0000 (01:27 +0200)]
Rollup merge of #84192 - vext01:backend-write-typos, r=wesleywiser

Fix typos in rustc_codegen_ssa/src/back/write.rs.

Just a couple of typos I spotted when reading this comment about the job server.

3 years agoRollup merge of #84191 - ehuss:update-books, r=ehuss
Dylan DPC [Wed, 14 Apr 2021 23:27:55 +0000 (01:27 +0200)]
Rollup merge of #84191 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in 6fe476943afd53a9a6e91f38a6ea7bb48811d8ff..8551afbb2ca6f5ea37fe58380318b209785e4e02
2021-03-10 07:28:57 +0900 to 2021-04-01 21:58:50 +0900
- Add example of thinking about Send/Sync's soundness (rust-lang-nursery/nomicon#259)

## reference

10 commits in fd97729e2d82f8b08d68a31c9bfdf0c37a7fd542..e1abb17cd94cd5a8a374b48e1bc8134a2208ed48
2021-03-28 14:29:19 -0700 to 2021-04-07 08:09:48 -0700
- Update introduction.md (rust-lang-nursery/reference#1004)
- clarify UB for raw ptr deref (rust-lang-nursery/reference#1000)
- Update lint level documentation. (rust-lang-nursery/reference#998)
- Add rustdoc to tool lints. (rust-lang-nursery/reference#997)
- Link to ptr::addr_of on raw pointer docs (rust-lang-nursery/reference#993)
- apply rust-lang-nursery/reference#950 to STYLE.md (rust-lang-nursery/reference#980)
- Tuple Passover rust-lang-nursery/reference#2 (rust-lang-nursery/reference#990)
- Fix typo in macros-by-example.md (rust-lang-nursery/reference#996)
- Clarify object safety rules for methods striked from the vtable (rust-lang-nursery/reference#965)
- Add const generic args to const contexts. (rust-lang-nursery/reference#995)

## rust-by-example

1 commits in 29d91f591c90dd18fdca6d23f1a9caf9c139d0d7..c80f0b09fc15b9251825343be910c08531938ab2
2021-03-23 09:03:39 -0300 to 2021-04-08 10:28:17 -0300
- fix compile bug with panic! (rust-lang/rust-by-example#1433)

## rustc-dev-guide

11 commits in 0687daac28939c476df51778f5a1d1aff1a3fddf..a9bd2bbf31e4f92b5d3d8e80b22839d0cc7a2022
2021-03-28 13:33:56 -0400 to 2021-04-09 18:12:21 -0400
- Improve formatting and update info in "method lookup" section
- Change wording a bit: `module` => `crate`
- fix typo (rust-lang/rustc-dev-guide#1107)
- fix typo
- Mention CI build of LLVM in build instruction
- Fix rustdocs test command typo (rust-lang/rustc-dev-guide#1103)
- Update the "LLVM updates" section
- Fix a link about Rustdoc internals
- Add quickstart for adding a new optimization (rust-lang/rustc-dev-guide#1094)
- Add back example of {{cwd}} (rust-lang/rustc-dev-guide#1099)
- Document test input normalization

## embedded-book

1 commits in d3f2ace94d51610cf3e3c265705bb8416d37f8e4..569c3391f5c0cc43433bc77831d17f8ff4d76602
2021-03-17 07:53:09 +0000 to 2021-04-07 08:32:11 +0000
- Make it easier to copy and paste example commands.  (rust-embedded/book#289)

3 years agoRollup merge of #84185 - hi-rustin:rustin-patch-macro, r=nikomatsakis
Dylan DPC [Wed, 14 Apr 2021 23:27:54 +0000 (01:27 +0200)]
Rollup merge of #84185 - hi-rustin:rustin-patch-macro, r=nikomatsakis

add more pat2021 tests

close https://github.com/rust-lang/rust/issues/84138

r? ```@nikomatsakis```

3 years agoRollup merge of #84177 - ehuss:join_paths-err, r=kennytm
Dylan DPC [Wed, 14 Apr 2021 23:27:53 +0000 (01:27 +0200)]
Rollup merge of #84177 - ehuss:join_paths-err, r=kennytm

Fix join_paths error display.

On unix, the error from `join_paths` looked like this:

```
path segment contains separator `58`
```

This PR changes it to look like this:

```
path segment contains separator `:`
```

3 years agoRollup merge of #82492 - CDirkx:sys_common_alloc, r=m-ou-se
Dylan DPC [Wed, 14 Apr 2021 23:27:52 +0000 (01:27 +0200)]
Rollup merge of #82492 - CDirkx:sys_common_alloc, r=m-ou-se

Move `std::sys_common::alloc` to new module `std::sys::common`

https://github.com/rust-lang/rust/blob/6b56603e35b39c9f6cc76782330e5e415f9e43d5/library/std/src/sys_common/mod.rs#L7-L13

It was my impression that the goal for `std::sys` has changed from extracting it into a separate crate to making std work with features. However the fact remains that there is a lot of interdependence between `sys` and `sys_common`, this is because `sys_common` contains two types of code:

- abstractions over the different platform implementations in `std::sys` (for example [`std::sys_common::mutex`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/mutex.rs))
- code shared between platforms (for example [`std::sys_common::alloc`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/alloc.rs))

This PR attempts to address this by adding a new module `common` to `std::sys` which will contain code shared between platforms, `alloc.rs` in this case but more can be moved over in the future.

3 years agoAdd more SIMD math.h intrinsics
Jubilee Young [Wed, 14 Apr 2021 22:07:36 +0000 (15:07 -0700)]
Add more SIMD math.h intrinsics

LLVM supports many functions from math.h in its IR. Many of these have
single-instruction variants on various platforms. So, let's add them so
std::arch can use them.

Yes, exact comparison is intentional: rounding must always return a
valid integer-equal value, except for inf/NAN.

3 years agoAuto merge of #84130 - Aaron1011:fix/none-delim-lookahead, r=petrochenkov
bors [Wed, 14 Apr 2021 20:45:23 +0000 (20:45 +0000)]
Auto merge of #84130 - Aaron1011:fix/none-delim-lookahead, r=petrochenkov

Fix lookahead with None-delimited group

Fixes https://github.com/rust-lang/rust/issues/84162, a regression introduced by https://github.com/rust-lang/rust/pull/82608.

3 years agorustdoc: Note that forbidding anchors in links to primitives is a bug
Joshua Nelson [Wed, 14 Apr 2021 20:39:58 +0000 (16:39 -0400)]
rustdoc: Note that forbidding anchors in links to primitives is a bug

3 years agoFix small typo in Drop documentation
Mark Lodato [Wed, 14 Apr 2021 20:05:56 +0000 (16:05 -0400)]
Fix small typo in Drop documentation

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Wed, 14 Apr 2021 18:25:43 +0000 (21:25 +0300)]
:arrow_up: rust-analyzer

3 years agoAuto merge of #83948 - ABouttefeux:lint-nullprt-deref, r=RalfJung
bors [Wed, 14 Apr 2021 18:04:22 +0000 (18:04 +0000)]
Auto merge of #83948 - ABouttefeux:lint-nullprt-deref, r=RalfJung

add lint deref_nullptr detecting when a null ptr is dereferenced

fixes #83856
changelog: add lint that detect code like
```rust
unsafe {
      &*core::ptr::null::<i32>()
 };
unsafe {
     addr_of!(std::ptr::null::<i32>())
};
let x: i32 = unsafe {*core::ptr::null()};
let x: i32 = unsafe {*core::ptr::null_mut()};
unsafe {*(0 as *const i32)};
unsafe {*(core::ptr::null() as *const i32)};
```
```
warning: Dereferencing a null pointer causes undefined behavior
 --> src\main.rs:5:26
  |
5 |     let x: i32 = unsafe {*core::ptr::null()};
  |                          ^^^^^^^^^^^^^^^^^^
  |                          |
  |                          a null pointer is dereferenced
  |                          this code causes undefined behavior when executed
  |
  = note: `#[warn(deref_nullptr)]` on by default
```

Limitation:
It does not detect code like
```rust
const ZERO: usize = 0;
unsafe {*(ZERO as *const i32)};
```
or code where `0` is not directly a literal

3 years agoAuto merge of #84158 - cratelyn:patch-extern-c-unwind-behavior, r=nikomatsakis
bors [Wed, 14 Apr 2021 15:35:33 +0000 (15:35 +0000)]
Auto merge of #84158 - cratelyn:patch-extern-c-unwind-behavior, r=nikomatsakis

move new c abi abort behavior behind feature gate

*Background*

In #76570, new ABI strings including `C-unwind` were introduced. Their
behavior is specified in RFC 2945 <sup>[1]</sup>.

However, it was reported in the #ffi-unwind stream of the Rust community Zulip
that this had altered the way that `extern "C"` functions behaved even when the
`c_unwind` feature gate was not active. <sup>[2]</sup>

*Overview*

This makes a small patch to `rustc_mir_build::build::should_abort_on_panic`, so
that the same behavior from before is in place when the `c_unwind` gate is not
active.

`rustc_middle::ty::layout::fn_can_unwind` is not touched, as the visible
behavior should not differ before/after #76570. <sup>[3]</sup>

---

1: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
3: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R2617

[1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
[2]: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
[3]: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R2617

3 years agoUpdate docs for unsafe_op_in_unsafe_fn stability.
Eric Huss [Wed, 14 Apr 2021 15:23:47 +0000 (08:23 -0700)]
Update docs for unsafe_op_in_unsafe_fn stability.

3 years agoFix typos in rustc_codegen_ssa/src/back/write.rs.
Edd Barrett [Wed, 14 Apr 2021 15:25:16 +0000 (16:25 +0100)]
Fix typos in rustc_codegen_ssa/src/back/write.rs.

3 years agoUpdate books
Eric Huss [Wed, 14 Apr 2021 15:24:06 +0000 (08:24 -0700)]
Update books

3 years agotest: add reasonable case
hi-rustin [Wed, 14 Apr 2021 14:31:44 +0000 (22:31 +0800)]
test: add reasonable case

3 years agotest: add more cases
hi-rustin [Wed, 14 Apr 2021 14:16:56 +0000 (22:16 +0800)]
test: add more cases

3 years agoAuto merge of #83068 - mockersf:method-trait-foreign-impl, r=GuillaumeGomez
bors [Wed, 14 Apr 2021 12:47:49 +0000 (12:47 +0000)]
Auto merge of #83068 - mockersf:method-trait-foreign-impl, r=GuillaumeGomez

rustdoc: links from items in a trait impl are inconsistent

Depending on where the struct implementing a trait is coming from, or the current page, the items in a trait impl are not linking to the same thing:

|item| trait page, implementors| trait page, implementations on Foreign Types|struct page, trait implementations|
|-|-|-|-|
|function|             link to current impl|link to first impl in the list|link to trait def
|default function |    not present         |not present                   |link to trait def
|default function with custom impl|link to current impl|link to trait def             |link to trait def
|constant|             link to current impl|link to trait def             |link to trait def
|associated type|      link to current impl|link to trait def             |link to trait def
||*missing link to trait def*|*function link wrong + missing link to current impl*|*missing link to current impl*|

<details>
  <summary>rust code with those cases</summary>

```rust
pub trait MyTrait {
    type Assoc;
    const VALUE: u32;
    fn trait_function(&self);
    fn defaulted(&self) {}
    fn defaulted_override(&self) {}
}

impl MyTrait for String {
    /// will link to trait def
    type Assoc = ();
    /// will link to trait def
    const VALUE: u32 = 5;
    /// will link to first foreign implementor
    fn trait_function(&self) {}
    /// will link to trait def
    fn defaulted_override(&self) {}
}

impl MyTrait for Vec<u8> {
    /// will link to trait def
    type Assoc = ();
    /// will link to trait def
    const VALUE: u32 = 5;
    /// will link to first foreign implementor
    fn trait_function(&self) {}
    /// will link to trait def
    fn defaulted_override(&self) {}
}

impl MyTrait for MyStruct {
    /// in trait page, will link to current impl
    ///
    /// in struct page, will link to trait def
    type Assoc = bool;
    /// in trait page, will link to current impl
    ///
    /// in struct page, will link to trait def
    const VALUE: u32 = 20;
    /// in trait page, will link to current impl
    ///
    /// in struct page, will link to trait def
    fn trait_function(&self) {}
    /// in trait page, will link to current impl
    ///
    /// in struct page, will link to trait def
    fn defaulted_override(&self) {}
}

pub struct MyStruct;
```
</details>

In this PR, I fixed all links to target the trait definition, and added an anchor-link to the current implementation appearing on mouse hover.

3 years agoUpdate documentation
Christiaan Dirkx [Wed, 14 Apr 2021 12:03:00 +0000 (14:03 +0200)]
Update documentation

3 years agoMove `std::sys_common::alloc` to `std::sys::common`
Christiaan Dirkx [Wed, 24 Feb 2021 18:16:24 +0000 (19:16 +0100)]
Move `std::sys_common::alloc` to `std::sys::common`

3 years agoadd macro-or-patterns-2021 test
hi-rustin [Wed, 14 Apr 2021 10:51:54 +0000 (18:51 +0800)]
add macro-or-patterns-2021 test

3 years agoAuto merge of #83762 - camelid:bare-urls-note, r=jyn514
bors [Wed, 14 Apr 2021 01:16:46 +0000 (01:16 +0000)]
Auto merge of #83762 - camelid:bare-urls-note, r=jyn514

Add explanatory note to `bare_urls` lint

I think the lint is confusing otherwise since it doesn't fully explain
what the problem is.

3 years agoremove line length ignore
François Mockers [Tue, 13 Apr 2021 21:32:05 +0000 (23:32 +0200)]
remove line length ignore

3 years agoFix join_paths error display.
Eric Huss [Tue, 13 Apr 2021 21:20:49 +0000 (14:20 -0700)]
Fix join_paths error display.

3 years agoforgot test assertions for default method
François Mockers [Sat, 13 Mar 2021 14:24:00 +0000 (15:24 +0100)]
forgot test assertions for default method

3 years agoadd test
François Mockers [Sat, 13 Mar 2021 14:04:12 +0000 (15:04 +0100)]
add test

3 years agotidy format rust
François Mockers [Sat, 13 Mar 2021 01:33:04 +0000 (02:33 +0100)]
tidy format rust

3 years agoformat css
François Mockers [Sat, 13 Mar 2021 01:13:00 +0000 (02:13 +0100)]
format css

3 years agofix source link when in a trait implementation
François Mockers [Sat, 13 Mar 2021 00:40:13 +0000 (01:40 +0100)]
fix source link when in a trait implementation

3 years agoadd anchors links on hover to items from trait impl
François Mockers [Thu, 11 Mar 2021 02:32:30 +0000 (03:32 +0100)]
add anchors links on hover to items from trait impl

3 years agofix links from trait impl methods to trait declaration
François Mockers [Thu, 11 Mar 2021 02:31:54 +0000 (03:31 +0100)]
fix links from trait impl methods to trait declaration

3 years agoAuto merge of #84164 - LingMan:option_option, r=estebank
bors [Tue, 13 Apr 2021 18:04:20 +0000 (18:04 +0000)]
Auto merge of #84164 - LingMan:option_option, r=estebank

Avoid an `Option<Option<_>>`

By simply swapping the calls to `map` and `and_then` around the complexity of
handling an `Option<Option<_>>` disappears.

`@rustbot` modify labels +C-cleanup +T-compiler

3 years agoAvoid an `Option<Option<_>>`
LingMan [Tue, 13 Apr 2021 16:42:19 +0000 (18:42 +0200)]
Avoid an `Option<Option<_>>`

By simply swapping the calls to `map` and `and_then` around the complexity of
handling an `Option<Option<_>>` disappears.

3 years agoAuto merge of #84135 - rust-lang:GuillaumeGomez-patch-1, r=kennytm
bors [Tue, 13 Apr 2021 14:03:49 +0000 (14:03 +0000)]
Auto merge of #84135 - rust-lang:GuillaumeGomez-patch-1, r=kennytm

Improve code example for length comparison

Small fix/improvement: it's much safer to check that you're under the length of an array rather than chacking that you're equal to it. It's even more true in case you update the length of the array while iterating.

3 years agomove new c abi abort behavior behind feature gate
katelyn a. martin [Tue, 13 Apr 2021 13:55:21 +0000 (09:55 -0400)]
move new c abi abort behavior behind feature gate

 ### Background

    In #76570, new ABI strings including `C-unwind` were introduced.
    Their behavior is specified in RFC 2945 [1].

    However, it was reported in the #ffi-unwind stream of the Rust
    community Zulip that this had altered the way that `extern "C"`
    functions behaved even when the `c_unwind` feature gate was not
    active. [2]

 ### Overview

    This makes a small patch to
    `rustc_mir_build::build::should_abort_on_panic`, so that the same
    behavior from before is in place when the `c_unwind` gate is not
    active.

    `rustc_middle::ty::layout::fn_can_unwind` is not touched, as the
    visible behavior should not differ before/after #76570. [3]

 ### Footnotes

 [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
 [2]: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
 [3]: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R2617

3 years agoAuto merge of #84153 - Dylan-DPC:rollup-5jiqrwu, r=Dylan-DPC
bors [Tue, 13 Apr 2021 11:22:10 +0000 (11:22 +0000)]
Auto merge of #84153 - Dylan-DPC:rollup-5jiqrwu, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #83438 (Update RELEASES.md)
 - #83707 (Remove `T: Debug` bound on UnsafeCell Debug impl)
 - #84084 (Stabilize duration_zero.)
 - #84121 (Stabilize BTree{Map,Set}::retain)
 - #84140 (Don't call bump in check_mistyped_turbofish_with_multiple_type_params)
 - #84141 (Fix typo in error message)

Failed merges:

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

3 years agoRollup merge of #84141 - camelid:fix-typo, r=Dylan-DPC
Dylan DPC [Tue, 13 Apr 2021 09:10:44 +0000 (11:10 +0200)]
Rollup merge of #84141 - camelid:fix-typo, r=Dylan-DPC

Fix typo in error message

Also tweaked the message a bit by

- removing the hyphen, because in my opinion the hyphen makes the
  message a bit harder to read, especially combined with the backticks;
- adding the word "be", because I think it's a bit clearer that way.

3 years agoRollup merge of #84140 - b-naber:parser_past_eof, r=varkor
Dylan DPC [Tue, 13 Apr 2021 09:10:43 +0000 (11:10 +0200)]
Rollup merge of #84140 - b-naber:parser_past_eof, r=varkor

Don't call bump in check_mistyped_turbofish_with_multiple_type_params

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

3 years agoRollup merge of #84121 - workingjubilee:stabilize-btree-retain, r=dtolnay
Dylan DPC [Tue, 13 Apr 2021 09:10:42 +0000 (11:10 +0200)]
Rollup merge of #84121 - workingjubilee:stabilize-btree-retain, r=dtolnay

Stabilize BTree{Map,Set}::retain

Closes #79025.
FCP concluded here: https://github.com/rust-lang/rust/issues/79025#issuecomment-817201302

This is an approved feature on BTree{Map,Set} to mirror a functionality in Hash{Map,Set}, which has had some adequate testing since its introduction in https://github.com/rust-lang/rust/pull/79026 and doesn't seem to have caused any problems since.

3 years agoRollup merge of #84084 - m-ou-se:stabilize-zero, r=scottmcm
Dylan DPC [Tue, 13 Apr 2021 09:10:40 +0000 (11:10 +0200)]
Rollup merge of #84084 - m-ou-se:stabilize-zero, r=scottmcm

Stabilize duration_zero.

FCP here: https://github.com/rust-lang/rust/issues/73544#issuecomment-817201305

3 years agoRollup merge of #83707 - exrook:unsafecell, r=m-ou-se
Dylan DPC [Tue, 13 Apr 2021 09:10:39 +0000 (11:10 +0200)]
Rollup merge of #83707 - exrook:unsafecell, r=m-ou-se

Remove `T: Debug` bound on UnsafeCell Debug impl

Prior art: #65013

3 years agoRollup merge of #83438 - CDirkx:releases, r=Mark-Simulacrum
Dylan DPC [Tue, 13 Apr 2021 09:10:38 +0000 (11:10 +0200)]
Rollup merge of #83438 - CDirkx:releases, r=Mark-Simulacrum

Update RELEASES.md

A couple of things that were missing in the release notes:

- `Div` and `Rem` by their `NonZero` variant is now implemented for all unsigned integers (#79134)
- Stabilization of `VecDeque::range` and `VecDeque::range_mut` (#79022, stabilization version corrected to 1.51.0 #80448)
- Deprecation of `spin_loop_hint` (#80966)

3 years agoAuto merge of #84099 - tmiasko:asm-only-x86_64, r=Amanieu
bors [Tue, 13 Apr 2021 08:40:12 +0000 (08:40 +0000)]
Auto merge of #84099 - tmiasko:asm-only-x86_64, r=Amanieu

Check for asm support in UI tests that require it

Add `needs-asm-support` compiletest directive, and use it in asm tests
that require asm support without relying on any architecture specific
features.

Closes #84038.

3 years agoAuto merge of #84086 - m-ou-se:stabilze-is-subnormal, r=dtolnay
bors [Tue, 13 Apr 2021 05:59:10 +0000 (05:59 +0000)]
Auto merge of #84086 - m-ou-se:stabilze-is-subnormal, r=dtolnay

Stabilize is_subnormal.

FCP completed here: https://github.com/rust-lang/rust/issues/79288#issuecomment-817201311

3 years agoAdd explanatory note to `bare_urls` lint
Camelid [Tue, 13 Apr 2021 01:35:06 +0000 (18:35 -0700)]
Add explanatory note to `bare_urls` lint

I think the lint is confusing otherwise since it doesn't fully explain
what the problem is.

3 years agoAuto merge of #84082 - andjo403:stabilize_nonzero_leading_trailing_zeros, r=m-ou-se
bors [Tue, 13 Apr 2021 03:18:10 +0000 (03:18 +0000)]
Auto merge of #84082 - andjo403:stabilize_nonzero_leading_trailing_zeros, r=m-ou-se

Stabilize nonzero_leading_trailing_zeros

Stabilizing nonzero_leading_trailing_zeros and due to this also stabilizing the intrinsic cttz_nonzero

FCP finished here: https://github.com/rust-lang/rust/issues/79143#issuecomment-817216153
`@rustbot` modify labels: +T-libs

Closes #79143

3 years agoAuto merge of #82992 - philippeitis:stabilize_bufreader_seek_relative, r=workingjubilee
bors [Tue, 13 Apr 2021 00:52:00 +0000 (00:52 +0000)]
Auto merge of #82992 - philippeitis:stabilize_bufreader_seek_relative, r=workingjubilee

Stabilize `bufreader_seek_relative`

This PR marks `BufReader::seek_relative` as stable - the associated issue, #31100, has passed the final comment period without any issues, and from what I understand, the only thing left to stabilize this is to submit a PR marking the method as stable.

Closes #31100.

3 years agoCheck for asm support in UI tests that require it
Tomasz Miąsko [Tue, 13 Apr 2021 00:00:00 +0000 (00:00 +0000)]
Check for asm support in UI tests that require it

Add `needs-asm-support` compiletest directive, and use it in asm tests
that require asm support without relying on any architecture specific
features.

3 years agoAuto merge of #82918 - Manishearth:edition-2015-warn, r=oli-obk
bors [Mon, 12 Apr 2021 22:26:15 +0000 (22:26 +0000)]
Auto merge of #82918 - Manishearth:edition-2015-warn, r=oli-obk

Turn old edition lint (anonymous-parameters) into warn-by-default on 2015

This makes `anonymous_parameters` <s>and `keyword_idents` </s>warn-by-default on the 2015 edition. I would also like to do this for `absolute_paths_not_starting_with_crate`, but I feel that case is slightly less clear-cut.

Note that this only affects code on the 2015 edition, such code is illegal in future editions anyway.

This was spurred by https://github.com/dtolnay/syn/issues/972: old edition syntax breaks tooling (like syn), and while the tooling should be free to find its balance on how much to support prior editions, it does seem like we should be nudging such code towards the newer edition, and we can do that by turning this Allow lint into a Warn.

In general, I feel like migration lints from an old edition should be made Warn after a year or so, and idiom lints for the new edition should be made Warn after a couple months.

cc `@m-ou-se,` this is for stuff from the 2015-2018 migration but you might be interested.

3 years agoAdd fast path when None delimiters are not involved
Aaron Hill [Mon, 12 Apr 2021 21:26:26 +0000 (17:26 -0400)]
Add fast path when None delimiters are not involved

3 years agoFix typo in error message
Camelid [Mon, 12 Apr 2021 19:33:52 +0000 (12:33 -0700)]
Fix typo in error message

Also tweaked the message a bit by

- removing the hyphen, because in my opinion the hyphen makes the
  message a bit harder to read, especially combined with the backticks;
- adding the word "be", because I think it's a bit clearer that way.

3 years agoadd test
b-naber [Mon, 12 Apr 2021 19:06:11 +0000 (21:06 +0200)]
add test

3 years agodon't bump in check_mistyped_turbofish_with_multiple_type_params
b-naber [Mon, 12 Apr 2021 17:14:51 +0000 (19:14 +0200)]
don't bump in check_mistyped_turbofish_with_multiple_type_params

3 years agoAuto merge of #83776 - jyn514:update-stdarch-docs, r=Amanieu
bors [Mon, 12 Apr 2021 18:29:25 +0000 (18:29 +0000)]
Auto merge of #83776 - jyn514:update-stdarch-docs, r=Amanieu

Update stdarch submodule (to before it switched to const generics)

https://github.com/rust-lang/rust/pull/83278#issuecomment-812389823: This unblocks #82539.

Major changes:
- More AVX-512 intrinsics.
- More ARM & AArch64 NEON intrinsics.
- Updated unstable WASM intrinsics to latest draft standards.
- std_detect is now a separate crate instead of a submodule of std.

I double-checked and the first use of const generics looks like https://github.com/rust-lang/stdarch/commit/8d5017861ed594a2baf169e632379862d516e013, which isn't included in this PR.

r? `@Amanieu`

3 years agoImprove code example for length comparison
Guillaume Gomez [Mon, 12 Apr 2021 17:59:52 +0000 (19:59 +0200)]
Improve code example for length comparison

3 years agoTurn old edition lints (anonymous-parameters, keyword-idents) into warn-by-default...
Manish Goregaokar [Mon, 8 Mar 2021 23:43:18 +0000 (15:43 -0800)]
Turn old edition lints (anonymous-parameters, keyword-idents) into warn-by-default on 2015

3 years agoAuto merge of #84103 - calebcartwright:bump-rls-rustfmt, r=Xanewok
bors [Mon, 12 Apr 2021 15:59:35 +0000 (15:59 +0000)]
Auto merge of #84103 - calebcartwright:bump-rls-rustfmt, r=Xanewok

update RLS and rustfmt

Fixes #83460 and fixes #83459

cc `@Xanewok`

3 years agoFix lookahead with None-delimited group
Aaron Hill [Mon, 12 Apr 2021 15:15:38 +0000 (11:15 -0400)]
Fix lookahead with None-delimited group

3 years agoMark Duration::is_zero as rustc_const_stable.
Mara Bos [Sun, 11 Apr 2021 09:36:35 +0000 (11:36 +0200)]
Mark Duration::is_zero as rustc_const_stable.

3 years agoStabilize duration_zero.
Mara Bos [Sun, 11 Apr 2021 09:24:17 +0000 (11:24 +0200)]
Stabilize duration_zero.

3 years agoupdate RLS and rustfmt
Caleb Cartwright [Sun, 11 Apr 2021 16:42:01 +0000 (11:42 -0500)]
update RLS and rustfmt

3 years agoUpdate stdarch submodule (to before it switched to const generics)
Joshua Nelson [Fri, 2 Apr 2021 08:11:46 +0000 (04:11 -0400)]
Update stdarch submodule (to before it switched to const generics)

This also includes a cherry-pick of
https://github.com/rust-lang/stdarch/commit/ec1461905b421cf0c56adeebb49bbf55bb33fd17
and https://github.com/rust-lang/stdarch/pull/1108 to fix a build
failure.

It also adds a re-export of various macros to the crate root of libstd -
previously they would show up automatically because std_detect was defined
in the same crate.

3 years agoAuto merge of #82300 - andersk:libtest-id, r=Amanieu
bors [Mon, 12 Apr 2021 13:30:30 +0000 (13:30 +0000)]
Auto merge of #82300 - andersk:libtest-id, r=Amanieu

libtest: Index tests by a unique TestId

This more robustly avoids problems with duplicate `TestDesc`. See #81852 and #82274.

Cc `@Mark-Simulacrum.`

3 years agoAuto merge of #84068 - Amanieu:fix_lint, r=lcnr
bors [Mon, 12 Apr 2021 10:49:39 +0000 (10:49 +0000)]
Auto merge of #84068 - Amanieu:fix_lint, r=lcnr

Add `bad_asm_style` to  HardwiredLints

This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.

3 years agoAuto merge of #84095 - infinity0:master, r=Mark-Simulacrum
bors [Mon, 12 Apr 2021 08:03:59 +0000 (08:03 +0000)]
Auto merge of #84095 - infinity0:master, r=Mark-Simulacrum

bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057

3 years agoStabilize BTree{Map,Set}::retain
Jubilee Young [Mon, 12 Apr 2021 07:01:31 +0000 (00:01 -0700)]
Stabilize BTree{Map,Set}::retain

3 years agoAuto merge of #84090 - marmeladema:stabilize-duration-saturating-ops, r=m-ou-se
bors [Mon, 12 Apr 2021 05:44:25 +0000 (05:44 +0000)]
Auto merge of #84090 - marmeladema:stabilize-duration-saturating-ops, r=m-ou-se

Stabilize feature `duration_saturating_ops`

FCP here: https://github.com/rust-lang/rust/issues/76416#issuecomment-817201314

Closes #76416

r? `@m-ou-se`

3 years agoAuto merge of #84085 - m-ou-se:stabilize-atomic-fetch-update, r=kennytm
bors [Mon, 12 Apr 2021 03:13:33 +0000 (03:13 +0000)]
Auto merge of #84085 - m-ou-se:stabilize-atomic-fetch-update, r=kennytm

Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr.

FCP completed here: https://github.com/rust-lang/rust/issues/78639#issuecomment-817201315

3 years agoAuto merge of #84112 - Dylan-DPC:rollup-tapsrzz, r=Dylan-DPC
bors [Mon, 12 Apr 2021 00:38:20 +0000 (00:38 +0000)]
Auto merge of #84112 - Dylan-DPC:rollup-tapsrzz, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #83669 (Issue 81508 fix)
 - #84014 (Improve trait/impl method discrepancy errors)
 - #84059 (Bump libc dependency of std to 0.2.93)
 - #84067 (clean up example on read_to_string)
 - #84079 (Improve test for `rustdoc::bare_urls` lint)
 - #84094 (Remove FixedSizeArray)
 - #84101 (rustdoc: Move crate loader to collect_intra_doc_links::early )

Failed merges:

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

3 years agoRollup merge of #84101 - jyn514:early-pass, r=Manishearth
Dylan DPC [Sun, 11 Apr 2021 23:04:10 +0000 (01:04 +0200)]
Rollup merge of #84101 - jyn514:early-pass, r=Manishearth

rustdoc: Move crate loader to collect_intra_doc_links::early

This groups the similar code together, and also allows making most of collect_intra_doc_links private again.

This builds on https://github.com/rust-lang/rust/pull/84066, but it wouldn't be too hard to base it off master if you want this to land first.
Helps with https://github.com/rust-lang/rust/issues/83761.

r? manishearth

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

3 years agoRollup merge of #84094 - tmiasko:remove-fixed-size-array, r=m-ou-se
Dylan DPC [Sun, 11 Apr 2021 23:04:09 +0000 (01:04 +0200)]
Rollup merge of #84094 - tmiasko:remove-fixed-size-array, r=m-ou-se

Remove FixedSizeArray

Remove `FixedSizeArray` trait, it has been superseded by const generics.

Closes #27778.

3 years agoRollup merge of #84079 - camelid:improve-bare-urls-test, r=jyn514
Dylan DPC [Sun, 11 Apr 2021 23:04:08 +0000 (01:04 +0200)]
Rollup merge of #84079 - camelid:improve-bare-urls-test, r=jyn514

Improve test for `rustdoc::bare_urls` lint

- Rename `url-improvements` test to `bare-urls`
- Run rustfix for `bare-urls` test

3 years agoRollup merge of #84067 - rust-lang:steveklabnik-patch-1, r=joshtriplett
Dylan DPC [Sun, 11 Apr 2021 23:04:07 +0000 (01:04 +0200)]
Rollup merge of #84067 - rust-lang:steveklabnik-patch-1, r=joshtriplett

clean up example on read_to_string

This is the same thing, but simpler.

This came out of a comment from a user: https://news.ycombinator.com/item?id=25318117 but rather than hide the signature of main, I think a `use` plus not including the `'static` makes more sense.

3 years agoRollup merge of #84059 - zvirja:update-libc, r=JohnTitor
Dylan DPC [Sun, 11 Apr 2021 23:04:06 +0000 (01:04 +0200)]
Rollup merge of #84059 - zvirja:update-libc, r=JohnTitor

Bump libc dependency of std to 0.2.93

Update `libc` dependency of `std` to the latest version. That allows to consume the https://github.com/rust-lang/libc/pull/2131 fix and fix build for the `mipsel-unknown-linux-uclibc` target.

r? `@JohnTitor`

3 years agoRollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkor
Dylan DPC [Sun, 11 Apr 2021 23:04:04 +0000 (01:04 +0200)]
Rollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkor

Improve trait/impl method discrepancy errors

* Use more accurate spans
* Clean up some code by removing previous hack
* Provide structured suggestions

Structured suggestions are particularly useful for cases where arbitrary self types are used, like in custom `Future`s, because the way to write `self: Pin<&mut Self>` is not necessarily self-evident when first encountered.

3 years agoRollup merge of #83669 - kwj2104:issue-81508-fix, r=varkor
Dylan DPC [Sun, 11 Apr 2021 23:04:03 +0000 (01:04 +0200)]
Rollup merge of #83669 - kwj2104:issue-81508-fix, r=varkor

Issue 81508 fix

Fix #81508

**Problem**: When variable name is used incorrectly as path, error and warning point to undeclared/unused name, when in fact the name is used, just incorrectly (should be used as a variable, not part of a path).

**Summary for fix**: When path resolution errs, diagnostics checks for variables in ```ValueNS``` that have the same name (e.g., variable rather than path named Foo), and adds additional suggestion that user may actually intend to use the variable name rather than a path.

The fix does not suppress or otherwise change the *warning* that results. I did not find a straightforward way in the code to modify this, but would love to make changes here as well with any guidance.

3 years agoAuto merge of #84100 - sjakobi:77548-reenable-check, r=jyn514
bors [Sun, 11 Apr 2021 22:11:31 +0000 (22:11 +0000)]
Auto merge of #84100 - sjakobi:77548-reenable-check, r=jyn514

tidy: Re-enable the "ignoring line length unnecessarily" check

Closes #77548.

3 years agoMove crate loader to collect_intra_doc_links::early
Joshua Nelson [Sun, 11 Apr 2021 13:28:03 +0000 (09:28 -0400)]
Move crate loader to collect_intra_doc_links::early

This groups the similar code together, and also allows making most of collect_intra_doc_links private again

3 years agoAuto merge of #83482 - hyd-dev:uwtable, r=nagisa
bors [Sun, 11 Apr 2021 19:50:19 +0000 (19:50 +0000)]
Auto merge of #83482 - hyd-dev:uwtable, r=nagisa

Allow using `-C force-unwind-tables=no` when `panic=unwind`

It seems LLVM still generates proper unwind tables even there is no `uwtable` attribute, unless I looked at the wrong place :thinking::
https://github.com/llvm/llvm-project/blob/c21016715f0ee4a36affdf7150ac135ca98b0eae/llvm/include/llvm/IR/Function.h#L666

Therefore, I *assume* it's safe to omit `uwtable` even when `panic=unwind`, and this PR removes the restriction that disallows using `-C force-unwind-tables=no` when `panic=unwind`.

3 years agoStabilize nonzero_leading_trailing_zeros
Andreas Jonson [Sun, 11 Apr 2021 17:15:55 +0000 (19:15 +0200)]
Stabilize nonzero_leading_trailing_zeros

3 years agostabilize const_cttz
Andreas Jonson [Sun, 11 Apr 2021 16:38:05 +0000 (18:38 +0200)]
stabilize const_cttz

3 years agotidy: Re-enable the "ignoring file length unnecessarily" check
Simon Jakobi [Sun, 11 Apr 2021 14:38:13 +0000 (16:38 +0200)]
tidy: Re-enable the "ignoring file length unnecessarily" check

Closes #77548.

3 years agoAllow using `-C force-unwind-tables=no` when `panic=unwind`
hyd-dev [Thu, 25 Mar 2021 10:49:35 +0000 (18:49 +0800)]
Allow using `-C force-unwind-tables=no` when `panic=unwind`

3 years agoAdd test to allow bad_asm_style
Amanieu d'Antras [Sun, 11 Apr 2021 14:11:02 +0000 (15:11 +0100)]
Add test to allow bad_asm_style

3 years agobootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
Ximin Luo [Sun, 11 Apr 2021 13:02:28 +0000 (14:02 +0100)]
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057