| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2023-01-11 | Move /src/test to /tests | Albert Larsan | -25/+0 | |
| 2023-01-01 | Verbose suggestions | Esteban Küber | -3/+5 | |
| 2022-12-28 | Use verbose suggestions for mutability errors | Esteban Küber | -3/+5 | |
| 2021-09-25 | Use larger span for adjustments on method calls | Aaron Hill | -2/+2 | |
| Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely. | ||||
| 2019-05-29 | Update ui test suite to use dyn | memoryruins | -3/+3 | |
| 2019-04-22 | update tests for migrate mode by default | Matthew Jasper | -5/+5 | |
| 2019-03-11 | Update tests | Vadim Petrochenkov | -2/+2 | |
| 2018-12-25 | Remove licenses | Mark Rousskov | -2/+2 | |
| 2018-09-12 | use structured suggestion for "missing mut" label | Andy Russell | -1/+1 | |
| Fixes #54133. | ||||
| 2018-03-14 | update tests | Guillaume Gomez | -1/+1 | |
| 2018-02-26 | Update UI tests | Vadim Petrochenkov | -2/+2 | |
| 2018-02-26 | Update UI tests | Vadim Petrochenkov | -4/+4 | |
| 2018-02-25 | Update ui tests | Guillaume Gomez | -0/+1 | |
| 2017-07-02 | Revert "Change error count messages" | Ariel Ben-Yehuda | -1/+1 | |
| This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e. | ||||
| 2017-05-27 | Add new error codes and update tests | Guillaume Gomez | -2/+2 | |
| 2017-05-24 | Change error count messages | Michael Kohl | -1/+1 | |
| See #33525 for details. | ||||
| 2017-03-27 | borrowck: consolidate `mut` suggestions | Ariel Ben-Yehuda | -0/+3 | |
| This converts all of borrowck's `mut` suggestions to a new `mc::ImmutabilityBlame` API instead of the current mix of various hacks. Fixes #35937. Fixes #40823. | ||||
| 2017-01-26 | Point to immutable arg/fields when trying to use as &mut | Esteban Küber | -2/+2 | |
| Point to immutable borrow arguments and fields when trying to use them as mutable borrows. Add label to primary span on "cannot borrow as mutable" errors. Present the following output when trying to access an immutable borrow's field as mutable: ``` error[E0389]: cannot borrow data mutably in a `&` reference --> $DIR/issue-38147-1.rs:27:9 | 26 | fn f(&self) { | ----- use `&mut self` here to make mutable 27 | f.s.push('x'); | ^^^ assignment into an immutable reference ``` And the following when trying to access an immutable struct field as mutable: ``` error: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-3.rs:17:9 | 12 | s: &'a String | ------------- use `&'a mut String` here to make mutable ...| 16 | fn f(&self) { | ----- use `&mut self` here to make mutable 17 | self.s.push('x'); | ^^^^^^ cannot borrow as mutable ``` | ||||
| 2016-11-29 | add hint to fix error for immutable ref in arg | Mikhail Modin | -0/+17 | |
