about summary refs log tree commit diff
path: root/tests/ui/drop
AgeCommit message (Collapse)AuthorLines
2025-07-31Rollup merge of #143672 - beepster4096:box_drop_flags_again, r=oli-obkStuart Cook-0/+43
Fix Box allocator drop elaboration New version of rust-lang/rust#131146. Clearing Box's drop flag after running its destructor can cause it to skip dropping its allocator, so just don't. Its cleared by the drop ladder code afterwards already. Unlike the last PR this also handles other types with destructors properly, in the event that we can have open drops on them in the future (by partial initialization or DerefMove or something). Finally, I also added tests for the interaction with async drop here but I discovered rust-lang/rust#143658, so one of the tests has a `knownbug` annotation. Not sure if it should be in this PR at all though. Fixes rust-lang/rust#131082 r? wesleywiser - prev. reviewer
2025-07-28Rollup merge of #144151 - Kivooeo:issue1, r=jieyouxuMatthias Krüger-0/+88
`tests/ui/issues/`: The Issues Strike Back [1/N] I believe I’ve finally brought [my program](https://github.com/Kivooeo/test-manager) to life -- it now handles multiple test moves in one go: plain moves first, then a gentle touch on each file depends on given options. The process should be much smoother now. Of course, I won’t rush through everything in a few days -- that would be unkind to `@Oneirical.` I’ll pace myself. And also I can't have more than one such PR because `issues.txt` will conflict with previous parts after merging them which is not fun as well. This PR is just that: first commit - moves; second - regression comments and the occasional .stderr reblesses, also issue.txt and tidy changes. Nothing special, but progress nonetheless. This is for the purpose of preserving test file history during restructuring Part of https://github.com/rust-lang/rust/issues/133895. r? `@jieyouxu`
2025-07-26Rollup merge of #144356 - GuillaumeGomez:gcc-ignore-tests, r=jieyouxuTrevor Gross-0/+2
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-25fix box destructor generationbeepster4096-0/+43
2025-07-25commentsKivooeo-0/+4
2025-07-25move 28 testsKivooeo-0/+84
2025-07-24Rehome tests/ui/issues/ tests [1/?]Oneirical-0/+32
2025-07-23Add `ignore-backends` annotations in failing GCC backend ui testsGuillaume Gomez-0/+2
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-38/+38
2025-07-11Rollup merge of #143303 - Kivooeo:tf28, r=tgross35Matthias Krüger-0/+12
`tests/ui`: A New Order [28/28] FINAL PART > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ``@tgross35``
2025-07-10cleaned up some testsKivooeo-7/+7
2025-07-04Rollup merge of #143300 - Kivooeo:tf25, r=tgross35Jubilee-0/+72
`tests/ui`: A New Order [25/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-05cleaned up some testsKivooeo-10/+18
2025-07-02Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31bors-351/+304
Remove let_chains unstable feature Per https://github.com/rust-lang/rust/issues/53667#issuecomment-3016742982 (but then I also noticed rust-lang/rust#140722) This replaces the feature gate with a parser error that says let chains require 2024. A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.
2025-07-01moved testsKivooeo-0/+12
2025-07-01moved testsKivooeo-0/+64
2025-07-01cleaned up some testsKivooeo-27/+21
2025-06-30Remove let_chains featureCameron Steffen-351/+304
2025-06-30moved testsKivooeo-0/+46
2025-06-12Rollup merge of #142219 - Kivooeo:tf11, r=wesleywiserMatthias Krüger-0/+42
`tests/ui`: A New Order [11/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@jieyouxu`
2025-06-11cleaned up some testsKivooeo-0/+42
2025-06-09Rollup merge of #142193 - dianne:binding-drop-order-edge-case-tests, r=NadrierilMatthias Krüger-0/+109
add tests for pattern binding drop order edge cases This adds tests for rust-lang/rust#142163, rust-lang/rust#142057, and rust-lang/rust#142056. I'm using these tests to help make sure I don't commit breaking changes when implementing match lowering for guard patterns, but I think it makes sense to add them separately. They don't directly have anything to do with guard patterns. r? `@Nadrieril` or reassign
2025-06-08add tests for pattern binding drop order edge casesdianne-0/+109
I couldn't find existing tests that for this behavior, so this should make sure it doesn't accidentally change.
2025-06-06Reduce confusion of some drop order testsJake Goulding-29/+18
In addition to adhering to normal Rust casing idioms, I ran `rustfmt`.
2025-06-05Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax, ↵bors-10/+10
r=traviscross,jieyouxu Add a new `mismatched-lifetime-syntaxes` lint The lang-team [discussed this](https://hackmd.io/nf4ZUYd7Rp6rq-1svJZSaQ) and I attempted to [summarize](https://github.com/rust-lang/rust/pull/120808#issuecomment-2701863833) their decision. The summary-of-the-summary is: - Using two different kinds of syntax for elided lifetimes is confusing. In rare cases, it may even [lead to unsound code](https://github.com/rust-lang/rust/issues/48686)! Some examples: ```rust // Lint will warn about these fn(v: ContainsLifetime) -> ContainsLifetime<'_>; fn(&'static u8) -> &u8; ``` - Matching up references with no lifetime syntax, references with anonymous lifetime syntax, and paths with anonymous lifetime syntax is an exception to the simplest possible rule: ```rust // Lint will not warn about these fn(&u8) -> &'_ u8; fn(&'_ u8) -> &u8; fn(&u8) -> ContainsLifetime<'_>; ``` - Having a lint for consistent syntax of elided lifetimes will make the [future goal](https://github.com/rust-lang/rust/issues/91639) of warning-by-default for paths participating in elision much simpler. --- This new lint attempts to accomplish the goal of enforcing consistent syntax. In the process, it supersedes and replaces the existing `elided-named-lifetimes` lint, which means it starts out life as warn-by-default.
2025-06-05Rollup merge of #141974 - Kivooeo:tf4, r=jieyouxuMatthias Krüger-0/+33
`tests/ui`: A New Order [4/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. r? ``@jieyouxu`` added stderr tag for commit which means it included generated stderr
2025-06-04Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`Jake Goulding-10/+10
2025-06-04cleaned up some testsKivooeo-0/+33
2025-06-03Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-2/+2
This allows for testing these tests on editions other than 2015
2025-05-21Rollup merge of #140981 - est31:guard_let_chains_tests, r=petrochenkovMatthias Krüger-48/+130
Add match guard let chain drop order and scoping tests We have a bunch of tests for if let chain drop order, but those tests don't cover match guard chains to the same depth. This PR adds the following tests: * match guard equivalents of the if let chains tests in the `drop-order-comparisons.rs` test, added by #133605. * match guard equivalent of the `mir_let_chains_drop_order.rs` test, added by #107251 * match guard equivalent of `temporary-early-drop.rs`, added by #133093 The added tests all have variants for 2021 and 2024, showing that the behavior on both editions matches that of if let chains on 2024. tracking issue: https://github.com/rust-lang/rust/issues/51114
2025-05-13Add match guard chains to drop-order-comparisons.rsest31-48/+130
2025-05-12Flush errors before deep normalize in dropck_outlivesMichael Goulet-0/+107
2025-04-18Remove let_chains feature gate from even more testsest31-2/+2
2025-04-18Stabilize let chains on edition 2024est31-5/+9
2025-04-11Use delayed bug for normalization errors in drop elaborationMatthew Jasper-0/+130
Normalization can fail from errors from other items so use a delayed bug instead of checking the body.
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-4/+4
2025-04-06Stop calling source_span query in significant drop order codeMichael Goulet-262/+96
2025-04-04adt_destructor: sanity-check returned itemMaja Kądziołka-0/+28
Fixes #139278
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-1/+2
2025-02-26Print out destructorMichael Goulet-0/+180
2025-02-24Consider lvalues of field and index as possibly temporary placesMichael Goulet-1/+38
2025-02-24Improve behavior of IF_LET_RESCOPE around temporaries and place expressionsMichael Goulet-0/+29
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-10/+15
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-01-24Rollup merge of #135926 - jieyouxu:needs-subprocess-thread, r=oli-obkMatthias Krüger-2/+2
Implement `needs-subprocess` directive, and cleanup a bunch of tests to use `needs-{subprocess,threads}` ### Summary Closes #128295. - Implements `//@ needs-subprocess` directive in compiletest as requested in #128295. However, compiletest is a host tool, so we can't just try to spawn process because that spawns the process on *host*, not the *target*, under cross-compilation scenarios. - The short-term solution is to add *Yet Another* list of allow-list targets. - The long-term solution is to first check if a `$target` supports std, then try to run a binary to do run-time capability detection *on the target*. But that is tricky because you have to build-and-run a binary *for the target*. - This PR picks the short-term solution, because the long-term solution is highly non-trivial, and it's already an improvement over individual `ignore-*`s all over the place. - Opened an issue about the long-term solution in #135928. - Documents `//@ needs-subprocess` in rustc-dev-guide. - Replace `ignore-{wasm,wasm32,emscripten,sgx}` with `needs-{subprocess,threads}` where suitable in tests. - Some drive-by test changes as I was trying to figure out if I could use `needs-{subprocess,threads}` and found some bits needlessly distracting. Count of tests that use `ignore-{wasm,wasm32,emscripten,sgx}` before and after this PR: | State | `ignore-sgx` | `ignore-wasm` | `ignore-emscripten` | | - | - | - | - | | Before this PR | 96 | 88 | 207 | | After this PR | 36 | 38 | 61 | <details> <summary>Commands used to find out locally</summary> ``` --- before [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-sgx" tests | wc -l 96 [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-wasm" tests | wc -l 88 [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-emscripten" tests | wc -l 207 --- after [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-sgx" tests | wc -l 36 [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-wasm" tests | wc -l 38 [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-emscripten" tests | wc -l 61 ``` </details> ### Review advice - Best reviewed commit-by-commit. - Non-trivial test changes (not mechanically simple replacements) are split into individual commits to help with review. Their individual commit messages give some basic description of the changes. - I *could* split some test changes out into another PR, but I found that I needed to change some tests to `needs-threads`, some to `needs-subprocess`, and some needed to use *both*, so they might conflict and become very annoying. --- r? ``@ghost`` (need to run try jobs) try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: aarch64-gnu try-job: test-various try-job: armhf-gnu
2025-01-23Add extensive set of drop order testsTravis Cross-0/+1627
On lang, we've recently been discussing the drop order with respect to `let` chains apropos of how we shortened temporary lifetimes in Rust 2024 and how we may shorten them further in the future. Here we add an extensive set of tests that demonstrate the drop order in the cases that interest us.
2025-01-23tests: use `needs-threads` instead of `ignore-emscripten`许杰友 Jieyou Xu (Joe)-2/+2
2025-01-22Auto merge of #134478 - compiler-errors:attr-span, r=oli-obkbors-1/+1
Properly record metavar spans for other expansions other than TT This properly records metavar spans for nonterminals other than tokentree. This means that we operations like `span.to(other_span)` work correctly for macros. As you can see, other diagnostics involving metavars have improved as a result. Fixes #132908 Alternative to #133270 cc `@ehuss` cc `@petrochenkov`
2025-01-08Try to explain borrow for tail expr temporary drop order change in 2024Michael Goulet-19/+45
2025-01-08Don't do AccessDepth::Drop for types with no drop implMichael Goulet-0/+56
2025-01-08Don't create cycles by normalizing opaques defined in the body we're checkingMichael Goulet-18/+27