Auto merge of #140245 - matthiaskrgr:rollup-e0fwsfv, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #139261 (mitigate MSVC alignment issue on x86-32)
 - #140075 (Mention average in midpoint documentations)
 - #140184 (Update doc of cygwin target)
 - #140186 (Rename `compute_x` methods)
 - #140194 (minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes`)
 - #140195 (triagebot: label minicore changes w/ `A-test-infra-minicore` and ping jieyouxu on changes)
 - #140214 (Remove comment about handling non-global where bounds with corresponding projection)
 - #140228 (Revert overzealous parse recovery for single colons in paths)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-04-24 12:06:16 +00:00
commit adf332b0ba
1 changed files with 25 additions and 13 deletions

View File

@ -6,25 +6,37 @@
ui/codegen/assembly test suites. It provides `core` stubs for tests that need to ui/codegen/assembly test suites. It provides `core` stubs for tests that need to
build for cross-compiled targets but do not need/want to run. build for cross-compiled targets but do not need/want to run.
A test can use [`minicore`] by specifying the `//@ add-core-stubs` directive.
Then, mark the test with `#![feature(no_core)]` + `#![no_std]` + `#![no_core]`.
Due to Edition 2015 extern prelude rules, you will probably need to declare
`minicore` as an extern crate.
Due to the `no_std` + `no_core` nature of these tests, `//@ add-core-stubs`
implies and requires that the test will be built with `-C panic=abort`.
Unwinding panics are not supported.
If you find a `core` item to be missing from the [`minicore`] stub, consider
adding it to the test auxiliary if it's likely to be used or is already needed
by more than one test.
<div class="warning"> <div class="warning">
Please note that [`minicore`] is only intended for `core` items, and explicitly Please note that [`minicore`] is only intended for `core` items, and explicitly
**not** `std` or `alloc` items because `core` items are applicable to a wider **not** `std` or `alloc` items because `core` items are applicable to a wider
range of tests. range of tests.
</div> </div>
A test can use [`minicore`] by specifying the `//@ add-core-stubs` directive.
Then, mark the test with `#![feature(no_core)]` + `#![no_std]` + `#![no_core]`.
Due to Edition 2015 extern prelude rules, you will probably need to declare
`minicore` as an extern crate.
## Implied compiler flags
Due to the `no_std` + `no_core` nature of these tests, `//@ add-core-stubs`
implies and requires that the test will be built with `-C panic=abort`.
**Unwinding panics are not supported.**
Tests will also be built with `-C force-unwind-tables=yes` to preserve CFI
directives in assembly tests.
TL;DR: `//@ add-core-stubs` implies two compiler flags:
1. `-C panic=abort`
2. `-C force-unwind-tables=yes`
## Adding more `core` stubs
If you find a `core` item to be missing from the [`minicore`] stub, consider
adding it to the test auxiliary if it's likely to be used or is already needed
by more than one test.
## Example codegen test that uses `minicore` ## Example codegen test that uses `minicore`
```rust,no_run ```rust,no_run