about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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-02Auto merge of #139883 - matthiaskrgr:crashesapr15, r=Mark-Simulacrumbors-0/+332
crashes: more tests try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-05-02Add regression test for 133065reddevilmidzy-0/+31
2025-05-02Improve coverage of HIR pretty printing.Nicholas Nethercote-104/+1014
By taking the existing `expanded-exhaustive.rs` test and running it with both `Zunpretty=expanded` *and* `Zunpretty=hir`. Also rename some files, and split the asm parts out so they only run on x86-64.
2025-05-02Handle `Path<>` better in error messages.Nicholas Nethercote-10/+8
`Path<>` needs to be distinguished from `Path<T>`. This commit does that, improving some error messages.
2025-05-02Augment `impl-trait-missing-lifetime-gated.rs`.Nicholas Nethercote-5/+65
We have coverage for `Foo` and `Foo<T>` but not for `Foo<>`. This commit adds it. Note that the output has bogus syntax: `impl Foo'a, >`
2025-05-01Rollup merge of #140552 - ↵Guillaume Gomez-1/+7
folkertdev:naked-function-rustc_std_internal_symbol, r=bjorn3 allow `#[rustc_std_internal_symbol]` in combination with `#[naked]` The need for this came up in https://github.com/rust-lang/compiler-builtins/pull/897, but in general this seems useful and valid to allow. Based on a quick scan, I don't think changes to the generated assembly are needed. cc ``@bjorn3``
2025-05-01Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-deadGuillaume Gomez-6/+6
Clean up "const" situation in format_args!(). This cleans up the "const" situation in the format_args!() expansion/lowering. Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const. Example expansion/lowering of format_args!() in const: ```rust // Error: cannot call non-const formatting macro in constant functions const { fmt::Arguments::new_v1( // Now the error is produced here. &["Hello, ", "!\n"], &[ fmt::Argument::new_display(&world) // The error used to be produced here. ], ) } ```
2025-05-01Rollup merge of #140460 - heiher:issue-140455, r=UrgauGuillaume Gomez-18/+16
Fix handling of LoongArch target features not supported by LLVM 19 Fixes #140455
2025-05-01Rollup merge of #140420 - fmease:rustdoc-fix-doctest-heur, r=GuillaumeGomezGuillaume Gomez-51/+154
rustdoc: Fix doctest heuristic for main fn wrapping Fixes #140412 which regressed in #140220 that I reviewed. As mentioned in https://github.com/rust-lang/rust/pull/140220#issuecomment-2837061779, at the time I didn't have the time to re-review its latest changes and should've therefore invalided my previous "r=me" and blocked the PR on another review given the fragile nature of the doctest impl. This didn't happen which is my fault. Contains some other small changes. Diff best reviewed modulo whitespace. r? ``@GuillaumeGomez``
2025-05-01crashes: more testsMatthias Krüger-0/+332
2025-05-01allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`Folkert de Vries-1/+7
2025-05-01Stabilize `select_unpredictable`Amanieu d'Antras-1/+0
FCP completed in tracking issue #133962.
2025-05-01Bless pretty tests.Mara Bos-1/+1
2025-05-01Bless mir opt tests.Mara Bos-1/+1
2025-05-01rustdoc: Fix doctest heuristic for main fn wrappingLeón Orell Valerian Liehr-51/+154
2025-05-01Clean up "const" situation in format_args!().Mara Bos-4/+4
Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.
2025-05-01rustc_target: RISC-V "Zfinx" is incompatible with {ILP32,LP64}[FD] ABIsTsukasa OI-1/+21
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). Link: RISC-V psABI specification version 1.0 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-01Remove redundant min-llvm-version annotations for LoongArch testsWANG Rui-18/+16
2025-05-01rustc_target: RISC-V: Add BF16 extensionsTsukasa OI-0/+3
This commit adds three ratified unprivileged RISC-V extensions related to BFloat16 (BF16) handling. Although that they are far from stabilization due to ABI issues, they are optional extensions of the RVA23U64 profile (application-class processor profile) and going to be discoverable from the Linux kernel (as of version 6.15-rc4). This commit mainly prepares runtime detection of those extensions.
2025-05-01rustc_target: RISC-V: Add atomics/memory-related extensionsTsukasa OI-0/+7
This commit adds a part of RISC-V extensions that are mandatory part of the RVA23U64 profile (application-class processor profile) and related to memory/atomic constraints. The Zic64b extension constrains the cache line to naturally-aligned 64 bytes that would make certain memory operations (like zeroing the memory using the Zicboz extension) easier. The Zicbom and Zicbop extensions enable managing cache block-based operations (the Zicbop contains hints that will work as a NOP when this extension is absent and the Zicbom contains control instructions). Of which, the Zicbom extension is going to be discoverable from the Linux kernel (as of the version 6.15-rc4) and this commit prepares for corresponding stdarch changes. The Zicc* extensions add certain constraints to "the main memory" (usually true on the user mode application on the application-class processor but those extensions make sure such constraints exist).
2025-04-30Rollup merge of #140481 - dpaoliello:reqasan, r=wesleywiserMatthias Krüger-0/+2
Require sanitizers be enabled for asan_odr_windows.rs Issue Details: The `asan_odr_windows.rs` test is failing on AArch64 Windows, as sanitizers aren't supported on that platform. Fix Details: Apply the correct "need sanitizer" requirements to the test.
2025-04-30Rollup merge of #140476 - mejrs:test3, r=jieyouxuMatthias Krüger-61/+0
chore: delete unused ui/auxiliary crates It appears that all the tests that used it have been moved to tests/ui/editions/ (or elsewhere) already. r? `````@jieyouxu`````
2025-04-30Rollup merge of #140467 - BoxyUwU:no_fcw_assoc_consts, r=lcnrMatthias Krüger-0/+23
Don't FCW assoc consts in patterns Fixes #140447 See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though :thinking: The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
2025-04-30Rollup merge of #140465 - mejrs:test2, r=jieyouxuMatthias Krüger-50/+39
chore: edit and move tests I deleted `ui/non-copyable-void.rs`: added in https://github.com/rust-lang/rust/commit/ab4105d9e8b7c0719343aa2e4edd15cae0b7c947 to test that "nonconstructable" enums are "noncopyable", but these properties are not correlated anymore. Second commit is kinda messy because I moved/edited/renamed some files at the same time, but I deleted nothing there.
2025-04-30Rollup merge of #140458 - azhogin:azhogin/async-drop-fix-dropped-tuple-ice, ↵Matthias Krüger-0/+11
r=oli-obk Fix for async drop ice with partly dropped tuple Fixes https://github.com/rust-lang/rust/issues/140427. Problem was with block data access with block id from new added blocks in patch.
2025-04-30Use select in projection lookupMichael Goulet-0/+40
2025-04-30interpret: better error message for out-of-bounds pointer arithmetic and ↵Ralf Jung-32/+32
accesses
2025-04-30Rollup merge of #140504 - tmiasko:answer-ensure-stack, r=jswrennMatthias Krüger-0/+70
transmutability: ensure_sufficient_stack when answering query Based on #140380. Fixes #118860. The compile time was addressed earlier, this merely addresses stack overflow part of the issue. r? `@jswrenn` `@joshlf`
2025-04-30Rollup merge of #140450 - petrochenkov:vistok, r=nnethercoteMatthias Krüger-2/+0
ast: Remove token visiting from AST visitor It's no longer necessary after the removal of nonterminal tokens in #124141. r? `@nnethercote`
2025-04-30Rollup merge of #140203 - Wyliodrin:error_for_no_mangle_weak_language_items, ↵Matthias Krüger-1/+56
r=bjorn3 Issue an error when using `no_mangle` on language items This pull requests adds the code to issue an error or a warning when using `no_mangle` on language items. This should detail why the `undefined symbol` error is issued for the code described in #139923. The pull request adds two ui tests, one testing the error and the other one the warning. I would love some feedback here, as I am not sure that the error and warning are issues using the right API.
2025-04-30Rollup merge of #140090 - Urgau:snake_case-fn-var, r=petrochenkovMatthias Krüger-1/+10
Check bare function idents for non snake-case name This PR adds the check required to lint on bare function idents for non snake-case name. Reported at #140089. cc `@theemathas`
2025-04-30Rollup merge of #139624 - m-ou-se:unconst-format-args, r=jhprattMatthias Krüger-1/+14
Don't allow flattened format_args in const. Fixes https://github.com/rust-lang/rust/issues/139136 Fixes https://github.com/rust-lang/rust/issues/139621 We allow `format_args!("a")` in const, but don't allow any format_args with arguments in const, such as `format_args!("{}", arg)`. However, we accidentally allow `format_args!("hello {}", "world")` in const, as it gets flattened to `format_args!("hello world")`. This also applies to panic in const. This wasn't supposed to happen. I added protection against this in the format args flattening code, ~~but I accidentally marked a function as const that shouldn't have been const~~ but this was removed in https://github.com/rust-lang/rust/pull/135139. This is a breaking change. The crater found no breakage, however. This breaks things like: ```rust const _: () = if false { panic!("a {}", "a") }; ``` and ```rust const F: std::fmt::Arguments<'static> = format_args!("a {}", "a"); ```
2025-04-30Auto merge of #140503 - matthiaskrgr:rollup-n7zigts, r=matthiaskrgrbors-127/+138
Rollup of 11 pull requests Successful merges: - #136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`) - #139059 (uses_power_alignment: wording tweaks) - #139192 (mention provenance in the pointer::wrapping_offset docs) - #140312 (Improve pretty-printing of braces) - #140404 (rm `TypeVistable` impls for `Canonical`) - #140437 (enable msa feature for mips in codegen tests) - #140438 (Add `rust.debug-assertions-tools` option) - #140439 (miri: algebraic intrinsics: bring back float non-determinism) - #140445 (Treat ManuallyDrop as ~const Destruct) - #140446 (chore: fix some tests) - #140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-30error when using no_mangle on language itemsAlexandru RADOVICI-1/+56
add suggestion on how to add a panic breakpoint Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com> delete no_mangle from ui/panic-handler/panic-handler-wrong-location test issue an error for the usage of #[no_mangle] on internal language items delete the comments add newline rephrase note Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> update error not to leak implementation details delete no_mangle_span Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> delete commented code
2025-04-30Add test for format_args!("{}", 0) in const.Mara Bos-1/+14
2025-04-30Rollup merge of #140446 - mejrs:test1, r=jieyouxuMatthias Krüger-109/+53
chore: fix some tests
2025-04-30Rollup merge of #140445 - oli-obk:const-manually-drop, r=fee1-deadMatthias Krüger-0/+41
Treat ManuallyDrop as ~const Destruct cc https://github.com/rust-lang/rust/issues/133214#issuecomment-2838078133 r? ```@compiler-errors``` cc ```@fee1-dead```
2025-04-30Rollup merge of #140437 - husqvarnagroup:af/codegen-test-mips-msa, r=jieyouxuMatthias Krüger-2/+13
enable msa feature for mips in codegen tests Fix codegen unit tests for mips by enabling the msa target feature.
2025-04-30Rollup merge of #140312 - nnethercote:DelimArgs-spacing, r=petrochenkovMatthias Krüger-13/+28
Improve pretty-printing of braces r? ````@petrochenkov````