rustdoc: Gate unstable `doc(cfg())` predicates
Fixes#138113
Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
uefi: Add OwnedEvent abstraction
- Events are going to become quite important for Networking, so needed owned abstractions.
- Switch to OwnedEvent abstraction for Exit boot services event.
cc ````@nicholasbishop````
std: move process implementations to `sys`
As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
- Document test intent to check for `-Whelp` suggestion if
`--print=lints` was specified.
- Move this test under `tests/ui/print-request/` and rename it to
`print-lints-help.rs` to better reflect what it is checking.
Slim `rustc_parse_format` dependencies down
`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead. This allows the crate to built without having to wait for `syn` (pulled in by `rustc_index_macros`)
Alternatively we could inline the macro, though from the looks of it that will run into trouble with `rustc_randomized_layouts`
Provide optional `Read`/`Write` methods for stdio
Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types.
Tracked in https://github.com/rust-lang/rust/issues/136756.
try-job: x86_64-msvc-1
core: optimize `RepeatN`
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
Move some driver code around
`--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
rustdoc js: add nonnull helper and typecheck src-script.js
this removes ``@ts-nocheck`` from `src-script.js` and adds a `nonnull` helper function that assists in adding null checks to places where null values should be impossible.
r? `@notriddle`
Mark some std tests as requiring `panic = "unwind"`
This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.
Switch away from `Debug`-like representation of `#[repr(..)]` attributes, and start using rustdoc's own logic for pretty-printing `#[repr(..)]` in rustdoc JSON.
Part of addressing #137645 but not a complete solution for it.
r? `@aDotInTheVoid`
hack: is_doc_subtype_of always returns true for TyAlias
it's worth noting that this function is only used in
the handling of "Methods from Deref", and we were previously
assuming all generic parameters were meaningless,
so this is still an improvment from the status quo.
this change means that we will have strictly less false positives
without adding any new false negitives.
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
test(ui): add tuple-struct-where-clause-suggestion ui test for #91520Fixes#91520
I tried to also make it a .fixed test, but I failed to accomplish that.
That's because of the 'consider annotating `Inner<T>` with `#[derive(Clone)]`' suggestion does not compile (conflicting Clone implementations), and I can't isolate them with `rustfix-only-machine-applicable` as both suggestions are not marked as `MachineApplicable`.
Instead I just test that the where clause suggestion is applied to the correct line.
Clean UI tests 2 of n
Modified 4 tests in tests/ui. Cleaned 3 and deleted one.
I have a final commit changing the values in `src/tools/tidy/src/ui_tests.rs`.
I wasn't sure if it was best practice to change this value as you go along or
once at the end. I can rebase to something that incrementally changes the value
in the "cleaned" commits if that is preferred.
Related Issues:
#73494#133895
r? jieyouxu
Add stack overflow handler for cygwin
The cygwin runtime handles stack overflow exception and converts it to `SIGSEGV`, but the passed `si_addr` is obtained from `ExceptionInformation[1]` which is actually an undocumented value when stack overflows. Thus I choose to use Windows API directly to register handler, just like how std does on native Windows. The code is basically copied from the Windows one.
Ref:
* 5ec497dc80/winsup/cygwin/exceptions.cc (L822-L823)
* https://learn.microsoft.com/zh-cn/windows/win32/api/winnt/ns-winnt-exception_record