about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-05-04Auto merge of #140580 - jdonszelmann:variables-external-macros, r=m-ou-sebors-43/+105
Don't name variables from external macros in borrow errors. This came up as part of the expansion of format_args. However, it's a more general problem (and now solution). I noticed that this does change another test, moving out of fields in derives on packed struct. However, I think this is a better error simply because it used to refer to `other.0` which is an implementation detail which doesn't really make sense. cc `@m-ou-se`
2025-05-04Auto merge of #140616 - petrochenkov:noannempty, r=jieyouxubors-440/+155
compiletest: Do not require annotations on empty labels and suggestions Unlike other empty diagnostics, empty labels (only underlining spans) and empty suggestions (suggestions to remove something) are quite usual and do not require any special attention and annotations. This effectively reverts a part of https://github.com/rust-lang/rust/pull/139485. r? `@jieyouxu`
2025-05-04Auto merge of #140633 - Zalathar:rollup-iay94wa, r=Zalatharbors-207/+455
Rollup of 7 pull requests Successful merges: - #139675 (Add the AVX10 target features) - #140286 (Check if format argument is identifier to avoid error err-emit) - #140456 (Fix test simd/extract-insert-dyn on s390x) - #140551 (Move some tests out of tests/ui) - #140588 (Adjust some ui tests re. target-dependent errors) - #140617 (Report the `unsafe_attr_outside_unsafe` lint at the closest node) - #140626 (allow `#[rustfmt::skip]` in combination with `#[naked]`) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-04Rollup merge of #140626 - folkertdev:naked-rustfmt-skip, r=AmanieuStuart Cook-0/+6
allow `#[rustfmt::skip]` in combination with `#[naked]` fixes https://github.com/rust-lang/rust/issues/140623 We very deliberately use an allowlist to prevent weird interactions with `#[naked]`, hopefully we've now found all of the useful combinations. cc `@Amanieu`
2025-05-04Rollup merge of #140617 - Urgau:unsafe_attr-lint-allow, r=jieyouxuStuart Cook-0/+16
Report the `unsafe_attr_outside_unsafe` lint at the closest node This PR have `AstValidation` track a linting node id and then uses it when reporting the `unsafe_attr_outside_unsafe` lint, so that instead of being bound at the crate-root, `#[allow]` of the lint works at any node. Fixes rust-lang/rust#140602 r? `@jieyouxu`
2025-05-04Rollup merge of #140588 - jieyouxu:opt-error, r=petrochenkovStuart Cook-22/+37
Adjust some ui tests re. target-dependent errors Alternatives to optional error annotations in #140586: - Continue to ignore target-dependent additional errors in `tests/ui/panic-runtime/{two-panic-runtimes.rs,tests/ui/panic-runtime/want-abort-got-unwind.rs,tests/ui/panic-runtime/want-abort-got-unwind2.rs}` -- but explain why some targets have more errors than others. - Use `-Cpanic=abort` for `tests/ui/cfg/cfg_false_no_std-2.rs`. In that test, the panic strategy does not matter w.r.t. test intention. - Adjust FIXMEs in `tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs` to track it in #140620. --- try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: aarch64-apple try-job: x86_64-apple-1
2025-05-04Rollup merge of #140551 - mejrs:test4, r=jieyouxuStuart Cook-183/+254
Move some tests out of tests/ui r? `@jieyouxu`
2025-05-04Rollup merge of #140456 - fneddy:fix_s390x_codegen_simd_ext_ins_dyn, ↵Stuart Cook-1/+15
r=wesleywiser Fix test simd/extract-insert-dyn on s390x Fix the test for s390x by enabling s390x vector extension via `target_feature(enable = "vector")`(#127506). As this is is still gated by `#![feature(s390x_target_feature)]` we need that attribute also.
2025-05-04Rollup merge of #140286 - xizheyin:issue-139104, r=lcnrStuart Cook-0/+105
Check if format argument is identifier to avoid error err-emit Fixes #139104 When `argument` is not an identifier, it should not be considered a field access. I checked this and if not emit an invalid format string error. I think we could do with a little finer error handling, I'll open an issue to track this down later. The first commit submits the ui test, the second commits the code and the changes to the test output. r? compiler
2025-05-04Rollup merge of #139675 - sayantn:avx10, r=AmanieuStuart Cook-1/+22
Add the AVX10 target features Parent #138843 Adds the `avx10_target_feature` feature gate, and `avx10.1` and `avx10.2` target features. It is confirmed that Intel is dropping AVX10/256 (see [this comment](https://github.com/rust-lang/rust/issues/111137#issuecomment-2795442288)), so this should be safe to implement now. The LLVM fix for llvm/llvm-project#135394 was merged, and has been backported to LLVM20, and the patch has also been propagated to rustc in #140502 `@rustbot` label O-x86_64 O-x86_32 A-target-feature A-SIMD
2025-05-04Auto merge of #140549 - BoxyUwU:proper_const_norm, r=lcnrbors-33/+16
Set groundwork for proper const normalization r? lcnr Updates a lot of our normalization/alias infrastructure to be setup to handle mgca aliases and normalization once const items are represented more like aliases than bodies. Inherent associated consts are still super busted, I didn't update the assertions that IACs the right arg setup because that winds up being somewhat involved to do *before* proper support for normalizing const aliases is implemented. I dont *intend* for this to have any effect on stable. We continue normalizing via ctfe on stable and the codepaths in `project` for consts should only be reachable with mgca or ace.
2025-05-03compiletest: Do not require annotations on empty labels and suggestionsVadim Petrochenkov-440/+155
2025-05-03allow `#[rustfmt::skip]` in combination with `#[naked]`Folkert de Vries-0/+6
2025-05-03Move some tests out of tests/uimejrs-183/+254
2025-05-03tests: add FIXME issue for `debuginfo-type-name-layout-ice-94961-2.rs`Jieyou Xu-3/+5
2025-05-03tests: justify why `want-abort-got-unwind{,2}.rs` ignore additional errorsJieyou Xu-10/+18
2025-05-03tests: explain why `two-panic-runtimes.rs` ignores target-dependent errorsJieyou Xu-5/+9
2025-05-03tests: fix a panic strategy in `cfg_false_no_std-2.rs`Jieyou Xu-4/+5
To avoid having target-dependent "unwinding panics are not supported without std" errors, without regressing test intention.
2025-05-03Just suggest positional arg and adjust issue0139104 ui testxizheyin-29/+84
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-03Report the `unsafe_attr_outside_unsafe` lint at the closest nodeUrgau-0/+16
2025-05-03Rollup merge of #140576 - m-ou-se:fragile-tests, r=compiler-errorsMatthias Krüger-201/+0
Remove fragile equal-pointers-unequal tests. Same as https://github.com/rust-lang/rust/pull/139176 --- These tests were added in #127003 These tests stop working when I change implementation details of format_args!(). These tests shouldn't rely on such implementation details. Do these tests test anything that isn't already covered by other tests? If so, they should be expressed in a less fragile way that doesn't rely on internal details of format_args!(). cc `@GrigorenkoPV,` author of these tests.
2025-05-03Rollup merge of #140395 - RalfJung:target-feature-tests, r=petrochenkovMatthias Krüger-58/+128
organize and extend forbidden target feature tests In particular this adds some loongarch tests for https://github.com/rust-lang/rust/pull/135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help. try-job: `x86_64-gnu-llvm-20-*`
2025-05-03Rollup merge of #138712 - petrochenkov:impasst, r=fmeaseMatthias Krüger-40/+117
resolve: Support imports of associated types and glob imports from traits Follow up to https://github.com/rust-lang/rust/pull/134754, part of https://github.com/rust-lang/rust/issues/134691. This PR also closes https://github.com/rust-lang/rust/issues/138711 now. Prohibiting `use Trait::AssocType;` at name resolution stage doesn't make sense, the name itself is perfectly resolveable. It's a type checker's problem that the necessary generic args are not passed when the imported `AssocType` is used, so an error should be reported there. And since we can import associated trait items now, glob imports from traits can also be allowed.
2025-05-03Fix test simd/extract-insert-dyn on s390xEduard Stefes-1/+15
Fix the test for s390x by enabling s390x vector extension via `target_feature(enable = "vector")`(#127506). As this is is still gated by `#![feature(s390x_target_feature)]` we need that attribute also.
2025-05-03Rollup merge of #140606 - nnethercote:hir-pp, r=dtolnayMatthias Krüger-53/+79
Improve hir pretty printing It's currently pretty bad, so a few small improvements can make a big difference. r? `@dtolnay`
2025-05-03Rollup merge of #140568 - moxian:reg-140545, r=compiler-errorsMatthias Krüger-0/+29
Add regression test for #140545 Closes #140545 I am not very knowledgable about the typesystem internals, so I couldn't come up with a good name for the test. But I'm happy to move it to a more appropriate place if there is one (`tests/ui/impl-trait/non-defining-uses` maybe?) r? types (or reroll as appropriate if this is not actually a T-types issue; i'm clueless)
2025-05-03Rollup merge of #140548 - BoxyUwU:gci_patterns_user_ty_annotation, ↵Matthias Krüger-0/+25
r=compiler-errors Emit user type annotations for free consts in pattern position This previously wasnt done because free consts couldn't have any generic parameters that need to be preserved for borrowck. This is no longer the case with `feature(generic_const_items)` r? fmease
2025-05-03Rollup merge of #140505 - petrochenkov:expquote, r=bjorn3Matthias Krüger-0/+10
linker: Quote symbol names in .def files To support weird symbol names, including dots in particular. cc [#134767](https://github.com/rust-lang/rust/pull/134767#issuecomment-2839397610)
2025-05-03Avoid an indent for labelled loops.Nicholas Nethercote-2/+1
2025-05-03Fix some hir pretty-printing over-indenting.Nicholas Nethercote-31/+30
2025-05-03Improve hir pretty-printing of attributes.Nicholas Nethercote-21/+48
2025-05-03Fix hir pretty-printing of `global_asm!`.Nicholas Nethercote-1/+2
One of the boxes isn't closed, and this causes everything after it to be over-indented.
2025-05-02Add a regression testmoxian-0/+29
for #140545
2025-05-02Rollup merge of #140574 - reddevilmidzy:add-test, r=compiler-errorsMatthias Krüger-0/+31
Add regression test for 133065 closes: #133065
2025-05-02Rollup merge of #140550 - Amanieu:stabilize_select_unpredictable, ↵Matthias Krüger-1/+0
r=workingjubilee Stabilize `select_unpredictable` FCP completed in tracking issue #133962.
2025-05-02Rollup merge of #140521 - RalfJung:oob-error, r=saethlinMatthias Krüger-32/+32
interpret: better error message for out-of-bounds pointer arithmetic and accesses Fixes https://github.com/rust-lang/rust/issues/93881 r? `@saethlin`
2025-05-02Rollup merge of #140519 - compiler-errors:name-based-comparison, r=oli-obkMatthias Krüger-0/+40
Use select in projection lookup in `report_projection_error` Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to https://github.com/rust-lang/rust/pull/140278. r? oli-obk
2025-05-02collateral damage in derive tests, improves errors by not refering to ↵Jana Dönszelmann-43/+48
implementation details
2025-05-02Test that names of variables in external macros are not shown on a borrow errorJana Dönszelmann-0/+57
2025-05-02Auto merge of #140581 - Zalathar:rollup-ig2jb9v, r=Zalatharbors-109/+1248
Rollup of 12 pull requests Successful merges: - #134034 (handle paren in macro expand for let-init-else expr) - #137474 (pretty-print: Print shebang at the top of the output) - #138872 (rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs) - #139046 (Improve `Lifetime::suggestion`) - #139206 (std: use the address of `errno` to identify threads in `unique_thread_exit`) - #139608 (Clarify `async` block behaviour) - #139847 (Delegate to inner `vec::IntoIter` from `env::ArgsOs`) - #140159 (Avoid redundant WTF-8 checks in `PathBuf`) - #140197 (Document breaking out of a named code block) - #140389 (Remove `avx512dq` and `avx512vl` implication for `avx512fp16`) - #140430 (Improve test coverage of HIR pretty printing.) - #140507 (rustc_target: RISC-V: feature addition batch 3) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-02linker: Quote symbol names in .def filesVadim Petrochenkov-0/+10
To support weird symbol names, including dots in particular.
2025-05-02resolve: Support imports of associated types and glob imports from traitsVadim Petrochenkov-40/+117
2025-05-02Rollup merge of #140507 - a4lg:riscv-feature-addition-batch-3, r=AmanieuStuart Cook-0/+10
rustc_target: RISC-V: feature addition batch 3 This is the last batch (3 of 3) for RISC-V feature enhancements intended for the version 1.88 cycle. The author's primary criteria are: 1. The extension is ratified and unprivileged one. 2. The extension is in the RVA23U64 profile (to be a baseline of the application-class RISC-V software ecosystem in the near future), either mandatory or optional. 3. Either: 1. To be discoverable through a `riscv_hwprobe` system call on (currently unreleased) Linux 6.15 (as of rc4) or 2. Helps memory/atomics-related operations more efficient and/or more robust. This is based on the specifications: * [The latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications) * [RVA23/RVB23 profiles](https://github.com/riscv/riscv-profiles/releases/tag/rva23-rvb23-ratified) * [RISC-V BF16 extensions](https://github.com/riscv/riscv-bfloat16/releases/tag/v183a3dac863d7c18187a739eb52b0c8f0d16854d) LLVM Definitions: * [`Zicbop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L82-87) * [`Zicbom`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L75-L80) * [`Zic64b`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L71-L73) * [`Ziccamoa`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L97-L99) * [`Ziccif`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L101-L103) * [`Zicclsm`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L105-L107) * [`Ziccrse`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L109-L111) * [`Zfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L320-L325) * [`Zvfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L697-L702) * [`Zvfbfwma`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L704-L710) The `Zicbop` extension (mandatory in RVA23U64) adds prefetch hints to prepare for subsequent memory operations (will be executed as no-op if the hardware does not support this extension). The `Zicbom` extension (mandatory in RVA23U64) adds cache block-management instructions. The author did not include this in the batch 2 (because of limited use cases compared to the `Zicboz` extension) but added because it will be discoverable from Linux (as of version 6.15-rc4). Along with `Zicbop`, Rust now supports all CMO extensions. The `Zic64b` extension (mandatory in RVA23U64) constraints the cache block to be naturally-aligned and exactly 64 bytes. Along with CMO instructions, it can improve efficiency handling with memory (e.g. efficient memory zeroing using `Zicboz` + `Zic64b`). The `Zicc*` extensions (mandatory in RVA23U64) add constraints to the main memory properties. They are normally satisfied in the application environment with regular OSes but profiles like RVA23U64 ensures such properties are satisfied (through those *constraint* extensions). The `Zfbf*` and `Zvfbf*` extensions (optional in RVA23U64) add instructions to handle BF16 (BFloat16) data. Although stabilization of FP-related extensions are relatively far due to ABI-related issues, they are included in this batch because they will be discoverable from Linux (as of version 6.15-rc4). The author also adds the extension implication: `Za64rs` → `Za128rs` (superset) which the author missed to include in #140139.
2025-05-02Rollup merge of #140430 - nnethercote:hir-exhaustive, r=dtolnayStuart Cook-104/+1014
Improve test coverage of HIR pretty printing. Details in individual commits. r? `@dtolnay` try-job: test-various
2025-05-02Rollup merge of #139046 - nnethercote:hir-Lifetime-better, r=lcnrStuart Cook-4/+62
Improve `Lifetime::suggestion` r? ``@lcnr``
2025-05-02Rollup merge of #138872 - a4lg:riscv-fix-incompatible-abi-zfinx, ↵Stuart Cook-1/+21
r=workingjubilee rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs Because RISC-V Calling Conventions note that: > This means code targeting the `Zfinx` extension always uses the ILP32, ILP32E or LP64 integer calling-convention only ABIs as there is no dedicated hardware floating-point register file. `{ILP32,LP64}[FD]` ABIs with hardware floating-point calling conventions are incompatible with the `Zfinx` extension. This commit adds `"zfinx"` to the incompatible feature list to those ABIs and tests whether trying to add `"zdinx"` (that is analogous to `"zfinx"` but in double-precision) on a LP64D ABI configuration results in an error (it also tests extension implication; `Zdinx` requires `Zfinx` extension). Links: RISC-V psABI specification version 1.0 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/v1.0/riscv-cc.adoc#named-abis> <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-02Rollup merge of #137474 - VlaDexa:shebang-placement, r=wesleywiserStuart Cook-0/+18
pretty-print: Print shebang at the top of the output Shebang should stay at the top of the file, even after pretty-printing. Closes #134643
2025-05-02Rollup merge of #134034 - bvanjoi:issue-131655, r=petrochenkovStuart Cook-0/+123
handle paren in macro expand for let-init-else expr Fixes #131655 This PR modifies the codegen logic of the macro expansion within `let-init-else` expression: - Before: The expression `let xxx = (mac! {}) else {}` expands to `let xxx = (expanded_ast) else {}`. - After: The same expression expands to `let xxx = expanded_ast else {}`. An alternative solution to this issue could involve handling the source code directly when encountering unused parentheses in `let-init-else` expressions. However, this approach might be more cumbersome due to the absence of the necessary data structure. r? `@petrochenkov`
2025-05-02add more revisions to cover more architecturesRalf Jung-21/+88
2025-05-02give the abi-relevant target feature tests better namesRalf Jung-1/+6