Use LLVM intrinsics for saturating add/sub
Use the `[su](add|sub).sat` LLVM intrinsics, if we're compiling against LLVM 8, as they should optimize and codegen better than IR based on `[su](add|sub).with.overlow`.
For the fallback for LLVM < 8 I'm using the same expansion that target lowering in LLVM uses, which is not the same as Rust currently uses (in particular due to the use of selects rather than branches).
Fixes#55286.
Fixes#52203.
Fixes#44500.
r? @nagisa
compiletest: Support opt-in Clang-based run-make tests and use them for testing xLTO.
Some cross-language run-make tests need a Clang compiler that matches the LLVM version of `rustc`. Since such a compiler usually isn't available these tests (marked with the `needs-matching-clang`
directive) are ignored by default.
For some CI jobs we do need these tests to run unconditionally though. In order to support this a `--force-clang-based-tests` flag is added to compiletest. If this flag is specified, `compiletest` will fail if it can't detect an appropriate version of Clang.
@rust-lang/infra The PR doesn't yet enable the tests yet. Do you have any recommendation for which jobs to enable them?
cc #57438
r? @alexcrichton
Rollup of 12 pull requests
Successful merges:
- #57008 (suggest `|` when `,` founds in invalid match value)
- #57106 (Mark str::trim.* functions as #[must_use].)
- #57920 (use `SOURCE_DATE_EPOCH` for man page time if set)
- #57934 (Introduce into_raw_non_null on Rc and Arc)
- #57971 (SGX target: improve panic & exit handling)
- #57980 (Add the edition guide to the bookshelf)
- #57984 (Improve bug message in check_ty)
- #57999 (Add MOVBE x86 CPU feature)
- #58000 (Fixes and cleanups)
- #58005 (update docs for fix_start/end_matches)
- #58007 (Don't panic when accessing enum variant ctor using `Self` in match)
- #58008 (Pass correct arguments to places_conflict)
Failed merges:
r? @ghost
Add MOVBE x86 CPU feature
I have no idea if this is correct. I basically copied the ADX feature. I verified the feature is also called `movbe` in LLVM.
I marked this to become stable immediately, as part of the RFC 2045.
r? @alexcrichton
Improve bug message in check_ty
This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.
It's also in line with the other `bug!` messages in `check_ty`.
SGX target: improve panic & exit handling
Implement this part of the spec:
> The enclave must not rely on userspace to terminate other threads still running. Similarly, the enclave must not trust that it will no longer be entered by userspace, and it must safeguard against that in the entrypoints.
Also use `UserRef` to access panic buffer
r? @alexcrichton
cc @VardhanThigle
Mark str::trim.* functions as #[must_use].
The functions return a reference to a new object and do not modify in-place
as the following code shows:
````
let s = String::from(" hello ");
s.trim();
assert_eq!(s, " hello ");
````
The new reference should be bound to a variable as now indicated by #[must_use].
This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.
It's also in line with the other `bug!` messages in `check_ty`.
Attempt to debug 259 exit code on AppVeyor
Let's try to dig in a bit more and see where this is coming from, it
looks like AppVeyor is also unsure where this is coming from!