]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #85670 - m-ou-se:array-intoiter-1, r=scottmcm
Dylan DPC [Wed, 26 May 2021 11:32:09 +0000 (13:32 +0200)]
Rollup merge of #85670 - m-ou-se:array-intoiter-1, r=scottmcm

Remove arrays/IntoIterator message from Iterator trait.

Arrays implement IntoIterator since 1.53.

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

3 years agoRollup merge of #85633 - lqd:stackless_span_stacks, r=oli-obk
Dylan DPC [Wed, 26 May 2021 11:32:08 +0000 (13:32 +0200)]
Rollup merge of #85633 - lqd:stackless_span_stacks, r=oli-obk

Post-monomorphization errors traces MVP

This PR works towards better diagnostics for the errors encountered in #85155 and similar.

We can encounter post-monomorphization errors (PMEs) when collecting mono items. The current diagnostics are confusing for these cases when they happen in a dependency (but are acceptable when they happen in the local crate).

These kinds of errors will be more likely now that `stdarch` uses const generics for its intrinsics' immediate arguments, and validates these const arguments with a mechanism that triggers such PMEs.

(Not to mention that the errors happen during codegen, so only when building code that actually uses these code paths. Check builds don't trigger them, neither does unused code)

So in this PR, we detect these kinds of errors during the mono item graph walk: if any error happens while collecting a node or its neighbors, we print a diagnostic about the current collection step, so that the user has at least some context of which erroneous code and dependency triggered the error.

The diagnostics for issue #85155 now have this note showing the source of the erroneous const argument:
```
note: the above error was encountered while instantiating `fn std::arch::x86_64::_mm_blend_ps::<51_i32>`
  --> issue-85155.rs:11:24
   |
11 |         let _blended = _mm_blend_ps(a, b, 0x33);
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
```

Note that #85155 is a reduced version of a case happening in the wild, to indirect users of the `rustfft` crate, as seen in https://github.com/ejmahler/RustFFT/issues/74. The crate had a few of these out-of-range immediates. Here's how the diagnostics in this PR would have looked on one of its examples before it was fixed:

<details>

```
error[E0080]: evaluation of constant value failed
 --> ./stdarch/crates/core_arch/src/macros.rs:8:9
  |
8 |         assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range");
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'IMM value not in expected range', ./stdarch/crates/core_arch/src/macros.rs:8:9
  |
  = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

note: the above error was encountered while instantiating `fn _mm_blend_ps::<51_i32>`
    --> /tmp/RustFFT/src/avx/avx_vector.rs:1314:23
     |
1314 |         let blended = _mm_blend_ps(rows[0], rows[2], 0x33);
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn _mm_permute_pd::<5_i32>`
    --> /tmp/RustFFT/src/avx/avx_vector.rs:1859:9
     |
1859 |         _mm_permute_pd(self, 0x05)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn _mm_permute_pd::<15_i32>`
    --> /tmp/RustFFT/src/avx/avx_vector.rs:1863:32
     |
1863 |         (_mm_movedup_pd(self), _mm_permute_pd(self, 0x0F))
     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
error: could not compile `rustfft`

To learn more, run the command again with --verbose.
```

</details>

I've developed and discussed this with them, so maybe r? `@oli-obk` -- but feel free to redirect to someone else of course.

(I'm not sure we can say that this PR definitely closes issue 85155, as it's still unclear exactly which diagnostics and information would be interesting to report in such cases -- and we've discussed printing backtraces before. I have prototypes of some complete and therefore noisy backtraces I showed Oli, but we decided to not include them in this PR for now)

3 years agoRollup merge of #85627 - LeSeulArtichaut:thir-unsafe-fn-lint, r=nikomatsakis
Dylan DPC [Wed, 26 May 2021 11:32:07 +0000 (13:32 +0200)]
Rollup merge of #85627 - LeSeulArtichaut:thir-unsafe-fn-lint, r=nikomatsakis

Fix a few details in THIR unsafeck

This makes it consistent with RFC 2585 (`unsafe_op_in_unsafe_fn`) and with the MIR unsafeck.

r? `@nikomatsakis`

3 years agoRollup merge of #85625 - SkiFire13:fix-85613-vec-dedup-drop-panics, r=nagisa
Dylan DPC [Wed, 26 May 2021 11:32:06 +0000 (13:32 +0200)]
Rollup merge of #85625 - SkiFire13:fix-85613-vec-dedup-drop-panics, r=nagisa

Prevent double drop in `Vec::dedup_by` if a destructor panics

Fixes #85613

3 years agoRollup merge of #85478 - FabianWolff:issue-85348, r=petrochenkov
Dylan DPC [Wed, 26 May 2021 11:32:05 +0000 (13:32 +0200)]
Rollup merge of #85478 - FabianWolff:issue-85348, r=petrochenkov

Disallow shadowing const parameters

This pull request fixes #85348. Trying to shadow a `const` parameter as follows:
```rust
fn foo<const N: i32>() {
    let N @ _ = 0;
}
```
currently causes an ICE. With my changes, I get:
```
error[E0530]: let bindings cannot shadow const parameters
 --> test.rs:2:9
  |
1 | fn foo<const N: i32>() {
  |              - the const parameter `N` is defined here
2 |     let N @ _ = 0;
  |         ^ cannot be named the same as a const parameter

error: aborting due to previous error
```
This is the same error you get when trying to shadow a constant:
```rust
const N: i32 = 0;
let N @ _ = 0;
```
```
error[E0530]: let bindings cannot shadow constants
 --> src/lib.rs:3:5
  |
2 | const N: i32 = 0;
  | ----------------- the constant `N` is defined here
3 | let N @ _ = 0;
  |     ^ cannot be named the same as a constant

error: aborting due to previous error
```
The reason for disallowing shadowing in both cases is described [here](https://github.com/rust-lang/rust/issues/33118#issuecomment-233962221) (the comment there only talks about constants, but the same reasoning applies to `const` parameters).

3 years agoAuto merge of #85711 - JohnTitor:rollup-8why04t, r=JohnTitor
bors [Wed, 26 May 2021 07:10:44 +0000 (07:10 +0000)]
Auto merge of #85711 - JohnTitor:rollup-8why04t, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #84048 (Avoid CJK legacy fonts in Windows)
 - #85529 (doc: clarify Mutex::try_lock, etc. errors)
 - #85590 (Fix bootstrap using host exe suffix for cargo)
 - #85610 (Fix pointer provenance in <[T]>::copy_within)
 - #85623 (Remove stray .stderr files)
 - #85645 (Demote `ControlFlow::{from|into}_try` to `pub(crate)`)
 - #85647 (Revert "Move llvm submodule updates to rustbuild")
 - #85666 (Document shared_from_cow functions)
 - #85668 (Fix tasklist example in rustdoc book.)
 - #85672 (Move stability attribute for items under the `ip` feature)
 - #85699 (Update books)
 - #85701 (Update cargo)

Failed merges:

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

3 years agoRollup merge of #85701 - ehuss:update-cargo, r=ehuss
Yuki Okushi [Wed, 26 May 2021 04:31:09 +0000 (13:31 +0900)]
Rollup merge of #85701 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in 070e459c2d8b79c5b2ac5218064e7603329c92ae..e931e4796b61de593aa1097649445e535c9c7ee0
2021-05-11 18:12:23 +0000 to 2021-05-24 16:17:27 +0000
- Add `cargo:rustc-link-arg-bin` flag. (rust-lang/cargo#9486)
- Add a cargo-doc.browser config option (rust-lang/cargo#9473)
- Fix bug when with resolver = "1" non-virtual package was allowing unknown features (rust-lang/cargo#9437)
- Add GitHub link to contributor guide. (rust-lang/cargo#9493)
- Add temporary fix for rustup on windows in CI. (rust-lang/cargo#9498)
- 3 typos and some capitalization (rust-lang/cargo#9495)
- fix 6 typos (rust-lang/cargo#9484)

3 years agoRollup merge of #85699 - ehuss:update-books, r=ehuss
Yuki Okushi [Wed, 26 May 2021 04:31:08 +0000 (13:31 +0900)]
Rollup merge of #85699 - ehuss:update-books, r=ehuss

Update books

## reference

4 commits in 5aa457bf1b54bd2cd5d4cf49797f29299bdf89a7..9c68af3ce6ccca2395e1868addef26a0542e9ddd
2021-05-05 08:39:22 -0700 to 2021-05-24 09:53:32 -0700
- missing parameter name in Trait Implementations (rust-lang-nursery/reference#1030)
- Add more content to impl-trait.md (rust-lang-nursery/reference#1017)
- Document extended key-value attributes (rust-lang-nursery/reference#1029)
- Document raw pointer &lt;-&gt; usize casts. (rust-lang-nursery/reference#970)

## rust-by-example

1 commits in 5f8c6da200ada77760a2fe1096938ef58151c9a6..805e016c5792ad2adabb66e348233067d5ea9f10
2021-04-29 08:08:01 -0300 to 2021-05-20 17:08:34 -0300
- Update structs.md (rust-lang/rust-by-example#1440)

## rustc-dev-guide

4 commits in 1e6c7fbda4c45e85adf63ff3f82fa9c870b1447f..50de7f0682adc5d95ce858fe6318d19b4b951553
2021-05-10 13:38:24 +0900 to 2021-05-20 15:02:20 +0200
- update rustfmt references to reflect change from submod to subtree (rust-lang/rustc-dev-guide#1129)
- Remove `--stage 1` argument from `doc` invocations (rust-lang/rustc-dev-guide#1125)
- Update coverage docs (rust-lang/rustc-dev-guide#1122)
- Document -Zunpretty=thir-tree (rust-lang/rustc-dev-guide#1128)

## edition-guide

1 commits in 1da3c411f17adb1ba5de1683bb6acee83362b54a..302a115e8f71876dfc884aebb0ca5ccb02b8a962
2021-02-16 16:46:40 -0800 to 2021-05-21 10:46:11 -0400
- Minimize the edition guide (rust-lang/edition-guide#232)

## embedded-book

1 commits in 569c3391f5c0cc43433bc77831d17f8ff4d76602..7349d173fa28a0bb834cf0264a05286620ef0923
2021-04-07 08:32:11 +0000 to 2021-05-25 13:59:05 +0000
- Remove $ from cargo-binutils  (rust-embedded/book#292)

3 years agoRollup merge of #85672 - CDirkx:ip, r=Mark-Simulacrum
Yuki Okushi [Wed, 26 May 2021 04:31:07 +0000 (13:31 +0900)]
Rollup merge of #85672 - CDirkx:ip, r=Mark-Simulacrum

Move stability attribute for items under the `ip` feature

The `#[unstable]` attribute for items under the `ip` feature is currently located on the `std::net::ip` module itself. This is unusual, and less readable. This has sidetracked discussion about these items numerous times (https://github.com/rust-lang/rust/pull/60145#issuecomment-498016572, https://github.com/rust-lang/rust/pull/76098#discussion_r530463543, https://github.com/rust-lang/rust/pull/76098#discussion_r558067755, https://github.com/rust-lang/rust/pull/75019#discussion_r467464300, https://github.com/rust-lang/rust/pull/75019#issuecomment-672888727) and lead to incorrect assumptions about which items are actually stable (https://github.com/rust-lang/rust/pull/60145#issuecomment-485970669, https://github.com/rust-lang/rust/pull/76098#discussion_r530444275).

This PR moves the attribute from the module to the items themselves.

3 years agoRollup merge of #85668 - ehuss:fix-rustdoc-tasklist, r=Mark-Simulacrum
Yuki Okushi [Wed, 26 May 2021 04:31:05 +0000 (13:31 +0900)]
Rollup merge of #85668 - ehuss:fix-rustdoc-tasklist, r=Mark-Simulacrum

Fix tasklist example in rustdoc book.

There were a few issues with the tasklist example in the rustdoc book:

* Misspelled "incomplete"
* Checkmarks were backwards
* Didn't show the text for each item
* Used HTML which renders differently from how markdown renders it (which uses "disabled" marks)
* Didn't use blockquotes to offset the example like the other extensions do
* Missing a colon

Before:
<img width="160" alt="image" src="https://user-images.githubusercontent.com/43198/119503519-e7787880-bd1f-11eb-9f13-1c67754ce001.png">

After:
<img width="220" alt="image" src="https://user-images.githubusercontent.com/43198/119503449-d6c80280-bd1f-11eb-9ab5-fe4a6df82124.png">

3 years agoRollup merge of #85666 - fee1-dead:document-shared-from-cow, r=dtolnay
Yuki Okushi [Wed, 26 May 2021 04:31:04 +0000 (13:31 +0900)]
Rollup merge of #85666 - fee1-dead:document-shared-from-cow, r=dtolnay

Document shared_from_cow functions

3 years agoRollup merge of #85647 - rust-lang:revert-81601-llvm-on-demand, r=jyn514
Yuki Okushi [Wed, 26 May 2021 04:31:03 +0000 (13:31 +0900)]
Rollup merge of #85647 - rust-lang:revert-81601-llvm-on-demand, r=jyn514

Revert "Move llvm submodule updates to rustbuild"

Reverts rust-lang/rust#81601

This updates LLVM a bit too eagerly -- and particularly on Windows, this can be slow. See discussion on [Zulip].

[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/x.2Epy.20always.20updates.20LLVM.20submodule

3 years agoRollup merge of #85645 - scottmcm:demote-from-into-try, r=yaahc
Yuki Okushi [Wed, 26 May 2021 04:31:02 +0000 (13:31 +0900)]
Rollup merge of #85645 - scottmcm:demote-from-into-try, r=yaahc

Demote `ControlFlow::{from|into}_try` to `pub(crate)`

They have mediocre names and non-obvious semantics, so personally I don't think they're worth trying to stabilize, and thus might as well just be internal (they're used for convenience in iterator adapters), not something shown in the rustdocs.

I don't think anyone actually wanted to use them outside `core` -- they just got made public-but-unstable along with the whole type in https://github.com/rust-lang/rust/pull/76204 that promoted `LoopState` from an internal type to the exposed `ControlFlow` type.

cc https://github.com/rust-lang/rust/issues/75744, the tracking issue they mention.
cc https://github.com/rust-lang/rust/pull/85608, the PR where I'm proposing stabilizing the type.

3 years agoRollup merge of #85623 - LeSeulArtichaut:stray-stderr, r=Mark-Simulacrum
Yuki Okushi [Wed, 26 May 2021 04:31:01 +0000 (13:31 +0900)]
Rollup merge of #85623 - LeSeulArtichaut:stray-stderr, r=Mark-Simulacrum

Remove stray .stderr files

The revisions for the test were [changed in #85555](https://github.com/rust-lang/rust/pull/85555/files#diff-f353939cf3762b63a04bae4d9c1c919039b64351bc4d8722ad894509f6015b0f) but the files weren't deleted.

3 years agoRollup merge of #85610 - SkiFire13:fix-copy-within-provenance, r=oli-obk
Yuki Okushi [Wed, 26 May 2021 04:31:00 +0000 (13:31 +0900)]
Rollup merge of #85610 - SkiFire13:fix-copy-within-provenance, r=oli-obk

Fix pointer provenance in <[T]>::copy_within

Previously the `self.as_mut_ptr()` invalidated the pointer created by the first `self.as_ptr()`. This also triggered miri when run with `-Zmiri-track-raw-pointers`

3 years agoRollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=Mark-Simulacrum
Yuki Okushi [Wed, 26 May 2021 04:30:59 +0000 (13:30 +0900)]
Rollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=Mark-Simulacrum

Fix bootstrap using host exe suffix for cargo

When attempting to cross compile rustc (for example, from Linux to Windows) and tell it to build cargo/tools, the following error occurs:

```
thread 'main' panicked at 'src.symlink_metadata() failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1196:24
```

Relevant part of stack trace:
<details>

```
   2: bootstrap::Build::copy
             at ./src/bootstrap/lib.rs:1196:24
   3: <bootstrap::tool::ToolBuild as bootstrap::builder::Step>::run
             at ./src/bootstrap/tool.rs:220:13
```
</details>

If I add `-vvv` (which seemed to be the recommended course for debugging a similar issue according to [zulip logs](https://zulip-archive.rust-lang.org/182449tcompilerhelp/19655failedtobootstrap.html)), it shows:

```
Copy ".../rust/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-pc-windows-gnu/release/cargo" to ".../rust/build/x86_64-unknown-linux-gnu/stage2-tools-bin/cargo"
```
and when taking a look at the contents of `build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-pc-windows-gnu/release` it contains `cargo.exe`, but no `cargo`.

I tried to study the surrounding code to make sure this was the intended behavior and while I can't be 100% certain, it does seem that using the exe suffix for the `compiler.host` target instead of the `target` target won't have the desired behavior when cross-compiling to/from Windows.

3 years agoRollup merge of #85529 - tlyu:trylock-errors, r=JohnTitor
Yuki Okushi [Wed, 26 May 2021 04:30:58 +0000 (13:30 +0900)]
Rollup merge of #85529 - tlyu:trylock-errors, r=JohnTitor

doc: clarify Mutex::try_lock, etc. errors

Clarify error returns from Mutex::try_lock, RwLock::try_read,
RwLock::try_write to make it more obvious that both poisoning
and the lock being already locked are possible errors.

3 years agoRollup merge of #84048 - konan8205:master, r=jsha
Yuki Okushi [Wed, 26 May 2021 04:30:54 +0000 (13:30 +0900)]
Rollup merge of #84048 - konan8205:master, r=jsha

Avoid CJK legacy fonts in Windows

As metioned in #84035, the default serif CJK font in Windows is meh-looking.
To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.

3 years agoAuto merge of #85252 - kulikjak:fix-solaris-CI, r=Mark-Simulacrum
bors [Wed, 26 May 2021 04:27:23 +0000 (04:27 +0000)]
Auto merge of #85252 - kulikjak:fix-solaris-CI, r=Mark-Simulacrum

Bring back `x86_64-sun-solaris` target to rustup

Change #82216 removed now deprecated target `x86_64-sun-solaris` from CI, thus making it no longer possible to use `$ rustup target add x86_64-sun-solaris` to install given target (see #85098 for details). Since there should be a period of time between the deprecation and removal, this PR brings it back (while keeping the new one as well).

Please, correct me if I am wrong; my assumption that these Docker scripts are being used to build artifacts later used by `rustup` might be incorrect.

Closes #85098.

3 years agoAuto merge of #85535 - dtolnay:weakdangle, r=kennytm
bors [Wed, 26 May 2021 01:17:02 +0000 (01:17 +0000)]
Auto merge of #85535 - dtolnay:weakdangle, r=kennytm

Weak's type parameter may dangle on drop

Way back in https://github.com/rust-lang/rust/commit/34076bc0c9fb9ee718e1cebc407547eef730a080, #\[may_dangle\] was added to Rc\<T\> and Arc\<T\>'s Drop impls. That appears to have been because a test added in #28929 used Arc and Rc with dangling references at drop time. However, Weak was not covered by that test, and therefore no #\[may_dangle\] was forced to be added at the time.

As far as dropping, Weak has *even less need* to interact with the T than Rc and Arc do. Roughly speaking #\[may_dangle\] describes generic parameters that the outer type's Drop impl does not interact with except by possibly dropping them; no other interaction (such as trait method calls on the generic type) is permissible. It's clear this applies to Rc's and Arc's drop impl, which sometimes drop T but otherwise do not interact with one. It applies *even more* to Weak. Dropping a Weak cannot ever cause T's drop impl to run. Either there are strong references still in existence, in which case better not drop the T. Or there are no strong references still in existence, in which case the T would already have been dropped previously by the drop of the last strong count.

3 years agoUpdate cargo
Eric Huss [Tue, 25 May 2021 23:08:54 +0000 (16:08 -0700)]
Update cargo

3 years agoUpdate books
Eric Huss [Tue, 25 May 2021 22:03:01 +0000 (15:03 -0700)]
Update books

3 years agoRun THIR unsafeck on `unsafe_op_in_unsafe_fn` test
LeSeulArtichaut [Mon, 24 May 2021 10:55:01 +0000 (12:55 +0200)]
Run THIR unsafeck on `unsafe_op_in_unsafe_fn` test

3 years agoFix `unused_unsafe` in THIR unsafeck
LeSeulArtichaut [Mon, 24 May 2021 10:54:26 +0000 (12:54 +0200)]
Fix `unused_unsafe` in THIR unsafeck

3 years agoHandle `unsafe_op_in_unsafe_fn` properly in THIR unsafeck
LeSeulArtichaut [Mon, 24 May 2021 10:43:51 +0000 (12:43 +0200)]
Handle `unsafe_op_in_unsafe_fn` properly in THIR unsafeck

3 years agoadd test for issue 85155 and similar
Rémy Rakic [Mon, 24 May 2021 14:16:56 +0000 (16:16 +0200)]
add test for issue 85155 and similar

This test reproduces post-monomorphization errors one can encounter
when using incorrect immediate arguments to some of the stdarch
intrinsics using const generics.

3 years agoemit diagnostic after post-monomorphization errors
Rémy Rakic [Sun, 16 May 2021 10:34:42 +0000 (12:34 +0200)]
emit diagnostic after post-monomorphization errors

Emit a diagnostic when the monomorphized item collector
encounters errors during a step of the recursive item collection.

These post-monomorphization errors otherwise only show the
erroneous expression without a trace, making them very obscure
and hard to pinpoint whenever they happen in dependencies.

3 years agoMove stability attribute for methods under the `ip` feature from the module to the...
Christiaan Dirkx [Tue, 25 May 2021 13:57:27 +0000 (15:57 +0200)]
Move stability attribute for methods under the `ip` feature from the module to the methods themselves

3 years agoAuto merge of #85481 - lcnr:const-equate, r=matthewjasper
bors [Tue, 25 May 2021 13:53:48 +0000 (13:53 +0000)]
Auto merge of #85481 - lcnr:const-equate, r=matthewjasper

deal with `const_evaluatable_checked` in `ConstEquate`

Failing to evaluate two constants which do not contain inference variables should not result in ambiguity.

3 years agoRemove arrays/IntoIterator message from Iterator trait.
Mara Bos [Tue, 25 May 2021 13:48:14 +0000 (15:48 +0200)]
Remove arrays/IntoIterator message from Iterator trait.

3 years agoFix tasklist example in rustdoc book.
Eric Huss [Tue, 25 May 2021 13:04:22 +0000 (06:04 -0700)]
Fix tasklist example in rustdoc book.

3 years agoDocument shared_from_cow functions
Deadbeef [Tue, 25 May 2021 12:06:02 +0000 (20:06 +0800)]
Document shared_from_cow functions

3 years agoAuto merge of #85664 - GuillaumeGomez:rollup-o7qgo8c, r=GuillaumeGomez
bors [Tue, 25 May 2021 11:12:47 +0000 (11:12 +0000)]
Auto merge of #85664 - GuillaumeGomez:rollup-o7qgo8c, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #85361 (Use TargetTriple::from_path in rustdoc)
 - #85605 (Replace Local::new(1) with CAPTURE_STRUCT_LOCAL)
 - #85631 (Move keyword primitive css dom)
 - #85644 (Better English for documenting when to use unimplemented!())
 - #85650 (Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs)
 - #85657 (Remove doubled braces in non_exhaustive structs’ documentation text.)

Failed merges:

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

3 years agoRollup merge of #85657 - kpreid:brackets, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:17 +0000 (13:05 +0200)]
Rollup merge of #85657 - kpreid:brackets, r=jyn514

Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b806878549990d2ad2aa3c265751d3d89947cdf (part of Rust 1.52.1) many calls to `write!(w,` were replaced with `w.write_str(`, but this one contained braces that were doubled to escape them when taken as a format string, and so changing the call without changing the text caused them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any other occurrences of this mistake and I did not find any.

3 years agoRollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:16 +0000 (13:05 +0200)]
Rollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514

Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

See https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/adjustment/struct.Adjustment.html

3 years agoRollup merge of #85644 - tialaramex:master, r=dtolnay
Guillaume Gomez [Tue, 25 May 2021 11:05:15 +0000 (13:05 +0200)]
Rollup merge of #85644 - tialaramex:master, r=dtolnay

Better English for documenting when to use unimplemented!()

I don't think "plan of using" is correct here. I considered "plan on using" but eventually decided "plan to use" is better.

3 years agoRollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha
Guillaume Gomez [Tue, 25 May 2021 11:05:14 +0000 (13:05 +0200)]
Rollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha

Move keyword primitive css dom

Fixes #85569.

r? ``@jsha``

3 years agoRollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper
Guillaume Gomez [Tue, 25 May 2021 11:05:14 +0000 (13:05 +0200)]
Rollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper

Replace Local::new(1) with CAPTURE_STRUCT_LOCAL

3 years agoRollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:09 +0000 (13:05 +0200)]
Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514

Use TargetTriple::from_path in rustdoc

This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.

3 years agoUpdate keyword GUI test
Guillaume Gomez [Mon, 24 May 2021 12:29:57 +0000 (14:29 +0200)]
Update keyword GUI test

3 years agoMove extra search result information for keywords and primitives from CSS to DOM
Guillaume Gomez [Mon, 24 May 2021 12:24:34 +0000 (14:24 +0200)]
Move extra search result information for keywords and primitives from CSS to DOM

3 years agoAuto merge of #85634 - RalfJung:miri, r=RalfJung
bors [Tue, 25 May 2021 08:31:56 +0000 (08:31 +0000)]
Auto merge of #85634 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoAuto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum
bors [Tue, 25 May 2021 05:48:00 +0000 (05:48 +0000)]
Auto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum

Bump bootstrap compiler to beta 1.53.0

This PR bumps the bootstrap compiler to version 1.53.0 beta, as part of our usual release process (this was supposed to be Wednesday's step, but creating the beta release took longer than expected).

The PR also includes the "Bootstrap: skip rustdoc fingerprint for building docs" commit, see the reasoning [on Zulip](https://zulip-archive.rust-lang.org/241545trelease/88450153betabootstrap.html).

r? `@Mark-Simulacrum`

3 years agoRemove doubled braces in non_exhaustive structs’ documentation text.
Kevin Reid [Tue, 25 May 2021 03:47:10 +0000 (20:47 -0700)]
Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b806878549990d2ad2aa3c265751d3d89947cdf (part of Rust 1.52.1)
many calls to `write!(w,` were replaced with `w.write_str(`, but this
one contained braces that were doubled to escape them when taken as a
format string, and so changing the call without changing the text caused
them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any
other occurrences of this mistake and I did not find any.

3 years agoAuto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis
bors [Tue, 25 May 2021 03:07:03 +0000 (03:07 +0000)]
Auto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis

Make building THIR a stealable query

This PR creates a stealable `thir_body` query so that we can build the THIR only once for THIR unsafeck and MIR build.

Blocked on #83842.
r? `@nikomatsakis`

3 years agoAdd some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs
Scott McMurray [Mon, 24 May 2021 22:47:28 +0000 (15:47 -0700)]
Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

3 years agoRevert "Move llvm submodule updates to rustbuild"
Mark Rousskov [Mon, 24 May 2021 21:52:18 +0000 (17:52 -0400)]
Revert "Move llvm submodule updates to rustbuild"

3 years agoDemote ControlFlow::{from|into}_try to pub(crate)
Scott McMurray [Mon, 24 May 2021 21:29:44 +0000 (14:29 -0700)]
Demote ControlFlow::{from|into}_try to pub(crate)

3 years agoBetter English for documenting when to use unimplemented!()
Nick Lamb [Mon, 24 May 2021 21:21:05 +0000 (22:21 +0100)]
Better English for documenting when to use unimplemented!()

3 years agoAuto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez
bors [Mon, 24 May 2021 18:05:35 +0000 (18:05 +0000)]
Auto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #85271 (Fix indentation in move keyword documentation)
 - #85551 (Fix search results display)
 - #85621 (Restore sans-serif font for module items.)
 - #85628 (Replace more "NULL" with "null")

Failed merges:

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

3 years agoAdd test
bjorn3 [Sun, 16 May 2021 16:41:54 +0000 (18:41 +0200)]
Add test

3 years agoUse parse_target_triple in rustdoc
bjorn3 [Sun, 16 May 2021 13:35:10 +0000 (15:35 +0200)]
Use parse_target_triple in rustdoc

3 years agoRollup merge of #85628 - LeSeulArtichaut:thir-null-lowercase, r=estebank
Guillaume Gomez [Mon, 24 May 2021 16:53:37 +0000 (18:53 +0200)]
Rollup merge of #85628 - LeSeulArtichaut:thir-null-lowercase, r=estebank

Replace more "NULL" with "null"

Error messages in THIR unsafeck still contain "NULL", make them lowercase to be consistent with MIR unsafeck (cc #84842).

3 years agoRollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomez
Guillaume Gomez [Mon, 24 May 2021 16:53:36 +0000 (18:53 +0200)]
Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomez

Restore sans-serif font for module items.

This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).

Fixes #85616.
Fixes https://github.com/rust-lang/rust/issues/85545.

r? `@camelid`

3 years agoRollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jsha
Guillaume Gomez [Mon, 24 May 2021 16:53:35 +0000 (18:53 +0200)]
Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jsha

Fix search results display

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

cc `@dns2utf8`

r? `@jsha`

3 years agoRollup merge of #85271 - th1000s:master, r=JohnTitor
Guillaume Gomez [Mon, 24 May 2021 16:53:29 +0000 (18:53 +0200)]
Rollup merge of #85271 - th1000s:master, r=JohnTitor

Fix indentation in move keyword documentation

See (at the time of writing) the second example code block with `create_fn()` at https://doc.rust-lang.org/std/keyword.move.html

3 years agoAuto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank
bors [Mon, 24 May 2021 15:24:38 +0000 (15:24 +0000)]
Auto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank

Extend `rustc_on_implemented` to improve more `?` error messages

`_Self` could match the generic definition; this adds that functionality for matching the generic definition of type parameters too.

Your advice welcome on the wording of all these messages, and which things belong in the message/label/note.

r? `@estebank`

3 years agoupdate Miri
Ralf Jung [Mon, 24 May 2021 15:17:45 +0000 (17:17 +0200)]
update Miri

3 years agoremove cfg(bootstrap)
Pietro Albini [Thu, 6 May 2021 11:36:07 +0000 (13:36 +0200)]
remove cfg(bootstrap)

3 years agoBootstrap: skip rustdoc fingerprint for building docs.
Eric Huss [Tue, 27 Apr 2021 22:08:14 +0000 (15:08 -0700)]
Bootstrap: skip rustdoc fingerprint for building docs.

3 years agobootstrap from 1.54.0 beta
Pietro Albini [Thu, 6 May 2021 07:58:32 +0000 (09:58 +0200)]
bootstrap from 1.54.0 beta

3 years agominor rewording after review
Taylor Yu [Mon, 24 May 2021 14:24:35 +0000 (09:24 -0500)]
minor rewording after review

Use "the `WouldBlock` error" instead of "the error `WouldBlock`", etc.

3 years agoMake `thir_check_unsafety` itself responsible for checking gate
LeSeulArtichaut [Mon, 24 May 2021 13:09:33 +0000 (15:09 +0200)]
Make `thir_check_unsafety` itself responsible for checking gate

3 years agoAdd comments about stealing THIR in `mir_build`
LeSeulArtichaut [Mon, 24 May 2021 13:05:20 +0000 (15:05 +0200)]
Add comments about stealing THIR in `mir_build`

3 years agoAuto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink
bors [Mon, 24 May 2021 12:43:47 +0000 (12:43 +0000)]
Auto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoReplace more "NULL" with "null"
LeSeulArtichaut [Mon, 24 May 2021 10:59:33 +0000 (12:59 +0200)]
Replace more "NULL" with "null"

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 24 May 2021 10:56:09 +0000 (13:56 +0300)]
:arrow_up: rust-analyzer

3 years agoMake Vec::dedup panicking test actually detect double panics
Giacomo Stevanato [Mon, 24 May 2021 10:42:04 +0000 (12:42 +0200)]
Make Vec::dedup panicking test actually detect double panics

3 years agoAvoid a double drop in Vec::dedup if a destructor panics
Giacomo Stevanato [Mon, 24 May 2021 10:41:13 +0000 (12:41 +0200)]
Avoid a double drop in Vec::dedup if a destructor panics

3 years agoAuto merge of #85601 - klensy:padint-example-fix, r=dtolnay
bors [Mon, 24 May 2021 10:02:55 +0000 (10:02 +0000)]
Auto merge of #85601 - klensy:padint-example-fix, r=dtolnay

fix pad_integral example

pad_integral's parameter `is_nonnegative - whether the original integer was either positive or zero`, but in example it checked as `self.nb > 0`, so it previously printed `-0` for `format!("{}", Foo::new(0)`, what is wrong.

3 years agoRemove stray .stderr files
LeSeulArtichaut [Mon, 24 May 2021 08:50:51 +0000 (10:50 +0200)]
Remove stray .stderr files

3 years agoAuto merge of #85515 - jedel1043:fix-85480, r=petrochenkov
bors [Mon, 24 May 2021 05:39:07 +0000 (05:39 +0000)]
Auto merge of #85515 - jedel1043:fix-85480, r=petrochenkov

Fix ast pretty printing for anonymous types

Fixes #85480.

3 years agoRestore sans-serif font for module items.
Jacob Hoffman-Andrews [Mon, 24 May 2021 05:28:19 +0000 (22:28 -0700)]
Restore sans-serif font for module items.

This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).

3 years agoAdd test for pretty printing anonymous types
jedel1043 [Fri, 21 May 2021 16:45:55 +0000 (11:45 -0500)]
Add test for pretty printing anonymous types

3 years agoFix ast expanded printing for anonymous types
jedel1043 [Thu, 20 May 2021 15:06:11 +0000 (10:06 -0500)]
Fix ast expanded printing for anonymous types

3 years agoAuto merge of #85611 - rust-lang:array-mod-doc, r=jyn514
bors [Mon, 24 May 2021 01:53:53 +0000 (01:53 +0000)]
Auto merge of #85611 - rust-lang:array-mod-doc, r=jyn514

Update std::array module doc header

This line is very outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.

3 years agoAuto merge of #85606 - 12101111:link_modifiers, r=petrochenkov
bors [Sun, 23 May 2021 22:06:53 +0000 (22:06 +0000)]
Auto merge of #85606 - 12101111:link_modifiers, r=petrochenkov

remove native_link_modifiers from the list of incomplete features.

These features are fully implemented and not incomplete.
The tracking issue of them is https://github.com/rust-lang/rust/issues/81490.
The implement PR is https://github.com/rust-lang/rust/pull/83507.

3 years agoDon't reborrow self when computing the dest pointer in <[T]>::copy_within
Giacomo Stevanato [Sun, 23 May 2021 19:43:11 +0000 (21:43 +0200)]
Don't reborrow self when computing the dest pointer in <[T]>::copy_within

3 years agoUpdate std::array module doc header
bstrie [Sun, 23 May 2021 19:55:27 +0000 (15:55 -0400)]
Update std::array module doc header

Extremely outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.

3 years agoAuto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov
bors [Sun, 23 May 2021 19:42:19 +0000 (19:42 +0000)]
Auto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov

native lib: defer the duplicate check after relevant_lib check.

https://github.com/rust-lang/rust/pull/84794 break code using conditional-compilation with `#[link]` attributes.

```rust
#[cfg(target_env = "musl")]
cfg_if::cfg_if! {
    if #[cfg(any(target_feature = "crt-static", feature = "llvm-libunwind"))] {
        #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
        extern "C" {}
    } else {
        #[link(name = "unwind", cfg(feature = "system-llvm-libunwind"))]
        #[link(name = "gcc_s", cfg(not(feature = "system-llvm-libunwind")))]
        extern "C" {}
    }
}

```

3 years agoAuto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jsha
bors [Sun, 23 May 2021 17:13:51 +0000 (17:13 +0000)]
Auto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jsha

Don't hide inherent implementations by default

Fixes a regression introduced in #85575.

r? `@jsha`

3 years agoremove native_link_modifiers from the list of incomplete features.
12101111 [Sun, 23 May 2021 16:36:55 +0000 (00:36 +0800)]
remove native_link_modifiers from the list of incomplete features.

3 years agoReplace Local::new(1) with CAPTURE_STRUCT_LOCAL
Paul Trojahn [Fri, 21 May 2021 19:01:27 +0000 (21:01 +0200)]
Replace Local::new(1) with CAPTURE_STRUCT_LOCAL

3 years agoAuto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpider
bors [Sun, 23 May 2021 14:54:14 +0000 (14:54 +0000)]
Auto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpider

rustdoc: render `<Self as X>::Y` type casts properly

Rustdoc didn't render any `<Self as X>` casts which causes invalid code inside the documentation. This is fixed by this PR by checking if the target type `X` is different from `Self`, and if so, it will render a typecast.

Resolves #85454

3 years agoExtend rustc_on_implemented to improve a ?-on-ControlFlow error message
Scott McMurray [Sun, 23 May 2021 06:47:12 +0000 (23:47 -0700)]
Extend rustc_on_implemented to improve a ?-on-ControlFlow error message

3 years agoDon't hide inherent implementations by default
Guillaume Gomez [Sun, 23 May 2021 12:33:50 +0000 (14:33 +0200)]
Don't hide inherent implementations by default

3 years agoAuto merge of #85599 - RalfJung:immut-allocs, r=oli-obk
bors [Sun, 23 May 2021 12:05:47 +0000 (12:05 +0000)]
Auto merge of #85599 - RalfJung:immut-allocs, r=oli-obk

fix deallocation of immutable allocations

As part of https://github.com/rust-lang/miri/pull/1814, I realized that we currently allow deallocating immutable allocations. This PR fixes that, and also adds some new APIs that are required to still support the existing Miri backtrace support.

r? `@oli-obk`

3 years agofix pad_integral example
klensy [Sun, 23 May 2021 11:48:16 +0000 (14:48 +0300)]
fix pad_integral example

3 years agofix comment
Ralf Jung [Sun, 23 May 2021 11:26:51 +0000 (13:26 +0200)]
fix comment

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
3 years ago(try to) fix cranelift
Ralf Jung [Sun, 23 May 2021 10:44:05 +0000 (12:44 +0200)]
(try to) fix cranelift

3 years agosupport creating mutable allocations from byte slices
Ralf Jung [Sun, 23 May 2021 10:03:39 +0000 (12:03 +0200)]
support creating mutable allocations from byte slices

3 years agoavoid redundant immutability check
Ralf Jung [Sun, 23 May 2021 09:55:31 +0000 (11:55 +0200)]
avoid redundant immutability check

3 years agoreject deallocation of read-only allocations
Ralf Jung [Sun, 23 May 2021 09:53:23 +0000 (11:53 +0200)]
reject deallocation of read-only allocations

3 years agoAuto merge of #85490 - CDirkx:fix-vxworks, r=dtolnay
bors [Sun, 23 May 2021 05:40:18 +0000 (05:40 +0000)]
Auto merge of #85490 - CDirkx:fix-vxworks, r=dtolnay

Fix `vxworks`

Some PRs made the `vxworks` target not build anymore. This PR fixes that:

- #82973: copy `ExitStatusError` implementation from `unix`.
- #84716: no `libc::chroot` available on `vxworks`, so for now don't implement `os::unix::fs::chroot`.

3 years agoAuto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC
bors [Sun, 23 May 2021 03:24:27 +0000 (03:24 +0000)]
Auto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #84758 (MSVC: Avoid using jmp stubs for dll function imports)
 - #85288 (add an example to explain std::io::Read::read returning 0 in some cases)
 - #85334 (Add doc aliases to `unit`)
 - #85525 (Fix my mailmap entry)
 - #85571 (Remove surplus prepend LinkedList fn)
 - #85575 (Fix auto-hide for implementations and implementors.)

Failed merges:

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

3 years agoRollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez

Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors
and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations

Fixes #85411

r? `@GuillaumeGomez`

3 years agoRollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu

Remove surplus prepend LinkedList fn

This nightly library feature provides a function on `LinkedList<T>` that is identical to `fn append` with a reversed order of arguments. Observe this diff against the `fn append` doctest:
```diff
+#![feature(linked_list_prepend)]
 fn main() {
    use std::collections::LinkedList;
    let mut list1 = LinkedList::new();
    list1.push_back('a');
    let mut list2 = LinkedList::new();
    list2.push_back('b');
    list2.push_back('c');

-    list1.append(&mut list2);
+    list2.prepend(&mut list1);

-    let mut iter = list1.iter();
+    let mut iter = list2.iter();
     assert_eq!(iter.next(), Some(&'a'));
     assert_eq!(iter.next(), Some(&'b'));
     assert_eq!(iter.next(), Some(&'c'));
     assert!(iter.next().is_none());

-    assert!(list2.is_empty());
+    assert!(list1.is_empty());
 }
```

As this has received no obvious request to stabilize it, nor does it have a tracking issue, and was left on nightly and the consensus seems to have been to deprecate it in this pre-1.0 PR in 2014, https://github.com/rust-lang/rust/pull/20356, I propose simply removing it.

3 years agoRollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum
Dylan DPC [Sun, 23 May 2021 01:23:46 +0000 (03:23 +0200)]
Rollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum

Fix my mailmap entry

r? `@Mark-Simulacrum`

3 years agoRollup merge of #85334 - r00ster91:patch-8, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:41 +0000 (03:23 +0200)]
Rollup merge of #85334 - r00ster91:patch-8, r=dtolnay

Add doc aliases to `unit`

I think it makes sense for `unit` to have the same doc aliases as `tuple` does.

3 years agoRollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:37 +0000 (03:23 +0200)]
Rollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay

add an example to explain std::io::Read::read returning 0 in some cases

I have always found the explanation about `Read::read` returning 0 to indicate EOF but not indefinitely, so here's more info using Linux as example. I can also add example code if necessary