Commit 59c0ff6
Jonathan Turner
Rollup merge of #36171 - jonathandturner:temporary_value, r=nikomatsakis
Update lifetime errors to specifically note temporaries
This PR updates the error message we give in the case of a temporary value not living long enough.
Before:
<img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png">
Now:
<img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png">
Specifically, it makes the following changes:
* Detects if a temporary is being used. If so, it changes the labels to mention that a temporary value specifically is in question
* Simplifies wording of the existing labels to focus on lifetimes rather than values being valid
* Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note.
r? @nikomatsakisFile tree
6 files changed
+44
-29
lines changed- src
- librustc_borrowck/borrowck
- test
- compile-fail
- borrowck
- ui
- lifetimes
- span
6 files changed
+44
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1031 | 1037 | | |
1032 | 1038 | | |
1033 | 1039 | | |
| |||
1038 | 1044 | | |
1039 | 1045 | | |
1040 | 1046 | | |
1041 | | - | |
| 1047 | + | |
1042 | 1048 | | |
1043 | 1049 | | |
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
1047 | | - | |
| 1053 | + | |
1048 | 1054 | | |
1049 | 1055 | | |
1050 | 1056 | | |
| |||
1053 | 1059 | | |
1054 | 1060 | | |
1055 | 1061 | | |
1056 | | - | |
| 1062 | + | |
1057 | 1063 | | |
1058 | 1064 | | |
1059 | 1065 | | |
1060 | 1066 | | |
1061 | 1067 | | |
1062 | 1068 | | |
1063 | | - | |
| 1069 | + | |
| 1070 | + | |
1064 | 1071 | | |
1065 | 1072 | | |
1066 | 1073 | | |
| |||
1072 | 1079 | | |
1073 | 1080 | | |
1074 | 1081 | | |
1075 | | - | |
| 1082 | + | |
1076 | 1083 | | |
1077 | 1084 | | |
1078 | 1085 | | |
| |||
1085 | 1092 | | |
1086 | 1093 | | |
1087 | 1094 | | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
| 1095 | + | |
| 1096 | + | |
1091 | 1097 | | |
1092 | 1098 | | |
1093 | 1099 | | |
| |||
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 13 | | |
18 | | - | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
0 commit comments