about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-07-26Rollup merge of #140871 - Amanieu:naked-asm-label, r=compiler-errorsTrevor Gross-29/+36
Don't lint against named labels in `naked_asm!` Naked functions are allowed to define global labels, just like `global_asm!`.
2025-07-26Rollup merge of #144356 - GuillaumeGomez:gcc-ignore-tests, r=jieyouxuTrevor Gross-34/+123
Add `ignore-backends` annotations in failing GCC backend ui tests Follow-up of https://github.com/rust-lang/rust/pull/144125. In the GCC backend, we don't support all ui tests yet and we have a list of tests we currently ignore available [here](https://github.com/rust-lang/rustc_codegen_gcc/blob/master/tests/failing-ui-tests.txt). This PR adds the `ignore-backends` annotations to the corresponding ui tests. The second commit is a fix to compiletest, complaining about `ignore-backends`. r? ```@jieyouxu```
2025-07-26Rollup merge of #144341 - CaiWeiran:const-vector_test, r=wesleywiserTrevor Gross-0/+2
Enable const-vector.rs test on RISC-V (riscv64) This PR replaces [#144283](https://github.com/rust-lang/rust/pull/144283) to resolve merge conflicts. This PR adds support for running the `tests/codegen/const-vector.rs` test on the RISC-V (riscv64) architecture. Previously, this test would fail on RISC-V targets due to architecture-specific code generation issues. This patch modifies the test to ensure compatibility while preserving its intent. The change has been tested locally using `./x test` on a riscv64 target, and the test now passes as expected. ### Notes: - This change is scoped specifically to improve RISC-V compatibility. - It does not affect behavior or test results on other architectures.
2025-07-26Rollup merge of #144339 - CaiWeiran:dwarf-mixed-versions-lto_test, r=wesleywiserTrevor Gross-3/+4
Enable dwarf-mixed-versions-lto.rs test on RISC-V (riscv64) This PR replaces [#144284](https://github.com/rust-lang/rust/pull/144284) to resolve merge conflicts. This PR adds support for running the `tests/assembly/dwarf-mixed-versions-lto.rs` test on the RISC-V (riscv64) architecture. Previously, this test would fail on RISC-V targets due to architecture-specific code generation issues. This patch modifies the test to ensure compatibility while preserving its intent. The change has been tested locally using `./x test` on a riscv64 target, and the test now passes as expected. ### Notes: - This change is scoped specifically to improve RISC-V compatibility. - It does not affect behavior or test results on other architectures.
2025-07-26Rollup merge of #144201 - estebank:suggest-clone, r=SparrowLiiTrevor Gross-0/+312
Mention type that could be `Clone` but isn't in more cases When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ``` CC rust-lang/rust#68119.
2025-07-26Rollup merge of #144089 - Oneirical:uncountable-integer-1, r=jieyouxuTrevor Gross-49/+107
Rehome 35 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` rust-lang/rust#143902 divided into smaller, easier to review chunks. Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer The URL addition at the end, as well as moving around the auxiliary files and editing the `stderr` files with the new filename, were done using a Python script. Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
2025-07-26Disable has_reliable_f128_math on musl targetsJens Reidel-2/+4
musl does not implement the symbols required by std for f128 maths. Disable the associated cfg for all musl targets and adjust the tests accordingly. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-26Revert "coverage: Enlarge empty spans during MIR instrumentation, not codegen"Zalathar-17/+20
This reverts commit f877aa7d14916f71a2f88c6d4c009e7ded7684c4.
2025-07-26Don't lint against named labels in `naked_asm!`Amanieu d'Antras-29/+36
Naked functions are allowed to define global labels, just like `global_asm!`.
2025-07-25Check statics' type in type_of.Camille GILLOT-251/+235
2025-07-25Look at layout for completeness.Camille GILLOT-3/+51
2025-07-26Implement support for explicit tail calls in the MIR block builders and the ↵Joel Wejdenstål-0/+35
LLVM codegen backend.
2025-07-26`loop_match`: suggest extracting to a `const` itemFolkert de Vries-0/+232
if the expression cannot be evaluated in a straightforward way
2025-07-25Update ui tests with new macro early erroringGuillaume Gomez-245/+303
2025-07-25Add missing `NOTE` annotations in `tests/ui/macros/trace-macro.rs`Guillaume Gomez-0/+3
2025-07-25add //@ needs-unwind to testbeepster4096-0/+1
2025-07-25Update mir-opt expected output for matches! macroJonas Platte-10/+26
2025-07-25Allow pretty printing paths with `-Zself-profile-events=args`Jakub Beránek-0/+18
2025-07-25async drop tests for boxbeepster4096-0/+255
2025-07-25fix box destructor generationbeepster4096-0/+267
2025-07-25canonicalize build root in `tests/run-make/linker-warning`Waffle Lapkin-1/+3
2025-07-25Mention type that could be `Clone` but isn't in more casesEsteban Küber-0/+312
When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ```
2025-07-25commentsKivooeo-38/+89
2025-07-25move 28 testsKivooeo-0/+0
2025-07-25uniquify root goals during HIR typecklcnr-12/+73
2025-07-25moved 34 tests to organized locationsKivooeo-0/+0
2025-07-25Rollup merge of #144390 - oli-obk:arbitrary-enum-discrs, r=SparrowLiiMatthias Krüger-8/+31
Remove dead code and extend test coverage and diagnostics around it I was staring a bit at the `dont_niche_optimize_enum` variable and figured out that part of it is dead code (at least today it is). I changed the diagnostic and test around the code that makes that part dead code, so everything that makes removing that code sound is visible in this PR
2025-07-25Rollup merge of #144340 - Oneirical:uncertain-illusion, r=jieyouxuMatthias Krüger-0/+0
UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern` To match convention, rename `tests/ui/SUMMARY.md` to `tests/ui/README.md`. Also, remove misleading lines in the rustc development guide about `error-pattern` being "not recommended", when it really is just a last resort which *should* be used in the niche situations where it is useful. r? ````@jieyouxu````
2025-07-25Rollup merge of #144209 - scottmcm:assume_less, r=lcnr,dianqkMatthias Krüger-8/+41
Don't emit two `assume`s in transmutes when one is a subset of the other For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other. Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
2025-07-25Rollup merge of #144200 - estebank:dont-point-at-closure, r=lcnrMatthias Krüger-48/+65
Tweak output for non-`Clone` values moved into closures When we encounter a non-`Clone` value being moved into a closure, try to find the corresponding type of the binding being moved, if it is a `let`-binding or a function parameter. If any of those cases, we point at them with the note explaining that the type is not `Copy`, instead of giving that label to the place where it is captured. When it is a `let`-binding with no explicit type, we point at the initializer (if it fits in a single line). ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | | | captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- variable moved due to use in coroutine ``` instead of ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait ```
2025-07-25Rollup merge of #143979 - dpaoliello:arm64ectest, r=petrochenkovMatthias Krüger-2/+6
Test fixes for Arm64EC Windows * `tests/ui/cfg/conditional-compile-arch.rs` needs an Arm64EC case. * `tests/ui/runtime/backtrace-debuginfo.rs` should skip Arm64EC as it suffers from the same truncated backtraces as Arm64 Windows. * `tests/ui/linkage-attr/incompatible-flavor.rs` is a general issue: it assumes that the Rust compiler is always built with the x86 target enabled in the backend, but I only enabled AArch64 when building locally to speed up the LLVM compilation.
2025-07-25Rollup merge of #143401 - Enselic:no-stack-backtrace-print-in-display, ↵Matthias Krüger-6/+2
r=davidtwco tests: Don't check for self-printed output in std-backtrace.rs test The `Display` implementation for `Backtrace` used to print stack backtrace: but that print was since removed. See https://github.com/rust-lang/backtrace-rs/pull/286 and https://github.com/rust-lang/rust/pull/69042. To make the existing test pass, the print was added to the test instead. But it doesn't make sense to check for something that the test itself does since that will not detect any regressions in the implementation of `Backtrace`. What the test _should_ check is that "stack backtrace:" is _not_ printed in `Display` of `Backtrace`. So do that instead. This is one small steps towards resolving https://github.com/rust-lang/rust/issues/71706. The next steps after this step involves extending and hardening that test further.
2025-07-25Rollup merge of #142569 - xizheyin:139253, r=davidtwcoMatthias Krüger-0/+68
Suggest clone in user-write-code instead of inside macro Fixes rust-lang/rust#139253 Inspired by rust-lang/rust#142543 r? ````@fmease````
2025-07-25Check static is sized when building MIR.Camille GILLOT-28/+33
2025-07-25Do not assert layout in KnownPanicsLint.Camille GILLOT-28/+126
2025-07-25Add crash tests.Camille GILLOT-0/+19
2025-07-25tests: aarch64-outline-atomics: Remove hardcoded targetJens Reidel-2/+0
Since this test is limited to aarch64 and linux hosts, the --target flag is entirely unnecessary and only breaks this on musl hosts. Let the compiler use the default target instead. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-24Rename tests/ui/SUMMARY.md and update rustc dev guide on error-patternOneirical-0/+0
2025-07-24Rehome tests/ui/issues/ tests [1/?]Oneirical-49/+107
2025-07-24Auto merge of #144389 - scottmcm:no-more-mir-cast-assume, r=davidtwcobors-73/+36
MIR-build: No longer emit assumes in enum-as casting This just uses the `valid_range` from the backend, so it's duplicating the range metadata that now we include on parameters and loads, and thus no longer seems to be useful -- notably there's no codegen test failures from removing it. (Because it's using data from the same source as the backend annotations, it doesn't do anything to mitigate things like rust-lang/rust#144388 where the range in the layout is more permissive than the actual possible discriminants. A variant of this that actually checked the discriminants more specifically might be useful, so could potentially be added in future, but I don't think the *current* checks are actually providing value.) r? mir Randomly turns out that this Fixes https://github.com/rust-lang/rust/issues/121097
2025-07-24Add test case for single boundBen Schulz-1/+35
2025-07-24Fix unused_parens false positiveBen Schulz-0/+9
2025-07-24MIR-build: No longer emit assumes in enum-as castingScott McMurray-73/+36
This just uses the `valid_range` from the backend, so it's duplicating the range metadata that now we include on parameters and loads.
2025-07-24move bad-intra-doc test into intra-doc dirbinarycat-0/+0
2025-07-24rustdoc::broken_intra_doc_links: only be lenient with shortcut linksbinarycat-2/+10
collapsed links and reference links have a pretty particular syntax, it seems unlikely they would show up on accident. Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-07-24rustdoc: update tests to match new lint behaviorbinarycat-25/+3
2025-07-24adjust more unit tests to reflect more aggressive intra-doc lintingbinarycat-21/+230
2025-07-24get rid of some false negatives in rustdoc::broken_intra_doc_linksbinarycat-0/+44
rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links ([text](url)) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. Co-authored-by: Michael Howell <michael@notriddle.com>
2025-07-24asm: Stabilize loongarch32WANG Rui-41/+157
2025-07-24Rollup merge of #144358 - JonathanBrouwer:fix-stability-malformed, r=oli-obkLeón Orell Valerian Liehr-10/+22
Stop using the old `validate_attr` logic for stability attributes I think this was accidentally missed when implementing the stability attributes? r? `````@oli-obk````` cc `````@jdonszelmann`````