Commit 5bb0213
authored
Rollup merge of rust-lang#56439 - JohnGinger:master, r=nikomatsakis
Clearer error message for dead assign
I'm not that this is the right place for this (if it needs an RFC or not).
I had the problem where I misunderstood the compiler lint message rust-lang#56436 and other people seem to have had the same problem https://www.reddit.com/r/rust/comments/8cy9p4/value_assigned_to_is_never_read/.
I think this new wording might be slightly clearer (and help out beginners like me). I'm very new though, so there might be some nuance I'm missing that would make this more confusing or a bad idea for other reasons.
I thought I would create a PR to make it easy to change the code if the consensus was that it would make sense to make a change.
If this is the wrong place for this sort of thing I'll happily delete/move it.File tree
4 files changed
+19
-4
lines changed- src
- librustc/middle
- test/ui
- lint
- liveness
4 files changed
+19
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
1660 | | - | |
1661 | | - | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
1662 | 1664 | | |
1663 | | - | |
1664 | | - | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1665 | 1669 | | |
1666 | 1670 | | |
1667 | 1671 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
0 commit comments