about summary refs log tree commit diff
path: root/tests/ui/loops
AgeCommit message (Collapse)AuthorLines
2025-08-27Add test batch 1Oneirical-0/+9
2025-08-10Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxuJacob Pratt-0/+15
Rehome 32 `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-10Rehome tests/ui/issues/ tests [4/?]Oneirical-0/+15
2025-08-04Rehome tests/ui/issues/ tests [3/?]Oneirical-0/+8
2025-06-10Remove check_mod_loops query and run the checks per-body insteadOli Scherer-6/+6
2025-06-04cleaned up some testsKivooeo-0/+75
2025-03-17If a label is placed on the block of a loop instead of the header, suggest ↵Zachary S-0/+230
moving it to the header.
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-20/+30
``` 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-23tests: use `needs-subprocess` instead of `ignore-{wasm32,emscripten,sgx}`许杰友 Jieyou Xu (Joe)-1/+1
2024-12-12Tweak multispan renderingEsteban Küber-8/+4
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-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-1/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-23Update tests for new TRPL chapter orderChris Krycho-1/+1
2024-06-20Fix `...` in multline code-skips in suggestionsEsteban Küber-1/+1
When we have long code skips, we write `...` in the line number gutter. For suggestions, we were "centering" the `...` with the line, but that was consistent with what we do in every other case.
2024-05-22For OutsideLoop we should not suggest add 'block label in if block, or we ↵surechen-0/+121
wiil get another err: block label not supported here. fixes #123261
2024-04-24Fix tests and blessGary Guo-6/+4
2024-04-15Use /* value */ as a placeholderMichael Goulet-10/+10
2024-04-10Handle more cases of "values to suggest" given a typeEsteban Küber-2/+2
Add handling for `String`, `Box`, `Option` and `Result`.
2024-04-10Handle more cases of value suggestionsEsteban Küber-2/+2
2024-04-09Tweak value suggestions in `borrowck` and `hir_analysis`Esteban Küber-34/+55
Unify the output of `suggest_assign_value` and `ty_kind_suggestion`. Ideally we'd make these a single function, but doing so would likely require modify the crate dependency tree.
2024-03-31Move some testsCaio-0/+41
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-4/+0
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-03-03Move testsCaio-0/+32
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-15/+15
2024-02-12Properly handle `async` blocks and `fn`s in `if` exprs without `else`Esteban Küber-3/+15
When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix #115405.
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-2/+26
2023-11-24Show number in error message even for one errorNilstrieb-7/+7
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-04Point to where missing return type should goMichael Goulet-1/+1
2023-09-26Add context to `let: Ty = loop { break };`Esteban Küber-4/+16
We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-25Use verbose suggestion for `break` without valueEsteban Küber-36/+54
2023-09-25Handle all arbitrary `loop` nesting in `break` type errorsEsteban Küber-3/+115
2023-09-25Account for more cases of nested `loop`s for `break` type mismatchesEsteban Küber-7/+52
2023-09-25Handle yet another case of `break` type mismatchEsteban Küber-1/+4
2023-09-25Point at previous breaks that have the expected typeEsteban Küber-1/+10
2023-09-22Point at cause of expectation of `break` value when possibleEsteban Küber-1/+24
Fix #115905.
2023-08-28Move testsCaio-0/+64
2023-05-31Don't suggest break through nested itemsMichael Goulet-0/+110
2023-03-01recover from for-else and while-elsey21-0/+78
2023-02-16Move testsCaio-0/+28
2023-01-30Modify primary span label for E0308Esteban Küber-1/+1
The previous output was unintuitive to users.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+556