about summary refs log tree commit diff
path: root/tests/ui/drop
AgeCommit message (Collapse)AuthorLines
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
2025-01-08run borrowck tests on BIDs and emit tail-expr-drop-order lints forDing Xiang Fei-0/+77
potential violations
2024-12-23Always run tail_expr_drop_order lint on promoted MIRMichael Goulet-30/+28
2024-12-21Properly record metavar spans for other expansions other than TTMichael Goulet-1/+1
2024-12-20Handle DropKind::ForLint in coroutines correctlyMichael Goulet-0/+81
2024-12-15Use links to edition guide for edition migrationsEric Huss-25/+25
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-12/+0
span rendering
2024-12-12Tweak multispan renderingEsteban Küber-36/+0
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-02reduce false positives on some common cases from if-let-rescopeDing Xiang Fei-38/+42
2024-11-28Update more 2024 tests to remove -Zunstable-optionsEric Huss-7/+4
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-8/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-22Stabilize the 2024 editionEric Huss-5/+3
2024-11-20reduce false positives of tail-expr-drop-order from consumed valuesDing Xiang Fei-36/+513
take 2 open up coroutines tweak the wordings the lint works up until 2021 We were missing one case, for ADTs, which was causing `Result` to yield incorrect results. only include field spans with significant types deduplicate and eliminate field spans switch to emit spans to impl Drops Co-authored-by: Niko Matsakis <nikomat@amazon.com> collect drops instead of taking liveness diff apply some suggestions and add explantory notes small fix on the cache let the query recurse through coroutine new suggestion format with extracted variable name fine-tune the drop span and messages bugfix on runtime borrows tweak message wording filter out ecosystem types earlier apply suggestions clippy check lint level at session level further restrict applicability of the lint translate bid into nop for stable mir detect cycle in type structure
2024-10-29Rollup merge of #131984 - dingxiangfei2009:stabilize-if-let-rescope, ↵Matthias Krüger-26/+23
r=traviscross,lcnr Stabilize if_let_rescope Close #131154 Tracked by #124085
2024-10-24stabilize if_let_rescopeDing Xiang Fei-26/+23
2024-10-24stabilize shorter-tail-lifetimesDing Xiang Fei-19/+22
2024-09-30apply suggestionsDing Xiang Fei-7/+73
2024-09-30preserve brackets around if-lets and skip while-letsDing Xiang Fei-3/+49
2024-09-13Update tests for hidden references to mutable staticObei Sideg-37/+43
2024-09-13simplify the suggestion notesDing Xiang Fei-263/+70
2024-09-11downgrade borrowck suggestion level due to possible span conflictDing Xiang Fei-34/+79
2024-09-11coalesce lint suggestions that can intersectDing Xiang Fei-47/+353
2024-09-11rescope temp lifetime in let-chain into IfElseDing Xiang Fei-0/+532
apply rules by span edition
2024-08-21lint on tail expr drop order change in Edition 2024Ding Xiang Fei-0/+148
2024-07-18Use more accurate span for `addr_of!` suggestionEsteban Küber-2/+2
Use a multipart suggestion instead of a single whole-span replacement: ``` error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static-unsafe-fn.rs:10:18 | LL | let _y = &X; | ^^ shared reference to mutable static | = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | LL | let _y = addr_of!(X); | ~~~~~~~~~ + ```
2024-06-18tail expression behind terminating scopeDing Xiang Fei-0/+158
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-2/+2
And suggest adding the `#[coroutine]` to the closure
2024-04-10Handle more cases of value suggestionsEsteban Küber-2/+2
2024-03-23add test for ICE #106444Matthias Krüger-0/+16
Fixes #106444
2024-03-03Move testsCaio-0/+278
2024-02-25Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkinbors-0/+2
Implement RFC 3373: Avoid non-local definitions in functions This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363).
2024-02-21Convert `bug`s back to `delayed_bug`s.Nicholas Nethercote-0/+15
This commit undoes some of the previous commit's mechanical changes, based on human judgment.
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-9/+9
2024-02-18Improve wording of static_mut_refObei Sideg-7/+7
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-17Allow newly added non_local_definitions lint in testsUrgau-0/+2
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-66/+66
2024-02-13Rollup merge of #120802 - oli-obk:drop_elab_ice, r=compiler-errorsMatthias Krüger-0/+34
Bail out of drop elaboration when encountering error types fixes #120788
2024-02-08Bail out of drop elaboration when encountering error typesOli Scherer-0/+34
2024-02-08Avoid ICE in drop recursion check in case of invalid drop implsOli Scherer-0/+22
2024-02-07Update testsr0cky-1/+13
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-42/+65
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-9/+9
2023-12-21Give temporaries in if let guards correct scopesMatthew Jasper-0/+14
- Make temporaries in if-let guards be the same variable in MIR when the guard is duplicated due to or-patterns. - Change the "destruction scope" for match arms to be the arm scope rather than the arm body scope. - Add tests.
2023-11-24Show number in error message even for one errorNilstrieb-1/+1
Co-authored-by: Adrian <adrian.iosdev@gmail.com>