Commit Graph

15 Commits

Author SHA1 Message Date
Simon Sapin
ee67e14034 Stabilize the copy_closures and clone_closures features
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-23 11:37:07 +01:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Vadim Petrochenkov
7ba5fd168a Update UI tests 2018-02-26 20:24:42 +03:00
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Guillaume Gomez
5747fd6611 Update ui tests 2018-02-25 12:15:05 +01:00
Esteban Küber
6384568fdb Reword trying to operate in immutable fields
The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".
2017-12-31 15:32:41 -08:00
Vadim Petrochenkov
1f5b201aff Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Ariel Ben-Yehuda
77f4022303 Revert "Change error count messages"
This reverts commit 5558c64f33.
2017-07-02 13:49:30 +03:00
Guillaume Gomez
998b19740c Add new error codes and update tests 2017-05-27 19:58:52 +02:00
Michael Kohl
5558c64f33 Change error count messages
See #33525 for details.
2017-05-24 16:14:38 +07:00
Esteban Küber
1ca1483113 Point at variable moved by closure 2017-04-25 22:03:05 -07:00
Wesley Wiser
94687aaf58 Removes FIXMEs related to #22405 2017-01-31 21:27:13 -05:00
Esteban Küber
e1280d81af Point to immutable arg/fields when trying to use as &mut
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
```
2017-01-26 10:57:23 -08:00
Mikhail Modin
67a24c2e18 add hint to fix error for immutable ref in arg 2016-11-29 00:32:34 +03:00