about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-08-06Explicitly disable vector feature on s390x baseline of bad-reg testPaul Murphy-1/+1
If the baseline s390x cpu is changed to a newer variant, such as z13, the vector feature may be enabled by default. When rust is packaged on fedora 38 and newer, it is set to z13. Explicitly disable vector support on the baseline test for consistent results across s390x cpus.
2025-08-06Allow function argument mismatch suggestion to be multilineSasha Pourcelot-14/+14
2025-08-06Rollup merge of #144910 - ShoyuVanilla:add-regression-tests, r=fee1-deadJakub Beránek-0/+73
Add regression tests for seemingly fixed issues Closes rust-lang/rust#104314 Closes rust-lang/rust#125866
2025-08-06Rollup merge of #144552 - Oneirical:uncountable-integer-3, r=jieyouxuJakub Beránek-58/+89
Rehome 33 `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 Inspired by the methodology that ``@Kivooeo`` was using. r? ``@jieyouxu``
2025-08-06coverage: Remove all unstable support for MC/DC instrumentationZalathar-27/+2
2025-08-06Fortify generic param default checksLeón Orell Valerian Liehr-186/+196
2025-08-05commentsKivooeo-73/+84
2025-08-05moved 35 tests to organized locationsKivooeo-0/+0
2025-08-05Add regression tests for seemingly fixed issuesShoyu Vanilla-0/+73
2025-08-05Gate const trait syntaxLeón Orell Valerian Liehr-3/+26
2025-08-05Mark all deprecation lints in name resolution as deny-by-default and ↵Vadim Petrochenkov-38/+289
report-in-deps
2025-08-05Add test for "missing function argument" on multiline callSasha Pourcelot-3/+41
2025-08-05Added checks for attribute in type caseKivooeo-16/+304
2025-08-05Promote crash test.Camille GILLOT-0/+27
2025-08-05Rollup merge of #144894 - jieyouxu:chop-thread-cnt, r=ChrisDentonSamuel Tardieu-64/+0
Delete `tests/ui/threads-sendsync/tcp-stress.rs` This stress test was originally introduced in 65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in `libuv` (see rust-lang/rust#12823), but we no longer use `libuv`, so remove this test as it no longer serves its original purpose, and is causing flaky timeout failures. Closes rust-lang/rust#144878 (by removing the test). r? libs
2025-08-05Rollup merge of #144877 - Zalathar:coverage-various, r=lcnrSamuel Tardieu-1/+1
coverage: Various small cleanups This PR is a collection of small coverage-related changes that I accumulated while working towards other coverage improvements. Each change should hopefully be fairly straightforward.
2025-08-05Rollup merge of #144817 - WaffleLapkin:reject-referety, r=UrgauSamuel Tardieu-0/+145
Properly reject tail calls to `&FnPtr` or `&FnDef` Fixes rust-lang/rust#144795
2025-08-05Rollup merge of #144741 - ShoyuVanilla:tilde-const-in-block, r=fee1-deadSamuel Tardieu-26/+85
fix: Error on illegal `[const]`s inside blocks within legal positions Fixes rust-lang/rust#132067 I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here: https://github.com/rust-lang/rust/blob/3fb1b53a9dbfcdf37a4b67d35cde373316829930/compiler/rustc_ast_passes/src/ast_validation.rs#L1596-L1610 Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
2025-08-05Rollup merge of #144548 - Oneirical:uncountable-integer-2, r=jieyouxuSamuel Tardieu-78/+87
Rehome 21 `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 Inspired by the methodology that ``@Kivooeo`` was using. r? ``@jieyouxu``
2025-08-04Rehome tests/ui/issues/ tests [3/?]Oneirical-58/+89
2025-08-04Include whitespace in "remove `|`" suggestion and make it hiddenEsteban Küber-116/+48
2025-08-04fix `#[loop_match]` on diverging loopFolkert de Vries-0/+44
this generated invalid MIR before
2025-08-04Tweak auto trait errorsEsteban Küber-32/+102
Make suggestions to remove params and super traits tool-only, and make the suggestion span more accurate. ``` error[E0567]: auto traits cannot have generic parameters --> $DIR/auto-trait-validation.rs:6:19 | LL | auto trait Generic<T> {} | -------^^^ | | | auto trait cannot have generic parameters error[E0568]: auto traits cannot have super traits or lifetime bounds --> $DIR/auto-trait-validation.rs:8:20 | LL | auto trait Bound : Copy {} | ----- ^^^^ | | | auto traits cannot have super traits or lifetime bounds ``` ``` error[E0380]: auto traits cannot have associated items --> $DIR/issue-23080.rs:5:8 | LL | unsafe auto trait Trait { | ----- auto traits cannot have associated items LL | fn method(&self) { | ^^^^^^ ```
2025-08-04Port `#[coroutine]` to the new attribute systemSasha Pourcelot-6/+9
Related to https://github.com/rust-lang/rust/issues/131229#issue-2565886367.
2025-08-04Enforce tail call type is related to body return type in borrowckMichael Goulet-0/+26
2025-08-04Suggest bounds in more cases, accounting for type parameters referenced in ↵Esteban Küber-4/+68
predicate
2025-08-04Anonymize binders in tail call sigMichael Goulet-0/+13
2025-08-04Remove `tcp-stress.rs` testJieyou Xu-64/+0
This stress test was originally introduced in 65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in libuv (see RUST-12823), but we no longer use libuv, so remove this test as it was causing flaky timeout failures. See RUST-144878 for discussion.
2025-08-04properly reject tail calls to `&FnPtr` or `&FnDef`Waffle Lapkin-0/+145
2025-08-04coverage: Remove `-Zcoverage-options=no-mir-spans`Zalathar-1/+1
This flag turned out to be less useful than anticipated, and interferes with work towards expansion support.
2025-08-04Rollup merge of #144785 - lucarlig:master, r=lqdStuart Cook-0/+18
Regression test for LLVM error with unsupported expression in static initializer for const pointer in array on macOS. Regression test for rust-lang/rust#89225, I have shortened the original example as much as i could, while still generating the error. here is my output on MacOs: ``` rustup run 1.60 cargo build --release Compiling rug_int v0.1.0 (/Users/luca/dev/rug_int) LLVM ERROR: Unsupported expression in static initializer: zext (i64 ptrtoint (<{ [4 x i8] }>* `@anon.fad58de7366495db4650cfefac2fcd61.0` to i64) to i128) error: could not compile `rug_int` rustup run 1.61 cargo build --release Compiling rug_int v0.1.0 (/Users/luca/dev/rug_int) Finished release [optimized] target(s) in 0.60s ```
2025-08-04Rollup merge of #144322 - Urgau:dangling-ptr-from-locals, r=oli-obkStuart Cook-0/+435
Add lint against dangling pointers from local variables ## `dangling_pointers_from_locals` *warn-by-default* The `dangling_pointers_from_locals` lint detects getting a pointer to data of a local that will be dropped at the end of the function. ### Example ```rust fn f() -> *const u8 { let x = 0; &x // returns a dangling ptr to `x` } ``` ```text warning: a dangling pointer will be produced because the local variable `x` will be dropped --> $DIR/dangling-pointers-from-locals.rs:10:5 | LL | fn simple() -> *const u8 { | --------- return type of the function is `*const u8` LL | let x = 0; | - `x` is defined inside the function and will be drop at the end of the function LL | &x | ^^ | = note: pointers do not have a lifetime; after returning, the `u8` will be deallocated at the end of the function because nothing is referencing it as far as the type system is concerned = note: `#[warn(dangling_pointers_from_locals)]` on by default ``` ### Explanation Returning a pointer from a local value will not prolong its lifetime, which means that the value can be dropped and the allocation freed while the pointer still exists, making the pointer dangling. If you need stronger guarantees, consider using references instead, as they are statically verified by the borrow-checker to never dangle. ------ This is related to GitHub codeql [CWE-825](https://github.com/github/codeql/blob/main/rust/ql/src/queries/security/CWE-825/AccessAfterLifetimeBad.rs) which shows examples of such simple miss-use. It should be noted that C compilers warns against such patterns even without `-Wall`, https://godbolt.org/z/P7z98arrc. ------ `@rustbot` labels +I-lang-nominated +T-lang cc `@traviscross` r? compiler
2025-08-03Rollup merge of #144851 - WaffleLapkin:instrinsic-deny, ↵Samuel Tardieu-0/+27
r=compiler-errors,scottmcm Forbid tail calling intrinsics There is only one intrinsic that can be called on stable, as far as I can find, (`transmute`). And in general tail calling intrinsics doesn't make much sense. Alternative to rust-lang/rust#144815 (and thus closes rust-lang/rust#144815) Fixes https://github.com/rust-lang/rust/issues/144806 r? ``@scottmcm``
2025-08-03Rollup merge of #144738 - bjorn3:remove_omit_gdb_pretty_printer_section, ↵Samuel Tardieu-107/+80
r=jieyouxu Remove the omit_gdb_pretty_printer_section attribute Disabling loading of pretty printers in the debugger itself is more reliable. Before this commit the .gdb_debug_scripts section couldn't be included in dylibs or rlibs as otherwise there is no way to disable the section anymore without recompiling the entire standard library.
2025-08-03forbid tail calling intrinsicsWaffle Lapkin-0/+27
2025-08-04fix: Error on illegal `[const]`s inside blocks within legal positionsShoyu Vanilla-26/+85
2025-08-03Auto merge of #144732 - lcnr:ignore-shadowed-impls, r=compiler-errorsbors-0/+81
dont assemble shadowed impl candidates Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/109. I've originally intended to fix this by supporting lazy reevaluation when rerunning cycles. This ended up being really difficult, see https://github.com/lcnr/search_graph for my notes used while working on this. It is also insufficient for the `rayon-hang-2.rs` test as we end up with goals which we need to rerun for all combinations of provisional results. While landing such an optimization in the future may still be desirable, it is very difficult and insufficient to fix these hangs. Also see the relevant [zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/rustc-rayon.20hang/near/527850058). I was previously opposed to avoiding assembling shadowed impls as it may prevent future improvements in this area, cc rust-lang/rust#141226. Going to track this and the reasoning behind it in https://github.com/rust-lang/trait-system-refactor-initiative/issues/226. r? `@BoxyUwU` `@compiler-errors`
2025-08-02Rehome tests/ui/issues/ tests [2/?]Oneirical-78/+52
2025-08-02c-variadic: multiple ABIs in the same program for armFolkert de Vries-0/+77
2025-08-02Rollup merge of #144756 - WaffleLapkin:inf-rec-etc-ctfe, r=lqdSamuel Tardieu-0/+27
detect infinite recursion with tail calls in ctfe fixes rust-lang/rust#144753
2025-08-02Rollup merge of #144703 - daltenty:daltenty/extern-weak, r=NoratriebSamuel Tardieu-0/+1
[test][AIX] ignore extern_weak linkage test The AIX linkage model doesn't support ELF-style extern_weak semantics, so just skip this test, like other platforms that don't have it.
2025-08-02Rollup merge of #143360 - folkertdev:const-continue-outside-loop-match, ↵Samuel Tardieu-6/+73
r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue https://github.com/rust-lang/rust/issues/132306 fixes https://github.com/rust-lang/rust/issues/143119 fixes https://github.com/rust-lang/rust/issues/143165 Fixes several ICEs because a panic was reachable. ``````@rustbot`````` label +F-loop_match
2025-08-02Auto merge of #129183 - estebank:cfg-visitor, r=davidtwcobors-122/+225
Detect more `cfg`d out items in resolution errors Use a visitor to collect *all* items (including those nested) that were stripped behind a `cfg` condition. ``` error[E0425]: cannot find function `f` in this scope --> $DIR/nested-cfg-attrs.rs:4:13 | LL | fn main() { f() } | ^ not found in this scope | note: found an item that was configured out --> $DIR/nested-cfg-attrs.rs:2:4 | LL | fn f() {} | ^ note: the item is gated here --> $DIR/nested-cfg-attrs.rs:1:35 | LL | #[cfg_attr(all(), cfg_attr(all(), cfg(FALSE)))] | ^^^^^^^^^^ ```
2025-08-02Auto merge of #144479 - cjgillot:incr-privacy-mod, r=petrochenkovbors-49/+49
Perform check_private_in_public by module. Based on https://github.com/rust-lang/rust/pull/116316
2025-08-02don't warn on explicit casts of never to any Waffle Lapkin-35/+17
2025-08-02refactor `unreachable/expr_cast.rs` testWaffle Lapkin-20/+21
2025-08-01Tweak rendering of cfg'd out itemEsteban Küber-193/+98
``` error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` --> $DIR/diagnostics-cross-crate.rs:18:23 | LL | cfged_out::inner::doesnt_exist::hello(); | ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner` | note: found an item that was configured out --> $DIR/auxiliary/cfged_out.rs:6:13 | LL | #[cfg(false)] | ----- the item is gated here LL | pub mod doesnt_exist { | ^^^^^^^^^^^^ ```
2025-08-01remove recursive search for itemsEsteban Küber-12/+2
2025-08-01Detect more `cfg`d out items in resolution errorsEsteban Küber-20/+228
Use a visitor to collect *all* items (including those nested) that were stripped behind a `cfg` condition. ``` error[E0425]: cannot find function `f` in this scope --> $DIR/nested-cfg-attrs.rs:4:13 | LL | fn main() { f() } | ^ not found in this scope | note: found an item that was configured out --> $DIR/nested-cfg-attrs.rs:2:4 | LL | fn f() {} | ^ note: the item is gated here --> $DIR/nested-cfg-attrs.rs:1:35 | LL | #[cfg_attr(all(), cfg_attr(all(), cfg(FALSE)))] | ^^^^^^^^^^ ```
2025-08-01Auto merge of #144458 - compiler-errors:no-witness-mini, r=lcnrbors-190/+154
Remove the witness type from coroutine *args* (without actually removing the type) This does as much of rust-lang/rust#144157 as we can without having to break rust-lang/rust#143545 and/or introduce some better way of handling higher ranked assumptions. Namely, it: * Stalls coroutines based off of the *coroutine* type rather than the witness type. * Reworks the dtorck constraint hack to not rely on the witness type. * Removes the witness type from the args of the coroutine, eagerly creating the type for nested obligations when needed (auto/clone impls). I'll experiment with actually removing the witness type in a follow-up. r? lcnr