Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#161987 (fix `is_single_fp_element` for `s390x` and `x86`)
- rust-lang/rust#162366 (Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails)
- rust-lang/rust#162552 (RISC-V: Add Zmmul target feature)
- rust-lang/rust#162602 (Ensure concurrent rustc instances in the same process correctly lock the session dir)
- rust-lang/rust#162885 (Remove one remaining use of `Level::Help`)
- rust-lang/rust#162606 (c-b: Export `fmaf16` now that we have an implementation)
- rust-lang/rust#162817 (rustc_{codegen_,}llvm: adapt to new ThreadModel API)
- rust-lang/rust#162860 (offload: add libLLVM rpath for libomptarget)
- rust-lang/rust#162895 (Avoid derive edits on macro-generated types)
- rust-lang/rust#162899 (Error on invalid placements of the `cfi_encoding` attribute.)
Ensure concurrent rustc instances in the same process correctly lock the session dir
This introduces a global lock registry for the `fcntl` lock fallback to allow emulating fd based locks (like `flock()`) on top of the `fcntl(F_SETLK)` process based locks, thereby ensuring that concurrent rustc instances inside the same process don't break the incr comp locking scheme.
Based on https://github.com/rust-lang/rust/pull/162584
Generally `rustc_middle::query` has types while `rustc_query_impl` has
operations. So this commit moves some operations from the former to the
latter. Some of them are just moved, while others are inlined and
removed.
The direct dependency from `rustc_codegen_ssa` to `rustc_mir_transform` allowed
codegen to reuse some MIR-transform code for identifying unnecessary landing
pads.
However, we can achieve the same result by calling through a hook on `TyCtxt`,
eliminating the crate dependency.
Update `windows-bindgen` to 0.100.0
This release represents a major change in the way bindings are generated. See https://github.com/microsoft/windows-rs/issues/4867 for details.
In short, it now more directly follows the C headers. For the standard library's purposes this is mostly reflected in relatively minor type changes or with some `const` pointers becoming `mut`.
There is however one big change that affects a lot of types. In the headers there are a lot of `#define`s like this:
```c
#define GENERIC_READ (0x80000000L)
#define GENERIC_WRITE (0x40000000L)
```
These are constants for the access mode. In this case they're explicitly declared as `L` (aka signed long) integer types (in other cases there's no type at all). However, this conflicts with how access mode constants are actually used. E.g., see `CreateFileW`:
```c
WINBASEAPI
HANDLE
WINAPI
CreateFileW(
_In_ LPCWSTR lpFileName,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwShareMode,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_In_ DWORD dwCreationDisposition,
_In_ DWORD dwFlagsAndAttributes,
_In_opt_ HANDLE hTemplateFile
);
```
Here `dwDesiredAccess` is a `DWORD`, which in rust equates to `u32`. The constant being signed but the usage being unsigned is not a problem for C/C++. They will happily convert between types at the drop of a hat. Rust however is stricter, as you know.
The old metadata used by `windows-bindgen` tried to try to fixup this mismatch but the new one goes strictly by what can be inferred from the headers. The hope in the future is that the headers themselves will be updated so better bindings can be directly derived from them.
traits: Represent live alias arguments as bitsets
Split out of rust-lang/rust#160212 per review / Zulip: https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/rigid.20aliases.20in.20region.20handling/near/615557841
`live_args_for_alias_from_outlives_bounds` and `args_known_to_outlive_alias_params` now return identity arg indices (`DenseBitSet`) instead of `EarlyBinder<GenericArg>`. Callers just do `args[idx].visit_with(...)`, so we stop laundering rigidness through binder instantiate. Also drops the old BitSet FIXME.
imo this is worth doing on its own even without the ICE fix. every time we shoved identity params through `EarlyBinder` we were writing down something we don't actually know, and this module is only going to grow. better to make the invariant explicit now than keep paying for it later.
No behavioral change intended. the rigid-alias ICE / `extract_verify_if_eq` bits stay on rust-lang/rust#160212. btw if that one should stack on this instead of staying independent, lmk and I'll rebase it asap.
sanitizers: Implement support for the sanitize ignorelist
The sanitize ignorelist gives central controls over which functions, files, etc. should be ignored and not sanitized. It is a common file format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change adds support for this list in Rust as well.
r? @rcvalle
The sanitize ignorelist gives central controls over which functions,
files, etc. should be ignored and not sanitized. It is a common file
format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change
adds support for this list in Rust as well.
Clippy subtree update
r? Manishearth
2 days early, as cargo needs a fix that landed in Clippy last week and @weihanglo pointed out to me that I might run into bors queue stalls on Thursday with the 1.98.1 release.
Update `icu_list` dependency to 2.3
This removes the `icu_collections` transitive dependency, and uses the smaller `icu_locale_fallback` instead of `icu_locale`.
r? manishearth
Deduplicate `InstrumentFnAttr`
cc @pmur
Instead of having a `Default` variant (which can't be specified in the attribute, it only does on/off), use an Option to model "no attribute used".
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#160941 (Enforce safety comments on `alloc`)
- rust-lang/rust#161975 (Abort instead of unwinding out of an inconsistent BTreeMap::split_off)
- rust-lang/rust#157968 (Preserve ambiguous glob lint for subtrait method picks)
- rust-lang/rust#161514 (rework handling of doc attributes on macro calls)
- rust-lang/rust#161944 (rustdoc: Take into account edition information for keyword highlighting)
- rust-lang/rust#161974 (remove rustc_never_type_options attr remnants)
- rust-lang/rust#161978 (Move rustdoc ui doctests into the right testsuite)
Failed merges:
- rust-lang/rust#161702 (Use `drop_guard` in some places in {core,alloc,std})
chore: bump to cc@1.4.3 for rustc_llvm and library
### What is this?
Old cc-rs derives this from the `-Clto` rustflag on its own.
`cc@1.2.39` starts gating that behind `-Clinker-plugin-lto`,
which bootstrap doesn't pass.
Therefore,
we need to pass this flag explicitly to keep LTO mode
Previous efforts:
* https://github.com/rust-lang/rust/pull/146186
* https://github.com/rust-lang/rust/pull/155438
I personally want this because of cc 1.3.0+ has the support of Cargo `-Ztrim-paths`,
which helps what I am experimenting in <https://github.com/rust-lang/rust/pull/161049>.
### How to review
Commit by commit.
To keep commits bisect-able,
I added the first commit without cc bump.
clang should be fine with duplicate `-flto` flags.
One thing I am not certain is whether we should probe `-flto` flag in this case,
or just make this fail if `-flto` isn't supported.
(I assume `-flto` is quote widely supported)
r? Kobzol
---
🤖 **LLM disclosure:** I used LLM for the experiment of <https://github.com/rust-lang/rust/pull/161049>, but not the bootstrap LTO change in this PR.