summary refs log tree commit diff
path: root/src/test/ui/borrowck
AgeCommit message (Collapse)AuthorLines
2021-09-01Stop sorting bodies by span.Camille GILLOT-6/+6
The definition order is already close to the span order, and only differs in corner cases.
2021-08-29rebase: fix test outputEsteban Kuber-7/+10
2021-08-29Provide structured suggestion for removal of `&mut`Esteban Kuber-9/+6
2021-08-29Suggestion for call on immutable binding of mutable typeEsteban Küber-12/+80
When calling a method requiring a mutable self borrow on an inmutable to a mutable borrow of the type, suggest making the binding mutable. Fix #83241.
2021-08-25Fix debugger stepping behavior around `match` expressionsWesley Wiser-26/+24
Previously, we would set up the source lines for `match` expressions so that the code generated to perform the test of the scrutinee was matched to the line of the arm that required the test and then jump from the arm block to the "next" block was matched to all of the lines in the `match` expression. While that makes sense, it has the side effect of causing strange stepping behavior in debuggers. I've changed the source information so that all of the generated tests are sourced to `match {scrutinee}` and the jumps are sourced to the last line of the block they are inside. This resolves the weird stepping behavior in all debuggers and resolves some instances of "ambiguous symbol" errors in WinDbg preventing the user from setting breakpoints at `match` expressions.
2021-08-15Fix ui tests for llvm_asm! deprecationAmanieu d'Antras-7/+8
2021-08-11Modify structured suggestion outputEsteban Küber-22/+22
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-1/+1
2021-07-30Use multispan suggestions more oftenEsteban Küber-2/+2
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-29Auto merge of #86998 - m-ou-se:const-panic-fmt-as-str, r=oli-obkbors-2/+3
Make const panic!("..") work in Rust 2021. During const eval, this replaces calls to core::panicking::panic_fmt and std::panicking::being_panic_fmt with a call to a new const fn: core::panicking::const_panic_fmt. That function uses fmt::Arguments::as_str() to get the str and calls panic_str with that instead. panic!() invocations with formatting arguments are still not accepted, as the creation of such a fmt::Arguments cannot be done in constant functions right now. r? `@RalfJung`
2021-07-28Add new const_format_args!() macro and use it in panics.Mara Bos-2/+12
2021-07-28Update test output for const fmt::Arguments constructor.Mara Bos-11/+2
2021-07-28Rollup merge of #87453 - ibraheemdev:i-68697, r=wesleywiserYuki Okushi-4/+7
Suggest removing unnecessary &mut as help message Closes #68697
2021-07-27Auto merge of #85305 - MarcusDunn:master, r=pnkfelixbors-18/+17
Stabilize bindings_after_at attempting to stabilze bindings_after_at [#65490](https://github.com/rust-lang/rust/issues/65490), im pretty new to the whole thing so any pointers are greatly appreciated.
2021-07-25fix help message for modification to &T created by &{t}ibraheemdev-1/+33
2021-07-25fix test/ui/borrowck/issue-33819ibraheemdev-1/+1
2021-07-25tidyibraheemdev-1/+1
2021-07-25suggest removing unnecessary \&mut as help messageibraheemdev-4/+7
2021-07-21Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.Felix S. Klock II-1/+0
Revert "Add missing brace" This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655. Revert "Simplify base_expr" This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c. Revert "Warn write-only fields" This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.
2021-07-18Auto merge of #85686 - ptrojahn:loop_reinitialize, r=estebankbors-0/+102
Add help on reinitialization between move and access Fixes #83760
2021-07-07Add help on reinitialization between move and accessPaul Trojahn-0/+102
Fixes #83760
2021-07-02Improve error reporting for modifications behind `&` referencesFabian Wolff-13/+30
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+95
2021-06-24compiletest: ignore tests on a per-revision basisSimonas Kazlauskas-2/+2
Otherwise something that ought to seemingly work like `//[x86] needs-llvm-components: x86` or `//[nll_beyond]should-fail` do not get evaluated properly.
2021-06-16Do not emit invalid suggestions on multiple mutable borrow errorsYuki Okushi-0/+32
2021-06-04updated line #'s on ui tests and removed feature flag testmarcusdunn-17/+17
2021-06-04removed more uses of feature gatemarcusdunn-1/+0
2021-05-30Do not suggest ampmut if rhs is already mutableDeadbeef-0/+20
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-5/+5
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-11improve diagnosts for GATsb-naber-5/+5
2021-05-01Closure capture borrow diagnostics for disjoint capturesChris Pardy-31/+31
2021-04-28Auto merge of #83401 - fee1-dead:master, r=davidtwcobors-0/+44
Fix ICE of for-loop mut borrowck where no suggestions are available Fixes #83309.
2021-04-12Compiler error messages: reduce assertiveness of message E0384James Addison-14/+14
This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-55/+47
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-23Fix ICE of for-loop mut borrowck where no suggestions are availableDeadbeef-0/+44
2021-03-19update testsmark-32/+29
2021-03-06Move some tests to more suitable subdirsYuki Okushi-0/+17
2021-02-23Rollup merge of #81629 - 1000teslas:issue-81365-fix, r=Aaron1011Dylan DPC-0/+520
Point out implicit deref coercions in borrow Fixes #81365 `@Aaron1011` I'm not sure why my code shows the note even in an implicit `Deref` call. See the output for `issue-81365-8.rs`.
2021-02-19Add deref definition location1000teslas-0/+40
Update conflict_errors.rs Add deref definition location
2021-02-15Fix test issue referenceEdward Shen-1/+1
2021-02-14Use delay_span_bug for mismatched subst/hir argEdward Shen-0/+68
2021-02-13add testb-naber-0/+30
2021-02-08Add tests1000teslas-1/+139
2021-02-08Point out implicit deref coercions in borrow1000teslas-0/+342
Clean up code
2021-02-02Rollup merge of #81634 - jesusprubio:jesusprubio/add-long-explanation-e0521, ↵Jack Huey-0/+5
r=GuillaumeGomez Add long explanation e0521 Helps with #61137
2021-02-01Update ui testsJesus Rubio-0/+5
2021-01-31Move some tests to more reasonable directoriesCaio-0/+20
2021-01-30Rollup merge of #81473 - sanxiyn:write-only-field, r=oli-obkYuki Okushi-0/+1
Warn write-only fields cc `@Boscop's` example in #49256.
2021-01-28Warn write-only fieldsSeo Sanghyeon-0/+1
2021-01-25Point to span of upvar making closure FnMut1000teslas-1/+3
Add expected error Add comment Tweak comment wording Fix after rebase to updated master Fix after rebase to updated master Distinguish mutation in normal and move closures Tweak error message Fix error message for nested closures Refactor code showing mutated upvar in closure Remove debug assert B