about summary refs log tree commit diff
path: root/src/test/ui/loops
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-556/+0
2022-12-13Clarify what "this" meansOli Scherer-1/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-3/+0
available
2022-09-26fix #102087, Suggest Default::default() when binding isn't initializedyukang-0/+4
2022-07-19Mention first and last macro in backtraceMichael Goulet-1/+1
2022-07-07Tweak wording and spansEsteban Küber-3/+3
2022-07-07On partial uninit error point at where we need initEsteban Küber-3/+6
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-06-02Stop warning against unrelated labels.Camille GILLOT-247/+5
2022-06-02Bless tests.Camille GILLOT-267/+0
2022-06-02Bless tests.Camille GILLOT-5/+14
2022-03-03Tweak move errorEsteban Kuber-4/+5
Point at method definition that causes type to be consumed. Fix #94056.
2021-10-29Fix a format_args span to be expansionCameron Steffen-0/+2
2021-09-15Check for shadowing issues involving block labelsTomasz Miąsko-20/+56
2021-08-11Modify structured suggestion outputEsteban Küber-14/+14
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-04-24One more test case.Tor Hovland-1/+16
2021-04-24More tests.Tor Hovland-7/+51
2021-04-24Added a test.Tor Hovland-0/+19
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-18/+16
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-12Don't show note if `span` is `DUMMY_SP`Henry Boisdequin-0/+33
2021-01-21Do not suggest using a break label when one is already presentEsteban Küber-18/+6
2021-01-21Tweak error for invalid `break expr`Esteban Küber-21/+48
Point at loop head on invalid `break expr`. Suggest removing `expr` or using label if available.
2021-01-21Suggest `'a` when given `a` only when appropriateEsteban Küber-1/+3
When encountering a name `a` that isn't resolved, but a label `'a` is found in the current ribs, only suggest `'a` if this name is the value expression of a `break` statement. Solve FIXME.
2020-12-17Add test case for break expr with misspelled valueDaiki Ihara-2/+28
Update src/test/ui/loops/loop-break-value.rs Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-12-02Tweak diagnostics on shadowing lifetimes/labelsYuki Okushi-29/+29
2020-05-08Skip tests on emscriptenYuki Okushi-0/+1
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+8
2020-04-23Moving more build-pass tests to check-passVal Markovic-4/+4
One or two tests became build-pass without the FIXME because they really needed build-pass (were failing without it). Helps with #62277
2020-04-11rustc: Add a warning count upon completionRoccoDev-1/+9
2019-12-14add `#![feature(never_type)]` to tests as neededNiko Matsakis-3/+3
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-14/+16
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-11-21Reorganize, bless and add tests for const control flowDylan MacKenzie-9/+9
This creates a new test directory, `ui/consts/control-flow` to hold tests related to control flow in a const context. It also blesses all existing tests with the new error messages, and adds new tests for the `const_if_match` feature.
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-46/+16
Specific labels when referring to "expected" and "found" types
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-19/+17
Also remove `never_type` the feature-gate test.
2019-11-18Surround types with backticks in type errorsEsteban Küber-12/+12
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-32/+2
2019-11-18review comments: tweak prefix stringsEsteban Küber-18/+18
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-5/+5
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+9
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-3/+3
2019-08-09Do not suggest using ! with breakEsteban Küber-4/+1
2019-08-09Tweak mismatched types error on break expressionsEsteban Küber-18/+36
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-06Make WhileTrue into an EarlyLintPass lint.Mazdak Farrokhzad-1/+9
2019-07-05Rollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddybMazdak Farrokhzad-0/+8
Break out of the correct number of scopes in loops We were incorrectly breaking out of one too many drop scopes when generating MIR for loops and breakable blocks, resulting in use after free and associated borrow checker warnings. This wasn't noticed because the scope that we're breaking out of twice is only used for temporaries that are created for adjustments applied to the loop. Since loops generally propagate coercions to the `break` expressions, the only case we see this is when the type of the loop is a smart pointer to a trait object. Closes #62312
2019-07-04Break out of the correct number of scopes in loopsMatthew Jasper-0/+8
We were incorrectly breaking out of one too many drop scopes when generating MIR for loops and breakable blocks, resulting in use after free and associated borrow checker warnings. This wasn't noticed because the scope that we're breaking out of twice is only used for temporaries that are created for adjustments applied to the loop. Since loops generally propagate coercions to the `break` expressions, the only case we see this is when the type of the loop is a smart pointer to a trait object.
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-4/+4
2019-05-29Update ui test suite to use dynmemoryruins-4/+4
2019-04-22update tests for migrate mode by defaultMatthew Jasper-11/+2
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2019-03-11Update NLL testsVadim Petrochenkov-1/+1