Check for intrinsic to fn ptr casts in unified coercions
Fixesrust-lang/rust#149143 by ensuring that when coercing multiple expressions to a unified type, the same "intrinsic to fn ptr" check is applied as for other coercions.
Exhaustively specify names and stability of `--print` values
While trying to add a new unstable `--print` kind for use by compiletest, I found that the relevant code is quite awkward to work with, for a few reasons:
- It's spread across various parts of a multi-thousand-line source file.
- All newly-added `PrintKind` values are automatically treated as *stable*, unless they are explicitly marked as unstable in a helper function far away.
- Parsing `--print` values relies on a separate table of name/value mappings, but there's no exhaustiveness check for that table.
This PR therefore:
- Extracts the relevant code into its own `print_request` submodule.
- Uses a macro-rules derive to obtain an exhaustive list of values.
- Uses exhaustive matches to associate a name and stability status with each `PrintKind` value.
---
The first commit moves code to a separate module; the second commit contains actual changes.
There should be no change to compiler output.
Reject `async fn` in `const impl` during AST validation
closesrust-lang/rust#149083
Fixes the ICE when using `async fn` inside `const impl` blocks by adding AST validation.
Currently, inherent `impl`s does not perform any checks to verify whether it contains `async fn` declarations. In this PR, I have modified the `visit_assoc_item` function to call `check_async_fn_in_const_trait_or_impl` within the `TraitOrImpl::Impl` case to handle this requirement. Additionally, this change has introduced three possible contexts for the corresponding error messages, so I have updated to properly distinguish between these different contexts when generating messages.
r? oli-obk
std: sys: fs: uefi: Fix FileAttr size
- The underlying file size is represented by file_size field. The size field is just the size of structure since it is a C DST.
- Fixes bug created in https://github.com/rust-lang/rust/pull/148970
``@rustbot`` label +O-UEFI
sgx: avoid unnecessarily creating a slice
Cc ``@jethrogb`` -- no idea why this created a slice only to directly convert it back to a raw pointer, but we can avoid this and in fact make the entire function safe. I didn't change the function signature (it's still an `unsafe fn`) as I know nothing about the surrounding code.
fs: Run file lock tests on all platforms that support it
There are a number of platforms that support file locking but aren't getting tested. Synchronize the list and mark the tests `should_panic` otherwise, to make sure they get updated if more platforms add locking support.
The supported platform list comes from 07bdbaedc6/library/std/src/sys/fs/unix.rs (L1291-L1308). Windows also supports file locks, all other platforms are unsupported.
Add missing trailing period to RustDoc for fn create_dir().
Documentation for other functions in the standard library RustDocs have a trailing period at the end of the first sentence, e.g. `create_dir_all()` and `create_buffered()` have the trailing period, but the first line of documentation for `fn create_dir()` lacks a trailing period. This PR adds the missing period.
autodiff rlib handling
As I learned recently, we now apparently support rlib builds already in some cases.
With the last hint from saethlin this seems to now cover all cases. To be sure I'll add a few more testcases before I mark it as ready.
Once this PR lands, we should to the best of my knowledge, support autodiff in almost code locations, only vtable/dyn ptr remain unsupported for now.
r? ghost
closes: https://github.com/rust-lang/rust/issues/148856
closes: https://github.com/rust-lang/rust/issues/137520
See if this is the time we can remove `layout::size_align`
This was a bad idea before, but now that `size_of` and `align_of` work completely differently than when removing it was first tried in 2020, maybe it makes sense now.
(Or maybe I'll just add another attempt to the list in the comments...)
r? ghost
[AIX][ppc64le-linux-gnu] Add Amy Kwan to target maintainers
Amy has effectively been helping to maintain these Power targets for a while, so add her to the maintainers list.
fix the fragment_in_dst_padding_gets_overwritten test on s390x
on s390x 128bit types have a smaller alignment then on x86[^1]. This leads to smaller structs (24 instead of 32 bytes) and therefore the write_unaligned will write outside of the structs boundary.
To fix the test, change the trailing u32 into a u8. This will generate 7 trailing padding bytes on s390x and 15 on x86_64. Also change the start of the garbage data so it will span over x,y and padding:
```
s390x: XXXXXXXXXXXXXXXXY-------
x86_64: XXXXXXXXXXXXXXXXY---------------
GGGGGGGG
```
[^1]: s390x ELF ABI Table 1.1, Page 12 https://github.com/IBM/s390x-abi
ignore unsized types in mips64 and sparc64 callconvs
Non-rustic calling conventions should not make up an ABI for unsized types (cc https://github.com/rust-lang/rust/pull/148302). The vast majority of our callconv implementations already ignore unsized types, `sparc64` and `mips64` I guess were missed.
r? `````@bjorn3`````
alloc: fix `Debug` implementation of `ExtractIf`
I noticed this while reviewing rust-lang/rust#141032. Calling `get` on the inner `Vec` never returns `Some` as the `Vec`'s length is temporarily set to zero while the `ExtractIf` exists.
Add doc for va_list APIs
I observed that [PR146521](https://github.com/rust-lang/rust/pull/146521) submitted two weeks ago resolved some documentation issues related to `VaListImpl`, similar to the previous [PR136969](https://github.com/rust-lang/rust/pull/136969).
This PR specifically adds requirements about argument availability for `VaListImpl::arg`, and also adds safety descriptions to the three associated intrinsic APIs.
stdarch subtree update
Subtree update of `stdarch` to 50134e10cb.
Created using https://github.com/rust-lang/josh-sync.
The only interesting commit is the final one, which enables the `avx10_target_feature` feature in the standard library, because it is now used in `stdarch`.
r? `@sayantn` (or whoever, this is just a straightforward sync)
- The underlying file size is represented by file_size field. The size
field is just the size of structure since it is a C DST.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Rather than skipping the tests, make sure that they fail. This ensures
that if file locking support is added for more platforms in the future,
the tests don't wind up quietly skipped.
Update cargo submodule
13 commits in 2d4fa139552ebdd5f091a1401ed03f7dc62cb43f..5c0343317ce45d2ec17ecf41eaa473a02d73e29c
2025-11-12 15:56:06 +0000 to 2025-11-18 19:05:44 +0000
- feat: emit a warning when both `package.publish` and `--index` are specified (rust-lang/cargo#16268)
- docs(cargo-yank): clarify yank behavior with leaked credentials (rust-lang/cargo#16274)
- feat(generate-lockfile): Add unstable --publish-time flag (rust-lang/cargo#16265)
- Do not lock the artifact-dir for check builds (rust-lang/cargo#16230)
- fix(fingerprint): force update mtime of cargo-check artifacts (rust-lang/cargo#16262)
- fix(manifest): Point out when a key belongs to config (rust-lang/cargo#16256)
- Use raw false during cfg test (rust-lang/cargo#16261)
- Suppress metadata warnings for non–crates.io publishable packages (rust-lang/cargo#16241)
- feat(tree): Support long forms for --format variables (rust-lang/cargo#16204)
- fix(config): Fallback to non-canonical path for workspace-path-hash (rust-lang/cargo#16248)
- fix: update mtime for generated files after unpacking (rust-lang/cargo#16250)
- feat(cli): Add support for completing `--config` values in Bash (rust-lang/cargo#16245)
- feat: Add a typos CI job (rust-lang/cargo#16122)
This was a bad idea before, but now that `size_of` and `align_of` work completely differently than when removing it was first tried in 2020, maybe it makes sense now.
(Or maybe I'll just add another attempt to the list in the comments...)