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.
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`.
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.
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.
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.
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.
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.)
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.