bors [Thu, 9 Jan 2020 11:36:44 +0000 (11:36 +0000)]
Auto merge of #67988 - Zoxc:prof-fix, r=michaelwoerister
Change -Z time event naming scheme and make them generic activities
I made the `-Z time-passes` only events (which encodes argument in the event id) use a `extra_verbose_generic_activity` function which does not emit self-profiling events.
Rollup merge of #67979 - Centril:hir-cleanup, r=Zoxc
Move `intravisit` => `rustc_hir` + misc cleanup
Working towards https://github.com/rust-lang/rust/issues/65031.
This should eventually enable getting rid of rustc as a dependency in various passes (e.g. lints).
cc https://github.com/rust-lang/rust/pull/67806 (this also facilitates liberating lints from tcx)
cc https://github.com/rust-lang/rust/pull/67922 (some other dep reductions)
Rollup merge of #67884 - anp:allow-unused-const-attr, r=oli-obk
Fix incremental builds of core by allowing unused attribute.
I *think* that the same problem as in https://github.com/rust-lang/rust/issues/65023 was introduced by https://github.com/rust-lang/rust/pull/67657. This works around the current incrcomp issue with these attributes by allowing it here. This resolves the near-term issue for me, at least.
bors [Wed, 8 Jan 2020 19:46:58 +0000 (19:46 +0000)]
Auto merge of #68011 - JohnTitor:rollup-44s8twu, r=JohnTitor
Rollup of 10 pull requests
Successful merges:
- #67774 (Try statx for all linux-gnu target.)
- #67781 (Move `is_min_const_fn` query to librustc_mir.)
- #67798 (Remove wrong advice about spin locks from `spin_loop_hint` docs)
- #67849 (Add a check for swapped words when we can't find an identifier)
- #67875 (Distinguish between private items and hidden items in rustdoc)
- #67887 (`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`)
- #67955 (rustdoc: Remove more `#[doc(cfg(..))]` duplicates)
- #67977 (Updates for VxWorks)
- #67985 (Remove insignificant notes from CStr documentation)
- #68003 (ci: fix wrong shared.sh import for publish_toolstate)
Failed merges:
- #67820 (Parse the syntax described in RFC 2632)
- #67979 (Move `intravisit` => `rustc_hir` + misc cleanup)
Yuki Okushi [Wed, 8 Jan 2020 15:29:20 +0000 (00:29 +0900)]
Rollup merge of #67985 - dtolnay:cstr, r=Mark-Simulacrum
Remove insignificant notes from CStr documentation
The to_str and to_string_lossy methods contain a note about the behavior possibly changing in the future. But those notes are referring to a distinction that is not observable in the API. Whether or not the UTF-8 check knows the string length ahead of time, these methods require linear time.
Yuki Okushi [Wed, 8 Jan 2020 15:29:13 +0000 (00:29 +0900)]
Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomez
Distinguish between private items and hidden items in rustdoc
I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document.
This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.
Yuki Okushi [Wed, 8 Jan 2020 15:29:12 +0000 (00:29 +0900)]
Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebank
Add a check for swapped words when we can't find an identifier
Fixes #66968
Couple things here:
1. The matches take the precedence of case insensitive match, then levenshtein match, then swapped words match. Doing this allows us to not even check for swapped words unless the other checks return `None`.
2. I've assumed that the swapped words check is not held to the limits of the max levenshtein distance threshold (ie. we want to try and find a match even if the levenshtein distance is very high). This means that we cannot perform this check in the `fold` that occurs after the `filter_map` call, because the candidate will be filtered out. So, I've split this into two separate `fold` calls, and had to collect the original iterator into a vec so it can be copied (I don't think we want to change the function signature to take a vec or require the `Copy` trait). An alternative implemenation may be to remove the `filter_map`, `fold` over the entire iterator, and do a check against `max_dist` inside the relevant cases there.
Yuki Okushi [Wed, 8 Jan 2020 15:29:09 +0000 (00:29 +0900)]
Rollup merge of #67798 - matklad:spin-thouse-docs, r=Amanieu
Remove wrong advice about spin locks from `spin_loop_hint` docs
Using a pure spin lock for a critical section in a preemptable thread
is always wrong, however short the critical section may be. The thread
might be preempted, which will cause all other threads to hammer
busily at the core for the whole quant. Moreover, if threads have
different priorities, this might lead to a priority inversion problem
and a deadlock. More generally, a spinlock is not more efficient than
a well-written mutex, which typically does several spin iterations at
the start anyway.
The advise about UP vs SMP is also irrelevant in the context of
preemptive threads.
See also accompanying piece: https://matklad.github.io/2020/01/02/spinlocs-considered-harmful.html
And another, independent piece: https://probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is
EDIT: obligatory disclosure that I am not an expert in these things, and might be terribly wrong :)
Yuki Okushi [Wed, 8 Jan 2020 15:29:06 +0000 (00:29 +0900)]
Rollup merge of #67774 - oxalica:more-statx, r=alexcrichton
Try statx for all linux-gnu target.
After https://github.com/rust-lang/libc/pull/1577, which is contained in `libc` 0.2.66, provides `SYS_statx` for all Linux platform, so we can try to use `statx` for ~all Linux target~ all linux-gnu targets.
Unfortunately, `struct statx` and `fn statx` is not a part of public interface of musl (currently), ~we still need to invoke it through `syscall`~ we does **not** support statx for musl or other libc impls currently.
bors [Wed, 8 Jan 2020 09:03:46 +0000 (09:03 +0000)]
Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichton
Clear out target directory if compiler has changed
Previously, we relied fully on Cargo to detect that the compiler had changed and
it needed to rebuild the standard library (or later "components"). This used to
not quite be the case prior to moving to LLVM be a separate cargo invocation;
subsequent compiles would recompile std and friends if LLVM had changed
(#67077 is the PR that changes things here).
This PR moves us to clearing out libstd when it is being compiled if the rustc
we're using has changed. We fairly harshly limit the cases in which we do this
(e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations).
This is primarily because when we're not using the compiler directly, so
clearing out in other cases is likely to lead to bugs, particularly as our
deletion scheme is pretty blunt today (basically removing more than is needed,
i.e., not just the rustc artifacts).
In practice, this targeted fix does fix the known bug, though it may not fully
resolve the problem here. It's also not clear that there is a full fix hiding
here that doesn't involve a more major change (like -Zbinary-dep-depinfo was).
As a drive-by fix, don't delete the compiler before calling Build::copy, as that
also deletes the compiler.
bors [Wed, 8 Jan 2020 05:05:06 +0000 (05:05 +0000)]
Auto merge of #67733 - pietroalbini:gha-2, r=alexcrichton
GitHub Actions: preparations, part 2
This PR adds the second batch of commits in preparation for GitHub Actions:
* Removed hardcoded Azure Pipelines variables from `publish_toolstate.sh`
* Fixed a bug in `shared.sh`'s GitHub Actions support
* Fixed binutils missing from MSYS2 on Windows 2019 (GitHub Actions-specific)
* Fixed wrong sysroot in macOS 10.15 onwards (GitHub Actions-specific)
This PR does **not** yet add any builders on GitHub Actions.
David Tolnay [Tue, 7 Jan 2020 20:01:39 +0000 (12:01 -0800)]
Remove insignificant notes from CStr documentation
These notes are about a distinction that is not going to be observable
in the API. Whether or not the UTF-8 check knows the string length ahead
of time, these methods require linear time.
bors [Tue, 7 Jan 2020 18:10:56 +0000 (18:10 +0000)]
Auto merge of #67312 - cuviper:clone-box-slice, r=SimonSapin
Simplify Clone for Box<[T]>
The bespoke `BoxBuilder` was basically a very simple `Vec`. Instead,
let's clone to a real `Vec`, with all of its specialization for the
task, then convert back to `Box<[T]>`.
bors [Tue, 7 Jan 2020 14:53:27 +0000 (14:53 +0000)]
Auto merge of #67732 - pietroalbini:fewer-apples, r=alexcrichton
ci: remove 32-bit Apple targets
This PR drops the `i686-apple` and `dist-i686-apple` CI builders, as well as removing the `armv7-apple-ios`, `armv7s-apple-ios` and `i386-apple-ios` targets from the `x86_64-apple` CI builder.
The change was approved in [RFC 2837](https://github.com/rust-lang/rfcs/pull/2837), and it should land in Rust 1.42 stable (so this cycle).
bors [Tue, 7 Jan 2020 08:11:07 +0000 (08:11 +0000)]
Auto merge of #67961 - ehuss:update-cargo, r=alexcrichton
Update cargo
9 commits in 86134e7666a088682f20b76278c3ee096a315218..6e1ca924a67dd1ac89c33f294ef26b5c43b89168
2019-12-23 16:08:07 +0000 to 2020-01-06 19:11:37 +0000
- Fix dynamic linking for Windows UWP MSVC targets (rust-lang/cargo#7758)
- Fix CARGO_TARGET_triple_LINKER environment variable. (rust-lang/cargo#7763)
- Remove metadata dep_kinds duplicates. (rust-lang/cargo#7756)
- Check for a source defined multiple times. (rust-lang/cargo#7751)
- Fix typo. (rust-lang/cargo#7735)
- Fix config env vars that are prefix of another with underscore. (rust-lang/cargo#7748)
- Add test for `cargo pkgid` (rust-lang/cargo#7741)
- Add a note to the error message for using --feature / --no-default-features in a virtual workspace (rust-lang/cargo#7742)
- Fix debug message. (rust-lang/cargo#7749)
4 commits in d8dfe1b005c03584cd7adc4bfb72b005e7e84744..e1157538e86d83df0cf95d5e33bd943f80d0248f
2019-12-14 21:04:58 +0100 to 2019-12-22 13:13:14 +0100
- Fix typo in macros-by-example.md (rust-lang-nursery/reference#733)
- Remove `extern` from exception list (rust-lang-nursery/reference#732)
- Added clearification that closures are refered to lambdas (rust-lang-nursery/reference#731)
- abi.md: clarify #[used] and linking (rust-lang-nursery/reference#712)
Yuki Okushi [Tue, 7 Jan 2020 04:46:08 +0000 (13:46 +0900)]
Rollup merge of #67909 - varkor:obsolete-const-print, r=davidtwco
Fix ICE in const pretty printing and resolve FIXME
Consts now have a `fmt::Display` impl, so we can just use that to pretty-print.
This resolves an ICE in https://github.com/rust-lang/rust/issues/61936, though it hits more ICEs afterwards. I couldn't find a test case that was resolved by this that didn't hit errors later on.
Yuki Okushi [Tue, 7 Jan 2020 04:46:04 +0000 (13:46 +0900)]
Rollup merge of #67880 - lbonn:fix/multi-substs, r=petrochenkov
Handle multiple error fix suggestions carefuly
The existing code seems to assume that substitutions spans are disjoint,
which is not always the case.
In the example:
pub trait AAAA {}
pub trait B {}
pub trait C {}
pub type T<P: AAAA + B + C> = P;
, we get three substituions starting from ':' and ending respectively at
the end of each trait token.
With the former offset calculation, this would cause `underline_start` to
eventually become negative before being converted to `usize`...
The new version may report erroneous results for non perfectly overlapping
substitutions but I don't know if such examples exist. Alternatively, we
could detect these cases and trim out overlapping substitutions.
Yuki Okushi [Tue, 7 Jan 2020 04:46:02 +0000 (13:46 +0900)]
Rollup merge of #67877 - dtolnay:const-_, r=nagisa
Omit underscore constants from rustdoc
Underscore constants from https://github.com/rust-lang/rfcs/pull/2526 / https://github.com/rust-lang/rust/issues/54912 do not correspond to a nameable item and so are never useful in documentation.
<br>
Yuki Okushi [Tue, 7 Jan 2020 04:45:58 +0000 (13:45 +0900)]
Rollup merge of #67566 - Mark-Simulacrum:thread-id-u64, r=alexcrichton
Add an unstable conversion from thread ID to u64
We see multiple cases inside rustc and ecosystem code where ThreadId is
transmuted to u64, exploiting the underlying detail. This is suboptimal
(can break unexpectedly if we change things in std).
It is unlikely that ThreadId will ever need to be larger than u64 --
creating even 2^32 threads over the course of a program is quite hard,
2^64 is even harder. As such, we do not choose to return a larger sized
type (e.g. u128). If we choose to shrink ThreadId in the future, or
otherwise change its internals, it is likely that a mapping to u64 will
still be applicable (though may become more complex).
I will file a tracking issue as soon as this is loosely approved.