about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-08-06[codegen] assume the tag, not the relative discriminantScott McMurray-42/+55
2025-08-06tidyBoxy-48/+48
2025-08-06Add regression test for rustdoc scrape-examples feature crash (#144752)Guillaume Gomez-0/+35
2025-08-06Rollup merge of #144913 - GuillaumeGomez:fix-wrong-i-icon, r=fmeaseJakub Beránek-2/+31
[rustdoc] Fix wrong `i` tooltip icon Current wrong display: <img width="334" height="37" alt="Screenshot From 2025-08-04 17-42-38" src="https://github.com/user-attachments/assets/57046475-6162-487f-998f-ebb2434c111d" /> With the fix: <img width="334" height="37" alt="image" src="https://github.com/user-attachments/assets/e761a103-dc39-4e30-8c8e-cfc7fab52fde" /> r? ``@fmease``
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-1853/+2
2025-08-06Embed GDB pretty printers in rlibs and dylibsSebastian Poeplau-0/+2
Instead of collecting pretty printers transitively when building executables/staticlibs/cdylibs, let the debugger find each crate's pretty printers via its .debug_gdb_scripts section. This covers the case where libraries defining custom pretty printers are loaded dynamically.
2025-08-06Fortify generic param default checksLeón Orell Valerian Liehr-186/+196
2025-08-05rustdoc: fix caching of intra-doc links on reexportsbinarycat-0/+35
2025-08-05Add aarch64_be-unknown-none-softfloat targetJens Reidel-0/+3
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
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-05Preserve the .debug_gdb_scripts sectionSebastian Poeplau-15/+24
Make sure that compiler and linker don't optimize the section's contents away by adding the global holding the data to "llvm.used". The volatile load in the main shim is retained because "llvm.used", which translates to SHF_GNU_RETAIN on ELF targets, requires a reasonably recent linker; emitting the volatile load ensures compatibility with older linkers, at least when libstd is used. Pretty printers in dylib dependencies are now emitted by the main crate instead of the dylib; apart from matching how rlibs are handled, this approach has the advantage that `omit_gdb_pretty_printer_section` keeps working with dylib dependencies.
2025-08-05Add test for "missing function argument" on multiline callSasha Pourcelot-3/+41
2025-08-04Let `RemoveUnneededDrops` also remove `drop_in_place`Scott McMurray-5/+9
2025-08-05Added checks for attribute in type caseKivooeo-16/+304
2025-08-05Promote crash test.Camille GILLOT-4/+27
2025-08-05Rollup merge of #144920 - compiler-errors:span-arg, r=lqdSamuel Tardieu-5/+5
Dont print arg span in MIR dump for tail call r? WaffleLapkin This makes the MIR dump for tail call terminators consistent w/ regular calls.
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-203/+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-04[win][arm64ec] Fix msvc-wholearchive for Arm64ECDaniel Paoliello-3/+3
2025-08-04Rehome tests/ui/issues/ tests [3/?]Oneirical-58/+89
2025-08-04Dont print arg span in MIR dump for tail callMichael Goulet-5/+5
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-04Add GUI regression test for tooltips `i` iconsGuillaume Gomez-0/+15
2025-08-04Fix wrong font being used for tooltips `i` iconsGuillaume Gomez-2/+16
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-03Add a mir-opt test for an unneeded drop_in_placeScott McMurray-0/+33
2025-08-04Rollup merge of #144875 - scottmcm:more-mir-tests, r=cjgillotStuart Cook-0/+403
Add some pre-codegen MIR tests for debug mode No functional changes; just some tests. I made these for rust-lang/rust#144483, but that's going in a different direction, so I wanted to propose we just add them to help see the impact of other related changes in the future. r? mir
2025-08-04coverage: Remove `-Zcoverage-options=no-mir-spans`Zalathar-203/+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 #144667 - scottmcm:alignment-is-usize, r=tgross35Stuart Cook-34/+17
`AlignmentEnum` should just be `repr(usize)` now These used to use specific sizes because they were compiled on all widths. But now that the types themselves are `#[cfg]`'d, we can save some conversions by having it always be `repr(usize)`.
2025-08-04Rollup merge of #144559 - CaiWeiran:extract-insert-dyn_test, r=Mark-SimulacrumStuart Cook-9/+18
Enable extract-insert-dyn.rs test on RISC-V (riscv64) This PR adds support for running the `tests/codegen-llvm/simd/extract-insert-dyn.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-08-04Rollup merge of #144497 - Enselic:basic-stepping, r=Mark-SimulacrumStuart Cook-0/+47
tests: Add test for basic line-by-line stepping in a debugger Let's wait with lldb testing until the test works properly with gdb. This is a regression test to prevent further regressions of https://github.com/rust-lang/rust/issues/33013 which unfortunately regressed in **nightly-2023-04-24**. See https://github.com/rust-lang/rust/issues/33013#issuecomment-3121579216.
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-03Add a debug-mode MIR pre-codegen test for `?`-on-`Option`Scott McMurray-0/+197