Commit 7f91697
committed
errors: implement fallback diagnostic translation
This commit updates the signatures of all diagnostic functions to accept
types that can be converted into a `DiagnosticMessage`. This enables
existing diagnostic calls to continue to work as before and Fluent
identifiers to be provided. The `SessionDiagnostic` derive just
generates normal diagnostic calls, so these APIs had to be modified to
accept Fluent identifiers.
In addition, loading of the "fallback" Fluent bundle, which contains the
built-in English messages, has been implemented.
Each diagnostic now has "arguments" which correspond to variables in the
Fluent messages (necessary to render a Fluent message) but no API for
adding arguments has been added yet. Therefore, diagnostics (that do not
require interpolation) can be converted to use Fluent identifiers and
will be output as before.1 parent c45f295 commit 7f91697
File tree
46 files changed
+920
-294
lines changed- compiler
- rustc_borrowck/src/diagnostics
- rustc_codegen_ssa/src/back
- rustc_driver/src
- rustc_error_messages
- locales/en-US
- src
- rustc_errors/src
- json
- rustc_expand/src
- mbe
- rustc_infer/src/infer/error_reporting
- nice_region_error
- rustc_lint/src
- rustc_parse/src/parser
- rustc_query_system/src/query
- rustc_resolve/src
- late
- rustc_serialize/src
- rustc_session/src
- rustc_trait_selection/src/traits
- error_reporting
- src
- librustdoc
- passes
- tools
- clippy
- clippy_lints/src
- loops
- src
- rustfmt/src/parse
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
46 files changed
+920
-294
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1241 | 1285 | | |
1242 | 1286 | | |
1243 | 1287 | | |
| |||
1782 | 1826 | | |
1783 | 1827 | | |
1784 | 1828 | | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1785 | 1849 | | |
1786 | 1850 | | |
1787 | 1851 | | |
| |||
2812 | 2876 | | |
2813 | 2877 | | |
2814 | 2878 | | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
2815 | 2885 | | |
2816 | 2886 | | |
2817 | 2887 | | |
| |||
3649 | 3719 | | |
3650 | 3720 | | |
3651 | 3721 | | |
| 3722 | + | |
| 3723 | + | |
3652 | 3724 | | |
3653 | 3725 | | |
3654 | 3726 | | |
| 3727 | + | |
| 3728 | + | |
3655 | 3729 | | |
3656 | 3730 | | |
3657 | 3731 | | |
| |||
4585 | 4659 | | |
4586 | 4660 | | |
4587 | 4661 | | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
4588 | 4668 | | |
4589 | 4669 | | |
4590 | 4670 | | |
| |||
5116 | 5196 | | |
5117 | 5197 | | |
5118 | 5198 | | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
5119 | 5205 | | |
5120 | 5206 | | |
5121 | 5207 | | |
| |||
5274 | 5360 | | |
5275 | 5361 | | |
5276 | 5362 | | |
| 5363 | + | |
| 5364 | + | |
| 5365 | + | |
| 5366 | + | |
| 5367 | + | |
| 5368 | + | |
| 5369 | + | |
| 5370 | + | |
| 5371 | + | |
5277 | 5372 | | |
5278 | 5373 | | |
5279 | 5374 | | |
| |||
5328 | 5423 | | |
5329 | 5424 | | |
5330 | 5425 | | |
| 5426 | + | |
| 5427 | + | |
| 5428 | + | |
| 5429 | + | |
| 5430 | + | |
| 5431 | + | |
| 5432 | + | |
| 5433 | + | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
| 5438 | + | |
| 5439 | + | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
| 5444 | + | |
| 5445 | + | |
| 5446 | + | |
| 5447 | + | |
| 5448 | + | |
| 5449 | + | |
| 5450 | + | |
| 5451 | + | |
| 5452 | + | |
| 5453 | + | |
| 5454 | + | |
| 5455 | + | |
| 5456 | + | |
| 5457 | + | |
| 5458 | + | |
| 5459 | + | |
| 5460 | + | |
| 5461 | + | |
| 5462 | + | |
| 5463 | + | |
| 5464 | + | |
| 5465 | + | |
| 5466 | + | |
| 5467 | + | |
| 5468 | + | |
5331 | 5469 | | |
5332 | 5470 | | |
5333 | 5471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1707 | 1707 | | |
1708 | 1708 | | |
1709 | 1709 | | |
| 1710 | + | |
1710 | 1711 | | |
1711 | | - | |
| 1712 | + | |
1712 | 1713 | | |
1713 | 1714 | | |
1714 | 1715 | | |
1715 | 1716 | | |
1716 | 1717 | | |
1717 | | - | |
| 1718 | + | |
1718 | 1719 | | |
1719 | 1720 | | |
1720 | 1721 | | |
1721 | 1722 | | |
1722 | 1723 | | |
1723 | 1724 | | |
| 1725 | + | |
1724 | 1726 | | |
1725 | 1727 | | |
1726 | 1728 | | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
1727 | 1737 | | |
1728 | 1738 | | |
1729 | 1739 | | |
| |||
1754 | 1764 | | |
1755 | 1765 | | |
1756 | 1766 | | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
1760 | 1770 | | |
1761 | 1771 | | |
1762 | 1772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| 1175 | + | |
1175 | 1176 | | |
1176 | 1177 | | |
1177 | 1178 | | |
| 1179 | + | |
1178 | 1180 | | |
1179 | 1181 | | |
1180 | 1182 | | |
| |||
1209 | 1211 | | |
1210 | 1212 | | |
1211 | 1213 | | |
1212 | | - | |
| 1214 | + | |
1213 | 1215 | | |
1214 | 1216 | | |
1215 | 1217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
3 | 26 | | |
4 | 27 | | |
5 | 28 | | |
| 29 | + | |
| 30 | + | |
6 | 31 | | |
7 | 32 | | |
8 | 33 | | |
| 34 | + | |
9 | 35 | | |
10 | 36 | | |
11 | | - | |
| 37 | + | |
12 | 38 | | |
13 | 39 | | |
14 | 40 | | |
15 | | - | |
16 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
17 | 48 | | |
18 | | - | |
19 | | - | |
| 49 | + | |
| 50 | + | |
20 | 51 | | |
21 | 52 | | |
22 | 53 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
29 | 73 | | |
30 | 74 | | |
31 | 75 | | |
| |||
72 | 116 | | |
73 | 117 | | |
74 | 118 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 119 | + | |
| 120 | + | |
81 | 121 | | |
82 | 122 | | |
83 | 123 | | |
| |||
0 commit comments