More reductions in error handling diversity
In this follow up to https://github.com/rust-lang/rust/pull/67744, we:
- Remove all fatal / error / warning macros in `syntax` except for `struct_span_err`, which is moved to `rustc_errors`.
- Lintify some hard-coded warnings which used warning macros.
- Defatalize some errors.
In general, the goal here is to make it painful to use fatal or unstructured errors and so we hopefully won't see many of these creep in.
Fixes https://github.com/rust-lang/rust/issues/67933.
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.
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.
r? @alexcrichton
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.
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]>`.
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).
r? @alexcrichton