Commit graph

22294 commits

Author SHA1 Message Date
bors
d5525a7300 Auto merge of #149798 - matthiaskrgr:rollup-wjgs9x6, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147585 (Suppress the error for private fields with non_exhaustive attribute)
 - rust-lang/rust#149215 (Emit `check-cfg` lints during attribute parsing rather than evaluation)
 - rust-lang/rust#149652 (Add release notes for 1.92.0)
 - rust-lang/rust#149720 (rustdoc book: mention inner doc attribute)
 - rust-lang/rust#149730 (lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE)
 - rust-lang/rust#149754 (Retire `opt_str2` from compiletest cli parsing)
 - rust-lang/rust#149755 (bootstrap: Use a `CompiletestMode` enum instead of bare strings)
 - rust-lang/rust#149763 (Add inline attribute to generated delegation function if needed)
 - rust-lang/rust#149772 (test: Add a test for 146133)
 - rust-lang/rust#149779 (Fix typo "an" → "and")
 - rust-lang/rust#149782 (Remove `[no-mentions]` handler in the triagebot config)

Failed merges:

 - rust-lang/rust#148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-09 08:20:51 +00:00
Matthias Krüger
c77068137d
Rollup merge of #149772 - dianqk:no-builtins-linker-plugin-lto, r=jieyouxu
test: Add a test for 146133

This is a test without using `-Zbuild-std` for https://github.com/rust-lang/rust/pull/146133. There is another test using `-Zbuild-std`: https://github.com/rust-lang/cargo/pull/16277.

Even if a crate is marked as `#![no_builtins]`, we can still generate bitcode for rlib, but we cannot emit bitcode to the linker in rustc's LTO.
2025-12-09 06:17:27 +01:00
Matthias Krüger
7c9c7ed5be
Rollup merge of #149763 - aerooneqq:add-inline-attribute, r=petrochenkov
Add inline attribute to generated delegation function if needed

This PR adds a functionality to add #[inline(always)] attribute to generated functions from delegation, if some #[inline(..)] attribute is already specified on the delegation then we do nothing. This PR is a part of the delegation feature rust-lang/rust#118212 and addresses `Add implicit #[inline] unless specified otherwise` item.

r? ``@petrochenkov``
2025-12-09 06:17:26 +01:00
Matthias Krüger
add772d3c4
Rollup merge of #149730 - SATVIKsynopsis:main, r=Kivooeo
lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE

Fixes rust-lang/rust#149719

This PR replaces the `todo!("FIXME(unsafe_binder)")` branch in the `improper_ctypes` lint with a proper diagnostic.

Previously, using an unsafe binder inside an extern `"C"` block caused an internal compiler error.
This fix now ensures that the compiler now emits a clear and stable error message explaining that types containing unsafe binders are not yet supported in FFI.

A new UI test `(unsafe-binder-basic.rs)` is included to ensure this behavior remains stable and prevent regressions.
2025-12-09 06:17:24 +01:00
Matthias Krüger
ece99775da
Rollup merge of #149215 - JonathanBrouwer:cfg_lints2, r=jdonszelmann
Emit `check-cfg` lints during attribute parsing rather than evaluation

The goal of this PR is to make the `eval_config_entry` not have any side effects, by moving the check-cfg lints to the attribute parsing. This also helps ensure we do emit the lint in situations where the attribute happens to be parsed, but never evaluated.

cc ``@jdonszelmann`` ``@Urgau`` for a vibe check if you feel like it
2025-12-09 06:17:22 +01:00
Matthias Krüger
3c19acc607
Rollup merge of #147585 - chenyukang:yukang-fix-147513-suppress-private-fields, r=Kivooeo
Suppress the error for private fields with non_exhaustive attribute

Fixes rust-lang/rust#147513
2025-12-09 06:17:21 +01:00
bors
018d26972e Auto merge of #147572 - alexcrichton:wasi-use-libc, r=Mark-Simulacrum
std: Use more `unix.rs` code on WASI targets

This commit is a large change to the implementation of filesystem and
other system-related operations on WASI targets. Previously the standard
library explicitly used the `wasi` crate at the 0.11.x version track
which means that it used WASIp1 APIs directly. This meant that `std` was
hard-coded to use WASIp1 syscalls and there was no separate
implementation for the WASIp{2,3} targets, for example. The high-level
goal of this commit is to decouple this interaction and avoid the use of
the `wasi` crate on the WASIp2 target.

Historically when WASIp1 was originally added to Rust the wasi-libc
library was in a much different position than it is today. Nowadays Rust
already depends on wasi-libc on WASI targets for things like memory
allocation and environment variable management. As a libc library it
also has all the functions necessary to implement all filesystem
operations Rust wants. Recently wasi-libc additionally was updated to
use WASIp2 APIs directly on the `wasm32-wasip2` target instead of using
`wasm32-wasip1` APIs. This commit is leveraging this work by enabling
Rust to completely sever the dependence on WASIp1 APIs when compiling
for `wasm32-wasip2`. This is also intended to make it easier to migrate
to `wasm32-wasip3` internally in the future where now only libc need be
updated and Rust doesn't need to explicitly change as well.

The overall premise of this commit is that there's no need for
WASI-specific implementation modules throughout the standard library.
Instead the libc-style bindings already implemented for Unix-like
targets are sufficient. This means that Rust will now be using
libc-style interfaces to interact with the filesystem, for example, and
wasi-libc is the one responsible for translating these POSIX-ish
functions into WASIp{1,2} calls.

Concrete changes here are:

* `std` for `wasm32-wasip2` no longer depends on `wasi 0.11.x`
* The implementation of `std::os::wasi::fs`, which was previously
  unstable and still is, now has portions gated to only work on the
  WASIp1 target which use the `wasi` crate directly. Traits have been
  trimmed down in some cases, updated in others, or now present a
  different API on WASIp1 and WASIp2. It's expected this'll get further
  cleanup in the future.
* The `std::sys::fd::wasi` module is deleted and `unix` is used instead.
* The `std::sys::fs::wasi` module is deleted and `unix` is used instead.
* The `std::sys::io::io_slice::wasi` module is deleted and `unix` is used
  instead.
* The `std::sys::pal::{wasip1,wasip2}` modules are now merged together
  as their difference is much smaller than before.
* The `std::sys::pal::wasi::time` is deleted and the `unix` variant is
  used directly instead.
* The `std::sys::stdio::wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.
* The `std::sys:🧵:wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.

Overall Rust's libstd is effectively more tightly bound to libc when
compiled to WASI targets. This is intended to mirror how it's expected
all other languages will also bind to WASI. This additionally has the
nice goal of drastically reducing the WASI-specific maintenance burden
in libstd (in theory) and the only real changes required here are extra
definitions being added to `libc` (done in separate PRs). This might be
required for more symbols in the future but for now everything should be
mostly complete.
2025-12-09 05:10:32 +00:00
bors
a371038013 Auto merge of #149426 - antoyo:libgccjit-targets, r=Kobzol
Move the libgccjit.so file in a target directory

Since GCC is not multi-target, we need multiple libgccjit.so. Our solution to have a directory per target so that we can have multiple libgccjit.so.

r? `@Kobzol`
2025-12-09 01:58:46 +00:00
aerooneqq
8cf942d89f Add inline attribute to generated delegation function if needed 2025-12-08 19:56:47 +03:00
Alex Crichton
ba462864f1 std: Use more unix.rs code on WASI targets
This commit is a large change to the implementation of filesystem and
other system-related operations on WASI targets. Previously the standard
library explicitly used the `wasi` crate at the 0.11.x version track
which means that it used WASIp1 APIs directly. This meant that `std` was
hard-coded to use WASIp1 syscalls and there was no separate
implementation for the WASIp{2,3} targets, for example. The high-level
goal of this commit is to decouple this interaction and avoid the use of
the `wasi` crate on the WASIp2 target.

Historically when WASIp1 was originally added to Rust the wasi-libc
library was in a much different position than it is today. Nowadays Rust
already depends on wasi-libc on WASI targets for things like memory
allocation and environment variable management. As a libc library it
also has all the functions necessary to implement all filesystem
operations Rust wants. Recently wasi-libc additionally was updated to
use WASIp2 APIs directly on the `wasm32-wasip2` target instead of using
`wasm32-wasip1` APIs. This commit is leveraging this work by enabling
Rust to completely sever the dependence on WASIp1 APIs when compiling
for `wasm32-wasip2`. This is also intended to make it easier to migrate
to `wasm32-wasip3` internally in the future where now only libc need be
updated and Rust doesn't need to explicitly change as well.

The overall premise of this commit is that there's no need for
WASI-specific implementation modules throughout the standard library.
Instead the libc-style bindings already implemented for Unix-like
targets are sufficient. This means that Rust will now be using
libc-style interfaces to interact with the filesystem, for example, and
wasi-libc is the one responsible for translating these POSIX-ish
functions into WASIp{1,2} calls.

Concrete changes here are:

* `std` for `wasm32-wasip2` no longer depends on `wasi 0.11.x`
* The implementation of `std::os::wasi::fs`, which was previously
  unstable and still is, now has portions gated to only work on the
  WASIp1 target which use the `wasi` crate directly. Traits have been
  trimmed down in some cases, updated in others, or now present a
  different API on WASIp1 and WASIp2. It's expected this'll get further
  cleanup in the future.
* The `std::sys::fd::wasi` module is deleted and `unix` is used instead.
* The `std::sys::fs::wasi` module is deleted and `unix` is used instead.
* The `std::sys::io::io_slice::wasi` module is deleted and `unix` is used
  instead.
* The `std::sys::pal::{wasip1,wasip2}` modules are now merged together
  as their difference is much smaller than before.
* The `std::sys::pal::wasi::time` is deleted and the `unix` variant is
  used directly instead.
* The `std::sys::stdio::wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.
* The `std::sys:🧵:wasip{1,2}` modules are deleted and the `unix`
  variant is used instead.

Overall Rust's libstd is effectively more tightly bound to libc when
compiled to WASI targets. This is intended to mirror how it's expected
all other languages will also bind to WASI. This additionally has the
nice goal of drastically reducing the WASI-specific maintenance burden
in libstd (in theory) and the only real changes required here are extra
definitions being added to `libc` (done in separate PRs). This might be
required for more symbols in the future but for now everything should be
mostly complete.
2025-12-08 06:46:28 -08:00
dianqk
611c956c78
test: Add test for 146133
Even if a crate is marked as #![no_builtins], we can still generate bitcode for rlib,
but we cannot emit bitcode to the linker in rustc's LTO.
2025-12-08 21:57:17 +08:00
SATVIKsynopsis
0f4ec28155 lint: treat unsafe binders in improper_ctypes instead of ICE
Replaced _binder with _
2025-12-08 18:51:59 +05:30
Stuart Cook
d239114c8a
Rollup merge of #149736 - dawidl022:contracts/chore/cleanup-warning-in-tests, r=Kivooeo,jieyouxu
contracts: clean up feature flag warning duplicated across tests

There is no need for every contracts test to assert the same warning for using the `contracts` feature flag, as such use `#![expect(incomplete_features)]` in the tests, and add one test to specifically check for the warning.

Making this change has been discussed in the comments of rust-lang/rust#149722.

Contracts tracking issue: https://github.com/rust-lang/rust/issues/128044

r? Kivooeo
2025-12-08 11:46:26 +11:00
Stuart Cook
3c2a5dbace
Rollup merge of #149722 - dawidl022:contracts/fix/parsing-compound-statements, r=jieyouxu
contracts: fix lowering final declaration without trailing semicolon

Lowering for contract delcarations introduced in rust-lang/rust#144444 incorrectly handled the final declaration statement when it didn't end in a semicolon. This change fixes the issue.

See the included regression test for the minimal reproducible example.

Contracts tracking issue: https://github.com/rust-lang/rust/issues/128044
2025-12-08 11:46:25 +11:00
Stuart Cook
82af0eec44
Rollup merge of #149714 - reddevilmidzy:atd, r=fmease
Check associated type where-clauses for lifetimes

resolves: rust-lang/rust#148627
resolves: rust-lang/rust#149233
2025-12-08 11:46:25 +11:00
Stuart Cook
a76db5581b
Rollup merge of #149676 - reddevilmidzy:t10, r=Kivooeo
Tidying up tests/ui/issues tests [3/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

r? Kivooeo
2025-12-08 11:46:23 +11:00
Stuart Cook
ac729a4b18
Rollup merge of #149207 - EFanZh:add-ilog10-result-range-hints, r=Mark-Simulacrum
Add `ilog10` result range hints

This PR adds hints that the return value of `T::ilog10` will never exceed `T::MAX.ilog10()`.

This works because `ilog10` is a monotonically nondecreasing function, the maximum return value is reached at the max input value.
2025-12-08 11:46:23 +11:00
reddevilmidzy
22a7457d12 Cleaned up some tests
Merged tests/ui/typeck/non-function-call-error-2 with
tests/ui/typeck/non-function-call-error

Add comment to
tests/ui/traits/normalize-associated-type-in-where-clause.rs

Merged tests/ui/privacy/private-item-simple-2.rs with
tests/ui/privacy/private-item-simple.rs

Merged tests/ui/str/str-add-operator-2.rs with
tests/ui/str/str-add-operator.rs

Add comment to tests/ui/imports/duplicate-empty-imports.rs

Add comment to tests/ui/for-loop-while/nested-loop-break-unit.rs

Add comment to tests/ui/match/match-ref-option-pattern.rs

Add comment to tests/ui/closures/simple-capture-and-call.rs

Add comment to tests/ui/type/never-type-inference-fail.rs

Add comment to tests/ui/match/match-stack-overflow-72933.rs
2025-12-08 07:06:13 +09:00
Dawid Lachowicz
0bd9a2fafc
contracts: clean up feature flag warning duplicated across tests
There is no need for every contracts test to assert the same warning
for using the `contracts` feature flag, as such use
`#![expect(incomplete_features)]` in the tests, and add one test
to specifically check for the warning.
2025-12-07 17:29:30 +00:00
bors
1d6c526bb0 Auto merge of #149690 - RustyYato:inline-layout-helper, r=saethlin
Add `#[inline]` to `Layout::is_size_align_valid`

Fixes rust-lang/rust#149687

r? `@saethlin`
2025-12-07 13:43:57 +00:00
bors
aa30176300 Auto merge of #149729 - matthiaskrgr:rollup-25plwn0, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#147136 (Add warn-by-default lint for visibility on `const _` declarations)
 - rust-lang/rust#149498 (Tidying up `tests/ui/issues` tests [1/N])
 - rust-lang/rust#149721 (rustc book: fix `*-pc-windows-msvc` link label in sidebar)
 - rust-lang/rust#149724 (Fix off-by-one staging output when testing the library)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-07 10:32:34 +00:00
reddevilmidzy
d53f7676d1 Check associated type where-clauses for lifetimes 2025-12-07 18:40:03 +09:00
Dawid Lachowicz
d54fee82f4
contracts: fix lowering final declaration without trailing semicolon
Lowering for contract delcarations incorrectly handled the final
declaration statement when it didn't end in a semicolon. This
change fixes the issue.
2025-12-07 09:08:46 +00:00
Matthias Krüger
1f458c634e
Rollup merge of #149498 - reddevilmidzy:t8, r=fee1-dead
Tidying up `tests/ui/issues` tests [1/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895
2025-12-07 08:26:50 +01:00
Matthias Krüger
842f95de70
Rollup merge of #147136 - Jules-Bertholet:const-_-unused-vis, r=jdonszelmann
Add warn-by-default lint for visibility on `const _` declarations

Add a warn-by-default `unused_visibilities` lint for visibility qualifiers on `const _` declarations—e.g. `pub const _: () = ();`. Such qualifiers have no effect.

A [Sourcegraph search](https://sourcegraph.com/search?q=context:global+lang:Rust+pub%5Cs*%28%5C%28.*%5C%29%29%3F%5Cs*const%5Cs%2B_%5Cs*:&patternType=regexp&case=yes&sm=0) suggests that this pattern is relatively rare, and mostly found in tests (with only 3 exceptions). So perhaps this could become an FCW/hard error in the future.

`@rustbot` label T-lang A-lints A-visibility -T-clippy
2025-12-07 08:26:49 +01:00
bors
1c5a0cfc13 Auto merge of #149657 - Kobzol:revert-149147, r=chenyukang
Revert "Rollup merge of #149147 - chenyukang:yukang-fix-unused_assignments-macro-gen-147648, r=JonathanBrouwer"

This reverts commit 82a17b30d8, reversing
changes made to 5019bdaefe.

Reverts https://github.com/rust-lang/rust/pull/149147 due to a [perf regression](https://github.com/rust-lang/rust/pull/149147#issuecomment-3613098314).
2025-12-07 07:23:22 +00:00
RustyYato
5f9aca7e74 Add #[inline] to Layout::is_size_align_valid
add Alignment::new_unchecked::precondition_check to allowlist
2025-12-06 19:47:13 -06:00
reddevilmidzy
79893a050e cleaned up some tests
merged tests/ui/issues/issue-2951.rs with
tests/ui/type/type-parameter-names.rs

Merged
tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-1.rs
with
tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-2.rs

Removed tests/ui/issues/issue-2383.rs
duplicated of library\alloc\src\collections\vec_deque\tests.rs

Removed tests/ui/issues/issue-20714.rs
duplicated of tests/ui/empty/empty-struct-unit-expr.rs

Added comment to tests/ui/match/match-option-result-mismatch.rs, tests/ui/numeric/ref-int.rs,
tests/ui/box/self-assignment.rs
2025-12-07 10:37:45 +09:00
bors
d427ddfe90 Auto merge of #149717 - matthiaskrgr:rollup-spntobh, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149659 (Look for typos when reporting an unknown nightly feature)
 - rust-lang/rust#149699 (Implement `Vec::from_fn`)
 - rust-lang/rust#149700 (rustdoc: fix bugs with search aliases and merging)
 - rust-lang/rust#149713 (Update windows-gnullvm platform support doc)
 - rust-lang/rust#149716 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 21:42:15 +00:00
Jules Bertholet
43fa060c38
Expand lint note 2025-12-06 13:49:00 -05:00
Jules Bertholet
9e7200967e
Add note to lint message 2025-12-06 13:49:00 -05:00
Jules Bertholet
6b5da2f177
Don't warn when underscore is passed to macro 2025-12-06 13:49:00 -05:00
Jules Bertholet
234df83fe3
Add warn-by-default lint for visibility on const _ declarations
Add a warn-by-default `unused_visibility` lint for visibility qualifiers
on `const _` declarations - e.g. `pub const _: () = ();`.
These have no effect.
2025-12-06 13:48:58 -05:00
Matthias Krüger
d0bcc42121
Rollup merge of #149700 - notriddle:alias-loading, r=GuillaumeGomez
rustdoc: fix bugs with search aliases and merging

These bugs cause a crash and a perf problem with aliases, caused by loading the search index when it's not expected.

cc `@weihanglo`

r? `@GuillaumeGomez`
2025-12-06 16:27:09 +01:00
Matthias Krüger
e126ad17c3
Rollup merge of #149699 - EFanZh:vec-from-fn, r=joboet
Implement `Vec::from_fn`

- ACP: <https://github.com/rust-lang/libs-team/issues/484#issuecomment-3403140816>.
- Tracking issue: rust-lang/rust#149698.
2025-12-06 16:27:09 +01:00
Matthias Krüger
183283f60d
Rollup merge of #149659 - scrabsha:push-vtrtnooqlvvv, r=jdonszelmann
Look for typos when reporting an unknown nightly feature
2025-12-06 16:27:08 +01:00
bors
ba86c0460b Auto merge of #149704 - matthiaskrgr:rollup-u4zhw99, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146826 (Implement `Allocator` for `&mut A` where `A: Allocator + ?Sized`)
 - rust-lang/rust#148487 (add Option::into_flat_iter)
 - rust-lang/rust#148814 (stabilize `array_windows`)
 - rust-lang/rust#149401 (Fix `name()` functions for local defs in rustc_public)
 - rust-lang/rust#149683 (Fix armv8r-none-eabihf tier)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 12:25:12 +00:00
Jonathan Brouwer
01576a6de1
Add regression test for nested cfgs 2025-12-06 10:38:15 +01:00
Jonathan Brouwer
e7df90412c
Changes to uitests 2025-12-06 10:22:13 +01:00
bors
da2544bfbe Auto merge of #149495 - scottmcm:assume-filter-count, r=Mark-Simulacrum
Assume the returned value in `.filter(…).count()`

Similar to how this helps in `slice::Iter::position`, LLVM sometimes loses track of how high this can get, so for `TrustedLen` iterators tell it what the upper bound is.
2025-12-06 09:13:21 +00:00
Matthias Krüger
4c8c967225
Rollup merge of #149401 - celinval:smir-109-name, r=scottmcm
Fix `name()` functions for local defs in rustc_public

This change fixes the behavior of the `name()` function for `CrateDef` and `Instance` which should return absolute path of items. For local items, the crate name was missing.

This resolves: https://github.com/rust-lang/project-stable-mir/issues/109
2025-12-06 09:57:59 +01:00
EFanZh
c5113ca1e2 Implement Vec::from_fn 2025-12-06 12:55:15 +08:00
Michael Howell
38a2a3da3c rustdoc: test for loading index when user said no
Also mentioned, as a perf problem, in
<https://github.com/rust-lang/cargo/pull/16309#discussion_r2586792981>
2025-12-05 21:00:14 -07:00
Michael Howell
cf83387d2f rustdoc: add test case for alias bug
Reproduces
<https://github.com/rust-lang/cargo/pull/16309#discussion_r2586792981>
2025-12-05 20:45:28 -07:00
bors
b4f1098e10 Auto merge of #148823 - lcnr:generalize-no-subtyping, r=BoxyUwU
TypeRelating emit WellFormed, not generalize

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/250

r? BoxyUwU
2025-12-06 02:53:23 +00:00
bors
36b2369c91 Auto merge of #141980 - beetrees:va-list-proposal, r=workingjubilee
`c_variadic`: make `VaList` abi-compatible with C

tracking issue: https://github.com/rust-lang/rust/issues/44930
related PR: rust-lang/rust#144529

On some platforms, the C `va_list` type is actually a single-element array of a struct (on other platforms it is just a pointer). In C, arrays passed as function arguments expirience array-to-pointer decay, which means that C will pass a pointer to the array in the caller instead of the array itself, and modifications to the array in the callee will be visible to the caller (this does not match Rust by-value semantics). However, for `va_list`, the C standard explicitly states that it is undefined behaviour to use a `va_list` after it has been passed by value to a function (in Rust parlance, the `va_list` is moved, not copied). This matches Rust's pass-by-value semantics, meaning that when the C `va_list` type is a single-element array of a struct, the ABI will match C as long as the Rust type is always be passed indirectly.

In the old implementation, this ABI was achieved by having two separate types: `VaList` was the type that needed to be used when passing a `VaList` as a function parameter, whereas `VaListImpl` was the actual `va_list` type that was correct everywhere else. This however is quite confusing, as there are lots of footguns: it is easy to cause bugs by mixing them up (e.g. the C function `void foo(va_list va)` was equivalent to the Rust `fn foo(va: VaList)` whereas the C function `void bar(va_list* va)` was equivalent to the Rust `fn foo(va: *mut VaListImpl)`, not `fn foo(va: *mut VaList)` as might be expected); also converting from `VaListImpl` to `VaList` with `as_va_list()` had platform specific behaviour: on single-element array of a struct platforms it would return a `VaList` referencing the original `VaListImpl`, whereas on other platforms it would return a cioy,

In this PR, there is now just a single `VaList` type (renamed from `VaListImpl`) which represents the C `va_list` type and will just work in all positions. Instead of having a separate type just to make the ABI work, rust-lang/rust#144529 adds a `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute, which when applied to a struct will force the struct to be passed indirectly by non-Rustic calling conventions. This PR then implements the `VaList` rework, making use of the new attribute on all platforms where the C `va_list` type is a single-element array of a struct.

Cleanup of the `VaList` API and implementation is also included in this PR: since it was decided it was OK to experiment with Rust requiring that not calling `va_end` is not undefined behaviour (https://github.com/rust-lang/rust/issues/141524#issuecomment-3028383594), I've removed the `with_copy` method as it was redundant to the `Clone` impl (the `Drop` impl of `VaList` is a no-op as `va_end` is a no-op on all known platforms).

Previous discussion: rust-lang/rust#141524 and [t-compiler > c_variadic API and ABI](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/c_variadic.20API.20and.20ABI)
Tracking issue: https://github.com/rust-lang/rust/issues/44930
r? `@joshtriplett`
2025-12-05 23:36:55 +00:00
Sasha Pourcelot
a57470ff72 Look for typos when reporting an unknown nightly feature 2025-12-05 20:06:10 +00:00
Sasha Pourcelot
dfee0dad26 Add test for misspelled feature name 2025-12-05 18:32:12 +00:00
Matthias Krüger
8e46521d0e
Rollup merge of #149666 - Zalathar:backend-has-zstd, r=jieyouxu
Add perma-unstable `--print=backend-has-zstd` for use by compiletest

Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built without support for zstd compression.

Currently, compiletest relies on messy and fragile heuristics to detect whether the compiler's LLVM was built with zstd support. But the compiler itself already knows whether LLVM has zstd or not, so it's easier for compiletest to just ask the compiler.

---

Originally I was intending for this to be a `--print=debuginfo-compression` flag that would print out a list of values supported by `-Zdebuginfo-compression=`. I got that working locally, but it was more complex than I was happy with (in both rustc and compiletest), so I decided to cut scope and instead add a very narrow perma-unstable print request instead.

There is always a circularity hazard whenever we ask the compiler-under-test for information about how to test it. But in this case, the underlying compiler code is fairly simple, whereas the previous heuristics were inherently messy and unreliable anyway.
2025-12-05 16:17:12 +01:00
Matthias Krüger
d076da7e89
Rollup merge of #149647 - reddevilmidzy:test, r=Kivooeo
Add regression test for 141845

close: rust-lang/rust#141845

I saw the `tests/ui/associated-inherent-types` directory, but I felt the current location was a better fit.
2025-12-05 16:17:11 +01:00