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.
Upgrade and deduplicate dependencies
- Upgrade from `getrandom v0.4.2` to `v0.4.3` to drop its `wasip2` and
`wasip3` dependencies and many transitives.
- Upgrade from `gimli v0.33` to `v0.34` as a direct dependency and
through a `thorin-dwp` upgrade.
- Upgrade from `object v0.37` and `v0.38` to `v0.39` as a direct
dependency and via `ar_archive_writer` and `thorin-dwp` upgrades.
- Upgrade `libloading` and `wasmparser` to match other dependencies.
This also consolidates from `hashbrown v0.15`, `v0.16`, and `v0.17` to
just `v0.17.1`, which is the same that `std` currently uses.
Store identity argument indices instead of bound generic arguments so
callers can index concrete alias arguments without changing rigidness
through instantiation.