Commit graph

149157 commits

Author SHA1 Message Date
bors
1969c2e312 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
2021-05-26 07:10:44 +00:00
Yuki Okushi
7c0677ad9b
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)
2021-05-26 13:31:09 +09:00
Yuki Okushi
bce257c11d
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)
2021-05-26 13:31:08 +09:00
Yuki Okushi
7caf93fa1b
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.
2021-05-26 13:31:07 +09:00
Yuki Okushi
1e51afa9ba
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">
2021-05-26 13:31:05 +09:00
Yuki Okushi
e87bc66fca
Rollup merge of #85666 - fee1-dead:document-shared-from-cow, r=dtolnay
Document shared_from_cow functions
2021-05-26 13:31:04 +09:00
Yuki Okushi
7508203421
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
2021-05-26 13:31:03 +09:00
Yuki Okushi
587de8e5f9
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.
2021-05-26 13:31:02 +09:00
Yuki Okushi
0bc3066f4d
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.
2021-05-26 13:31:01 +09:00
Yuki Okushi
b7b9ce3df8
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`
2021-05-26 13:31:00 +09:00
Yuki Okushi
d75521a36e
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.
2021-05-26 13:30:59 +09:00
Yuki Okushi
ae6a1a7043
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.
2021-05-26 13:30:58 +09:00
Yuki Okushi
0264f4fe4a
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`.
2021-05-26 13:30:54 +09:00
bors
54bdfa1257 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.
2021-05-26 04:27:23 +00:00
Jacob Pratt
a875876027
Make Range implementation safe 2021-05-26 00:12:06 -04:00
Jacob Pratt
641c8cd875
Limit TrustedLen impls to core types 2021-05-26 00:12:06 -04:00
bors
47a90f4520 Auto merge of #85535 - dtolnay:weakdangle, r=kennytm
Weak's type parameter may dangle on drop

Way back in 34076bc0c9, #\[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.
2021-05-26 01:17:02 +00:00
Eric Huss
8a7dc0d3aa Update cargo 2021-05-25 16:08:54 -07:00
Eric Huss
072b85c370 Update books 2021-05-25 15:03:01 -07:00
Eric Huss
074d667cf5 Don't panic when failing to initialize incremental directory. 2021-05-25 14:40:33 -07:00
Mara Bos
caf6faf951 Remove Iterator #[rustc_on_unimplemented]s that no longer apply. 2021-05-25 20:20:05 +02:00
LeSeulArtichaut
f9e08cd75f Run THIR unsafeck on unsafe_op_in_unsafe_fn test 2021-05-25 20:12:42 +02:00
LeSeulArtichaut
f7916b4c9e Fix unused_unsafe in THIR unsafeck 2021-05-25 20:11:29 +02:00
LeSeulArtichaut
b0835410bb Handle unsafe_op_in_unsafe_fn properly in THIR unsafeck 2021-05-25 20:11:29 +02:00
hyd-dev
0777f1bbaf
Use match instead of .map_or(StackPopUnwind::Skip, StackPopUnwind::Cleanup) 2021-05-26 00:51:51 +08:00
Rémy Rakic
6f6145617d 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.
2021-05-25 18:39:51 +02:00
Rémy Rakic
d14dd9f763 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.
2021-05-25 18:39:50 +02:00
Guillaume Gomez
0fae87a24c Add GUI test to check colors of alias in search results 2021-05-25 17:48:57 +02:00
Lukas Markeffsky
824c7435fa add regression test 2021-05-25 17:34:44 +02:00
Guillaume Gomez
e4067a30c7 Fix more search results CSS rules 2021-05-25 17:18:04 +02:00
Guillaume Gomez
61c47ba880 Generate DOM more securely 2021-05-25 17:05:51 +02:00
Aliénore Bouttefeux
5d8e6ea7b9 show list of candidates 2021-05-25 16:55:30 +02:00
Hoe Hao Cheng
0baf89810f Remove num_as_ne_bytes feature 2021-05-25 22:48:08 +08:00
Lukas Markeffsky
3ed90e2424 fix matches! and assert_matches! on edition 2021 2021-05-25 16:44:20 +02:00
Christiaan Dirkx
87cf2d4726 Move stability attribute for methods under the ip feature from the module to the methods themselves 2021-05-25 15:57:27 +02:00
bors
ff2c947c00 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.
2021-05-25 13:53:48 +00:00
Mara Bos
8d954fa589 Remove arrays/IntoIterator message from Iterator trait. 2021-05-25 15:48:14 +02:00
Eric Huss
79a5b12a89 Fix tasklist example in rustdoc book. 2021-05-25 06:08:27 -07:00
hyd-dev
38472e0d5c
Move the check to unwind_to_block 2021-05-25 20:43:54 +08:00
Deadbeef
37588e9e1b
Document shared_from_cow functions 2021-05-25 20:06:02 +08:00
bors
fbf1b1a719 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
2021-05-25 11:12:47 +00:00
Guillaume Gomez
afec7261bc
Rollup merge of #85657 - kpreid:brackets, r=jyn514
Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b80687854 (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.
2021-05-25 13:05:17 +02:00
Guillaume Gomez
aa8c37d2c9
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
2021-05-25 13:05:16 +02:00
Guillaume Gomez
46615598a9
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.
2021-05-25 13:05:15 +02:00
Guillaume Gomez
0f3c98ad51
Rollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha
Move keyword primitive css dom

Fixes #85569.

r? ``@jsha``
2021-05-25 13:05:14 +02:00
Guillaume Gomez
ad72247833
Rollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper
Replace Local::new(1) with CAPTURE_STRUCT_LOCAL
2021-05-25 13:05:14 +02:00
Guillaume Gomez
6b0b81b098
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.
2021-05-25 13:05:09 +02:00
Guillaume Gomez
a06829cfbd Update keyword GUI test 2021-05-25 10:44:06 +02:00
Guillaume Gomez
706aa31a2d Move extra search result information for keywords and primitives from CSS to DOM 2021-05-25 10:44:05 +02:00
bors
cdbe288897 Auto merge of #85634 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/85591
2021-05-25 08:31:56 +00:00