Commit graph

22710 commits

Author SHA1 Message Date
Jieyou Xu
dd948f96f3
Thread --jobs from bootstrap -> compiletest -> run-make-support 2026-01-06 14:51:51 +08:00
Jakub Beránek
5bcdc7c131
Rollup merge of #150384 - reddevilmidzy:t14, r=Kivooeo
Tidying up tests/ui/issues 16 tests [7/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
2026-01-05 15:54:13 +01:00
reddevilmidzy
93f8ad9950 cleaned up some tests
cleaned up cast-enum-const.rs

cleaned up ufcs-trait-object-format.rs

add comment to cast-to-box-arr.rs

add comment to shadow-primitives.rs

add comment to associated-type-const-nomalization.rs

add comment to fn-trait-explicit-call.rs

add comment to call-unit-struct-impl-fn-once.rs

add comment to cast-to-char-compare.rs

add comment to self-in-method-body-resolves.rs

add comment to derive-debug-newtype-unsized-slice.rs

add comment to tuple-ref-order-distinct-impls.rs

add comment to derive-debug-generic-with-lifetime.rs

add comment to recursive-trait-bound-on-type-param.rs

cleaned up const-static-ref-to-closure.rs

add comment to const-iter-no-conflict-for-loop.rs
2026-01-05 15:35:01 +09:00
bors
6885bdf1af Auto merge of #150603 - Kivooeo:tuple-struct, r=BoxyUwU
MGCA: Support for tuple constructors

r? BoxyUwU

part of https://github.com/rust-lang/rust/issues/132980

fixes rust-lang/rust#136379
fixes rust-lang/rust#138132

i tried to keep implementation very minimal and it's very similar to how structs was implemented with small adjustments

this does not make const constructor like None works, just something like Some(n)

todo:
* ~~tests~~
* write a better description (not sure if needed)
* add more comments and FIXMEs from structs code
2026-01-05 01:45:18 +00:00
reddevilmidzy
5c5c1ff6db moved some test
delete tests/ui/issues/issue-22426.rs duplicated of tests/ui/match/guards.rs
2026-01-05 10:04:46 +09:00
bors
451b7b6c77 Auto merge of #150682 - matthiaskrgr:rollup-jrkhivl, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149681 (resolve: Split `Scope::Module` into two scopes for non-glob and glob bindings )
 - rust-lang/rust#150426 (Update offload test and verify that tgt_(un)register_lib have the right type)
 - rust-lang/rust#150678 (relate.rs: tiny cleanup: eliminate temp vars)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 21:47:15 +00:00
Matthias Krüger
1494755275
Rollup merge of #150426 - ZuseZ4:offload-register-lib, r=davidtwco
Update offload test and verify that tgt_(un)register_lib have the right type

Apparently, we weren't running offload tests when Enzyme wasn't built. Time to fix that.
Also adds a test mode which generates the host IR, but does not expect device IR/artifacts. This way, we don't have to handle artifacts and paths in our tests.
Also removes some outdated documentation.

cc `@Kevinsala,` `@Sa4dUs`

closes: https://github.com/rust-lang/rust/issues/150415

~~blocked on `needs-offload` infrastructure landing in https://github.com/rust-lang/rust/pull/150427~~
2026-01-04 21:14:05 +01:00
Matthias Krüger
df246c107a
Rollup merge of #149681 - petrochenkov:openapi1, r=davidtwco
resolve: Split `Scope::Module` into two scopes for non-glob and glob bindings

This is a re-implementation of https://github.com/rust-lang/rust/pull/144131 with all the issues mentioned there fixed.

As it turned out, the non-trivial part of the split was already done in https://github.com/rust-lang/rust/pull/149454/commits/c91b6ca58d4d870d3099db1defbd8c1f26a7d851, so the remaining part implemented in this PR is *mostly* mechanical.

After addressing the issue of already found bindings being lost due to indeterminacies in outer scopes (7e890bfa87) and adding one missing `Stage::Late` in `Finalize` the scope splitting refactoring just worked.
(One more ICE was revealed by the refactoring, but not caused by it, fixed up in the last commit.)

This is a part of implementation for the [Open API](https://rust-lang.github.io/rust-project-goals/2025h1/open-namespaces.html) proposal.
2026-01-04 21:14:04 +01:00
bors
e29fcf45e4 Auto merge of #150674 - matthiaskrgr:rollup-tnkgbcx, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#150554 (test: add regression cases for valtree hashing ICE)
 - rust-lang/rust#150597 (make specialization of `Vec::extend` and `VecDeque::extend_front` work for vec::IntoIter with any `Allocator`, not just `Global`)
 - rust-lang/rust#150619 (alloc: Move Cow impl to existing ones)
 - rust-lang/rust#150660 (THIR pattern building: Pass HIR nodes instead of loose types/spans)
 - rust-lang/rust#150671 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-04 16:58:33 +00:00
Matthias Krüger
2270553cbe
Rollup merge of #150554 - Dushyanthyadav:ice-issue-150409-regression-test, r=davidtwco
test: add regression cases for valtree hashing ICE

This PR extends the existing regression test `printing_valtrees_supports_non_values.rs` to cover cases that previously caused an ICE in `const_kind.rs` due to hashing inference variables.

It specifically adds:

A case where an associated constant is used without the required trait bound.

The `0: _` case as suggested in [Here](https://github.com/rust-lang/rust/issues/150409#issuecomment-3700022690)

Fixes rust-lang/rust#150409
2026-01-04 16:16:09 +01:00
Kivooeo
05afcb6d26 init impl 2026-01-04 15:12:39 +00:00
Manuel Drehwald
fa584faca5 Update test and verify that tgt_(un)register_lib have the right type 2026-01-04 06:58:31 -08:00
Stuart Cook
db41a1556e
Rollup merge of #150659 - mu001999-contrib:fix/150654, r=Urgau
Add missing translator resources for interface parse_cfg and parse_check_cfg

Missing resources leads to the failure of `translate_message`.

Fixes rust-lang/rust#150654
2026-01-04 21:37:05 +11:00
Stuart Cook
05dce482d3
Rollup merge of #150650 - enthropy7:main, r=BoxyUwU
Forbid generic parameters in types of #[type_const] items

fixes rust-lang/rust#150614

we enforce the same restriction on `#[type_const]` const items that already exists for const generic parameters - when `generic_const_parameter_types` feature gate is not enabled, the type of a `#[type_const]` item cannot reference generic parameters.  implementation follows the same pattern used for const generic parameters. we check if the item has the `#[type_const]` attribute and if the feature gate is disabled, then we apply `RibKind::ConstParamTy` restrictions when visiting the type, which prevents the use of generic parameters.

check is added in three places:
- Free const items (`ItemKind::Const`)
- Trait associated consts (`AssocItemKind::Const` in traits)
- Impl associated consts (`AssocItemKind::Const` in impls)

added tests for new feature, hope i get this task right :>

r? `@BoxyUwU`
2026-01-04 21:37:04 +11:00
Stuart Cook
336c6658e4
Rollup merge of #150201 - Enselic:debugger-tests-revisions-2, r=Zalathar
compiletest: Support revisions in debuginfo (read: debugger) tests

And start using revisions in `tests/debuginfo/macro-stepping.rs` to prevent regressing both with and without `SingleUseConsts` MIR pass.

I recommend commit-by-commit review.

## ~TODO~

- [x] Verify this more carefully.
- [x] Possibly do some preparatory PRs before taking this PR out of draft.
    - [x] Rebase on https://github.com/rust-lang/rust/pull/150205 once merged so we don't have to add another "`+ 1`".

## CC

CC ``@Zalathar`` since you might have opinions about that I expose a helper function to reduce duplication

CC ``@saethlin`` since this is what we will use for `tests/debuginfo/basic-stepping.rs` in https://github.com/rust-lang/rust/pull/147426 (in the same way I use it in `tests/debuginfo/macro-stepping.rs` here)
2026-01-04 21:37:02 +11:00
enthropy7
46bb414d69
Forbid generic parameters in types of #[type_const] items 2026-01-04 07:21:35 +03:00
mu001999
759857cce3 Add missing translator resources for interface parse_cfg and parse_check_cfg 2026-01-04 11:53:31 +08:00
bors
f57b9e6f56 Auto merge of #150564 - rwardd:rwardd/option_or_codegen_tests, r=scottmcm
Added codegen tests for different forms of `Option::or`

Adds tests to check the output of the different ways of writing `Option::or`

Fixes rust-lang/rust#124533
2026-01-03 22:47:35 +00:00
Matthias Krüger
7af208fe0b
Rollup merge of #150570 - Human9000-bit:main, r=jieyouxu
Removed confusing diagnostics note for trait required for `?` operator use

- **test: modified `bad-question-mark-on-trait-objects` to match expected behavior**
- **removed confusing message from diagnostics**

fixes [#150527](https://github.com/rust-lang/rust/issues/150527)
2026-01-03 10:09:29 +01:00
Matthias Krüger
78376fd39c
Rollup merge of #150558 - estebank:multiple-dep-versions, r=jieyouxu
Detect cases where `?` is applied on a type that could be coming from a different crate version than expected

```
error[E0277]: `?` couldn't convert the error to `dependency::Error`
  --> replaced
   |
LL | fn main() -> Result<(), Error> {
   |              ----------------- expected `dependency::Error` because of this
...
LL |     Err(Error2)?;
   |     -----------^ the trait `From<Error2>` is not implemented for `dependency::Error`
   |     |
   |     this can't be annotated with `?` because it has type `Result<_, Error2>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: the trait `From<Error2>` is not implemented for `dependency::Error`
      but trait `From<()>` is implemented for it
  --> replaced
   |
LL | impl From<()> for Error {
   | ^^^^^^^^^^^^^^^^^^^^^^^
   = help: for that trait implementation, expected `()`, found `Error2`
   = note: there are multiple different versions of crate `dependency` in the dependency graph
   = help: you can use `cargo tree` to explore your dependency tree
```

The existing checks rely on having access to the actual types/traits that diverged to detect they are called the same, come from different crates with the same name. The new check is less specific, merely looking to see if the crate name the involved type belongs has multiple crates.

CC rust-lang/rust#78552.
2026-01-03 10:09:29 +01:00
Ryan Ward
a2fcb0de18 fix: add CHECK directives to ret comments and be more pervasive with directive contents 2026-01-03 12:50:38 +10:30
Ryan
3df06f5083
fix: use std::num::NonZero instead of extern crate and extend information in CHECK- directives
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2026-01-03 10:53:54 +10:30
bors
e8f3cfc0de Auto merge of #150628 - JonathanBrouwer:rollup-zy040xr, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#149991 (Add checks for gpu-kernel calling conv)
 - rust-lang/rust#150047 (std: merge `sys::pal::common` and `sys_common` into `sys::helpers`)
 - rust-lang/rust#150441 (do not suggest method call removal if it changes receiver type)
 - rust-lang/rust#150616 (Update `browser-ui-test` version to `0.23.0`)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-02 23:01:27 +00:00
Jonathan Brouwer
03a0155db3
Rollup merge of #150616 - GuillaumeGomez:update-browser-ui-test, r=lolbinarycat
Update `browser-ui-test` version to `0.23.0`

It comes with new features like conditions and an update to `puppeteer`.
2026-01-02 23:13:22 +01:00
Jonathan Brouwer
ce43d6cd01
Rollup merge of #150441 - fee1-dead-contrib:push-smqzpwrpvqll, r=estebank
do not suggest method call removal if it changes receiver type

Fixes rust-lang/rust#149487, cc `@estebank`
2026-01-02 23:13:22 +01:00
Jonathan Brouwer
6268b9118e
Rollup merge of #149991 - Flakebi:gpu-kernel-cc, r=workingjubilee
Add checks for gpu-kernel calling conv

The `gpu-kernel` calling convention has several restrictions that were not enforced by the compiler until now.
Add the following restrictions:

1. Cannot be async
2. Cannot be called
3. Cannot return values, return type must be `()` or `!`
4. Arguments should be simple, i.e. passed by value. More complicated types can work when you know what you are doing, but it is rather unintuitive, one needs to know ABI/compiler internals.
5. Export name should be unmangled, either through `no_mangle` or `export_name`. Kernels are searched by name on the CPU side, having a mangled name makes it hard to find and probably almost always unintentional.

Tracking issue: rust-lang/rust#135467
amdgpu target tracking issue: rust-lang/rust#135024

``@workingjubilee,`` these should be all the restrictions we talked about a year ago.

cc ``@RDambrosio016`` ``@kjetilkjeka`` for nvptx
2026-01-02 23:13:21 +01:00
bors
85c8ff69cb Auto merge of #150606 - JonathanBrouwer:rollup-lue4jqz, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#150425 (mapping an error from cmd.spawn() in npm::install)
 - rust-lang/rust#150444 (Expose kernel launch options as offload intrinsic args)
 - rust-lang/rust#150495 (Correct hexagon "unwinder_private_data_size")
 - rust-lang/rust#150578 (Fix a typo in the docs of AsMut for rust-lang/rust#149609)
 - rust-lang/rust#150581 (mir_build: Separate match lowering for string-equality and scalar-equality)
 - rust-lang/rust#150594 (Fix typo in the docs of `CString::from_vec_with_nul`)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-02 19:45:27 +00:00
Guillaume Gomez
665781513e Fix changes coming from browser-ui-test version update 2026-01-02 20:21:44 +01:00
bors
5497a36a7f Auto merge of #149658 - Enselic:non-zero-opt, r=Mark-Simulacrum
tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs: New test

Closes rust-lang/rust#60044 which has one 👍 and one ❤️  vote and just **E-needs-test**.
2026-01-02 16:29:24 +00:00
Vadim Petrochenkov
2e123aef70 resolve: Avoid additional ambiguities from splitting modules into two scopes 2026-01-02 15:31:09 +03:00
Vadim Petrochenkov
78c61beb48 resolve: Patch up an inconsistent resolution ICE revealed by the previous commit 2026-01-02 15:26:06 +03:00
Vadim Petrochenkov
0016a71747 resolve: Migrate one more special ambiguity for glob vs non-glob bindings
in the same module to the usual ambiguity infra in `resolve_ident_in_scope_set`
2026-01-02 15:25:56 +03:00
Vadim Petrochenkov
bcfbb5619c resolve: Migrate a special ambiguity for glob vs non-glob bindings
in the same module to the usual ambiguity infra in `resolve_ident_in_scope_set`
2026-01-02 15:11:14 +03:00
Vadim Petrochenkov
75d90094e7 resolve: Split Scope::Module into two scopes for non-glob and glob bindings 2026-01-02 15:02:03 +03:00
Marcelo Domínguez
58e2610f71 Expose workgroup/thread dims as intrinsic args 2026-01-02 11:50:32 +01:00
bors
1b4325211c Auto merge of #150582 - jhpratt:rollup-3mal3wc, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150073 (Make `asm_experimental_arch` work in `allow_internal_unstable` macros)
 - rust-lang/rust#150445 (resolve: Preserve binding scopes in ambiguity errors)
 - rust-lang/rust#150580 (Document `panic!` in `Iterator::last` for rust-lang/rust#149707)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-02 05:37:45 +00:00
Jacob Pratt
57b2e6579a
Rollup merge of #150073 - daxpedda:internal-unstable-asm-experimental-arch, r=nnethercote
Make `asm_experimental_arch` work in `allow_internal_unstable` macros

This change makes it possible to use unstable `asm!`, usually requiring `feature(asm_experimental_arch)`, in proc-macros with the `allow_internal_unstable` attribute.

The test was added on a target where `asm!` is unstable: Wasm. However, this affects *any* target with an unstable `asm!` implementation.
2026-01-01 23:27:54 -05:00
Ryan Ward
66c4ead02d fix: added further CHECK-SAME labels and replaced all struct input tests with NonZero<u8> input 2026-01-02 12:54:17 +10:30
bors
a47f4dfd7f Auto merge of #150519 - camelid:mgca-forbid-params-properly, r=BoxyUwU
Use more principled check for generics in const ops

Fixes rust-lang/rust#144547.
Fixes rust-lang/rust#140891.

In the future, we likely want to make the check less likely to be missed by reducing the number of external entry points to HIR type lowering.

Note: If this causes pass->error regressions (not truly regressions because those cases were mistakenly accepted), they can easily be avoided for the time being by only running the check if `is_self_alias` is true or mgca is enabled.

- **Fix parsing of mgca const blocks in array repeat exprs**
- **Use more principled check for generics in const ops**
2026-01-02 02:23:07 +00:00
Noah Lev
f71e93821e mgca: Re-merge split out tests
Now that we avoid a fatal error, they can all be one test.
2026-01-01 18:12:34 -08:00
Noah Lev
c7e368543c Use more principled check for generics in const ops
Instead of using a visitor in typeck, we just check, whenever lowering a
use of a param, whether the parent item is an MCG anon const during hir
ty lowering (and instantiate_value_path). If so, we report an error
since MCG anon consts should never be able to use generics. All other
kinds of anon consts are at least syntactically allowed to use generic
params.

We use a `TypeFolder` to accomplish this; this way, we look at the
fully explicit semantic representation of the type/const/whatever and
don't miss subtle cases like `Self` type aliases.
2026-01-01 18:12:34 -08:00
Ryan
bf2078bfca
fix: add CHECK-SAME labels to verify generated function type for u8 and [u8; 1] cases
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2026-01-02 12:01:55 +10:30
Jonathan Brouwer
ed5a529df1
Rollup merge of #150504 - AprilNEA:fix-99173, r=JonathanBrouwer
Add regression test for issue #99173

Close rust-lang/rust#99173.

Adds a regression test for rust-lang/rust#99173, which was an ICE that occurred when a proc-macro generated code that invoked another proc-macro returning an empty `TokenStream`.
2026-01-02 00:04:08 +01:00
Jonathan Brouwer
745368c7d8
Rollup merge of #150431 - cyrgani:nfc-proc-macro-test, r=nnethercote
test and document that `proc_macro::Ident` is NFC-normalized

Previously, this was not tested at all and the test suite would pass even when replacing the `normalize_and_validate_ident` implementation with a `panic!`.
2026-01-02 00:04:07 +01:00
Jonathan Brouwer
21d3df6268
Rollup merge of #150382 - estebank:git-markers-wording, r=nnethercote
Tweak wording of diff marker diagnostic
2026-01-02 00:04:07 +01:00
human9000
cddda032d5 test: modified bad-question-mark-on-trait-objects to match expected
behaviour
2026-01-02 00:57:43 +05:00
Flakebi
33add367e2
Add checks for gpu-kernel calling conv
The `gpu-kernel` calling convention has several restrictions that were
not enforced by the compiler until now.
Add the following restrictions:

1. Cannot be async
2. Cannot be called
3. Cannot return values, return type must be `()` or `!`
4. Arguments should be primitives, i.e. passed by value. More complicated
   types can work when you know what you are doing, but it is rather
   unintuitive, one needs to know ABI/compiler internals.
5. Export name should be unmangled, either through `no_mangle` or
   `export_name`. Kernels are searched by name on the CPU side, having
   a mangled name makes it hard to find and probably almost always
   unintentional.
2026-01-01 18:34:24 +01:00
Ryan Ward
80acf74fb6 test: added codegen tests for permutations of Option::or 2026-01-01 22:28:32 +10:30
bors
cc08b553b8 Auto merge of #150563 - JonathanBrouwer:rollup-9ncjbou, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150454 (cleanup: move c-variadic arguments handling into compute_inputs_and_output)
 - rust-lang/rust#150529 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-01 11:09:18 +00:00
Jonathan Brouwer
36457ce8f9
Rollup merge of #150454 - tiif:move_variadic, r=oli-obk
cleanup: move c-variadic arguments handling into compute_inputs_and_output

Previously, ``unnormalized_input_tys`` needs to be mutable because the c_variadic arguments are added to ``unnormalized_input_tys`` outside of ``compute_inputs_and_output``. This could have been done together in ``compute_inputs_and_output``.
2026-01-01 12:04:16 +01:00