|
6 | 6 | //! compiler code, rather than using their own custom pass. Those
|
7 | 7 | //! lints are all available in `rustc_lint::builtin`.
|
8 | 8 |
|
9 |
| -use crate::{declare_lint, declare_lint_pass, FutureBreakage}; |
| 9 | +use crate::{declare_lint, declare_lint_pass, FutureBreakage, FutureIncompatibilityReason}; |
10 | 10 | use rustc_span::edition::Edition;
|
11 | 11 |
|
12 | 12 | declare_lint! {
|
@@ -41,7 +41,6 @@ declare_lint! {
|
41 | 41 | "applying forbid to lint-groups",
|
42 | 42 | @future_incompatible = FutureIncompatibleInfo {
|
43 | 43 | reference: "issue #81670 <https://github.com/rust-lang/rust/issues/81670>",
|
44 |
| - edition: None, |
45 | 44 | };
|
46 | 45 | }
|
47 | 46 |
|
@@ -77,7 +76,6 @@ declare_lint! {
|
77 | 76 | "ill-formed attribute inputs that were previously accepted and used in practice",
|
78 | 77 | @future_incompatible = FutureIncompatibleInfo {
|
79 | 78 | reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
|
80 |
| - edition: None, |
81 | 79 | };
|
82 | 80 | crate_level_only
|
83 | 81 | }
|
@@ -114,7 +112,6 @@ declare_lint! {
|
114 | 112 | "conflicts between `#[repr(..)]` hints that were previously accepted and used in practice",
|
115 | 113 | @future_incompatible = FutureIncompatibleInfo {
|
116 | 114 | reference: "issue #68585 <https://github.com/rust-lang/rust/issues/68585>",
|
117 |
| - edition: None, |
118 | 115 | };
|
119 | 116 | }
|
120 | 117 |
|
@@ -293,7 +290,6 @@ declare_lint! {
|
293 | 290 | "constant evaluation encountered erroneous expression",
|
294 | 291 | @future_incompatible = FutureIncompatibleInfo {
|
295 | 292 | reference: "issue #71800 <https://github.com/rust-lang/rust/issues/71800>",
|
296 |
| - edition: None, |
297 | 293 | };
|
298 | 294 | report_in_external_macro
|
299 | 295 | }
|
@@ -900,7 +896,6 @@ declare_lint! {
|
900 | 896 | "detect private items in public interfaces not caught by the old implementation",
|
901 | 897 | @future_incompatible = FutureIncompatibleInfo {
|
902 | 898 | reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>",
|
903 |
| - edition: None, |
904 | 899 | };
|
905 | 900 | }
|
906 | 901 |
|
@@ -980,7 +975,6 @@ declare_lint! {
|
980 | 975 | "detect public re-exports of private extern crates",
|
981 | 976 | @future_incompatible = FutureIncompatibleInfo {
|
982 | 977 | reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>",
|
983 |
| - edition: None, |
984 | 978 | };
|
985 | 979 | }
|
986 | 980 |
|
@@ -1010,7 +1004,6 @@ declare_lint! {
|
1010 | 1004 | "type parameter default erroneously allowed in invalid location",
|
1011 | 1005 | @future_incompatible = FutureIncompatibleInfo {
|
1012 | 1006 | reference: "issue #36887 <https://github.com/rust-lang/rust/issues/36887>",
|
1013 |
| - edition: None, |
1014 | 1007 | };
|
1015 | 1008 | }
|
1016 | 1009 |
|
@@ -1078,7 +1071,6 @@ declare_lint! {
|
1078 | 1071 | "detects unaligned references to fields of packed structs",
|
1079 | 1072 | @future_incompatible = FutureIncompatibleInfo {
|
1080 | 1073 | reference: "issue #82523 <https://github.com/rust-lang/rust/issues/82523>",
|
1081 |
| - edition: None, |
1082 | 1074 | };
|
1083 | 1075 | report_in_external_macro
|
1084 | 1076 | }
|
@@ -1200,7 +1192,6 @@ declare_lint! {
|
1200 | 1192 | "patterns in functions without body were erroneously allowed",
|
1201 | 1193 | @future_incompatible = FutureIncompatibleInfo {
|
1202 | 1194 | reference: "issue #35203 <https://github.com/rust-lang/rust/issues/35203>",
|
1203 |
| - edition: None, |
1204 | 1195 | };
|
1205 | 1196 | }
|
1206 | 1197 |
|
@@ -1244,7 +1235,6 @@ declare_lint! {
|
1244 | 1235 | "detects missing fragment specifiers in unused `macro_rules!` patterns",
|
1245 | 1236 | @future_incompatible = FutureIncompatibleInfo {
|
1246 | 1237 | reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>",
|
1247 |
| - edition: None, |
1248 | 1238 | };
|
1249 | 1239 | }
|
1250 | 1240 |
|
@@ -1286,7 +1276,6 @@ declare_lint! {
|
1286 | 1276 | "detects generic lifetime arguments in path segments with late bound lifetime parameters",
|
1287 | 1277 | @future_incompatible = FutureIncompatibleInfo {
|
1288 | 1278 | reference: "issue #42868 <https://github.com/rust-lang/rust/issues/42868>",
|
1289 |
| - edition: None, |
1290 | 1279 | };
|
1291 | 1280 | }
|
1292 | 1281 |
|
@@ -1322,7 +1311,6 @@ declare_lint! {
|
1322 | 1311 | "trait-object types were treated as different depending on marker-trait order",
|
1323 | 1312 | @future_incompatible = FutureIncompatibleInfo {
|
1324 | 1313 | reference: "issue #56484 <https://github.com/rust-lang/rust/issues/56484>",
|
1325 |
| - edition: None, |
1326 | 1314 | };
|
1327 | 1315 | }
|
1328 | 1316 |
|
@@ -1362,7 +1350,6 @@ declare_lint! {
|
1362 | 1350 | "distinct impls distinguished only by the leak-check code",
|
1363 | 1351 | @future_incompatible = FutureIncompatibleInfo {
|
1364 | 1352 | reference: "issue #56105 <https://github.com/rust-lang/rust/issues/56105>",
|
1365 |
| - edition: None, |
1366 | 1353 | };
|
1367 | 1354 | }
|
1368 | 1355 |
|
@@ -1554,7 +1541,7 @@ declare_lint! {
|
1554 | 1541 | "raw pointer to an inference variable",
|
1555 | 1542 | @future_incompatible = FutureIncompatibleInfo {
|
1556 | 1543 | reference: "issue #46906 <https://github.com/rust-lang/rust/issues/46906>",
|
1557 |
| - edition: Some(Edition::Edition2018), |
| 1544 | + reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018), |
1558 | 1545 | };
|
1559 | 1546 | }
|
1560 | 1547 |
|
@@ -1621,7 +1608,7 @@ declare_lint! {
|
1621 | 1608 | "suggest using `dyn Trait` for trait objects",
|
1622 | 1609 | @future_incompatible = FutureIncompatibleInfo {
|
1623 | 1610 | reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
|
1624 |
| - edition: Some(Edition::Edition2021), |
| 1611 | + reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), |
1625 | 1612 | };
|
1626 | 1613 | }
|
1627 | 1614 |
|
@@ -1676,7 +1663,7 @@ declare_lint! {
|
1676 | 1663 | instead of `crate`, `self`, or an extern crate name",
|
1677 | 1664 | @future_incompatible = FutureIncompatibleInfo {
|
1678 | 1665 | reference: "issue #53130 <https://github.com/rust-lang/rust/issues/53130>",
|
1679 |
| - edition: Some(Edition::Edition2018), |
| 1666 | + reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018), |
1680 | 1667 | };
|
1681 | 1668 | }
|
1682 | 1669 |
|
@@ -1725,7 +1712,6 @@ declare_lint! {
|
1725 | 1712 | "floating-point literals cannot be used in patterns",
|
1726 | 1713 | @future_incompatible = FutureIncompatibleInfo {
|
1727 | 1714 | reference: "issue #41620 <https://github.com/rust-lang/rust/issues/41620>",
|
1728 |
| - edition: None, |
1729 | 1715 | };
|
1730 | 1716 | }
|
1731 | 1717 |
|
@@ -1769,7 +1755,6 @@ declare_lint! {
|
1769 | 1755 | "detects name collision with an existing but unstable method",
|
1770 | 1756 | @future_incompatible = FutureIncompatibleInfo {
|
1771 | 1757 | reference: "issue #48919 <https://github.com/rust-lang/rust/issues/48919>",
|
1772 |
| - edition: None, |
1773 | 1758 | // Note: this item represents future incompatibility of all unstable functions in the
|
1774 | 1759 | // standard library, and thus should never be removed or changed to an error.
|
1775 | 1760 | };
|
@@ -1873,7 +1858,6 @@ declare_lint! {
|
1873 | 1858 | "checks the object safety of where clauses",
|
1874 | 1859 | @future_incompatible = FutureIncompatibleInfo {
|
1875 | 1860 | reference: "issue #51443 <https://github.com/rust-lang/rust/issues/51443>",
|
1876 |
| - edition: None, |
1877 | 1861 | };
|
1878 | 1862 | }
|
1879 | 1863 |
|
@@ -1940,7 +1924,6 @@ declare_lint! {
|
1940 | 1924 | "detects proc macro derives using inaccessible names from parent modules",
|
1941 | 1925 | @future_incompatible = FutureIncompatibleInfo {
|
1942 | 1926 | reference: "issue #83583 <https://github.com/rust-lang/rust/issues/83583>",
|
1943 |
| - edition: None, |
1944 | 1927 | };
|
1945 | 1928 | }
|
1946 | 1929 |
|
@@ -2043,7 +2026,6 @@ declare_lint! {
|
2043 | 2026 | cannot be referred to by absolute paths",
|
2044 | 2027 | @future_incompatible = FutureIncompatibleInfo {
|
2045 | 2028 | reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>",
|
2046 |
| - edition: None, |
2047 | 2029 | };
|
2048 | 2030 | crate_level_only
|
2049 | 2031 | }
|
@@ -2134,7 +2116,6 @@ declare_lint! {
|
2134 | 2116 | "constant used in pattern contains value of non-structural-match type in a field or a variant",
|
2135 | 2117 | @future_incompatible = FutureIncompatibleInfo {
|
2136 | 2118 | reference: "issue #62411 <https://github.com/rust-lang/rust/issues/62411>",
|
2137 |
| - edition: None, |
2138 | 2119 | };
|
2139 | 2120 | }
|
2140 | 2121 |
|
@@ -2190,7 +2171,6 @@ declare_lint! {
|
2190 | 2171 | "pointers are not structural-match",
|
2191 | 2172 | @future_incompatible = FutureIncompatibleInfo {
|
2192 | 2173 | reference: "issue #62411 <https://github.com/rust-lang/rust/issues/70861>",
|
2193 |
| - edition: None, |
2194 | 2174 | };
|
2195 | 2175 | }
|
2196 | 2176 |
|
@@ -2229,7 +2209,6 @@ declare_lint! {
|
2229 | 2209 | expression contains values of non-structural-match types",
|
2230 | 2210 | @future_incompatible = FutureIncompatibleInfo {
|
2231 | 2211 | reference: "issue #73448 <https://github.com/rust-lang/rust/issues/73448>",
|
2232 |
| - edition: None, |
2233 | 2212 | };
|
2234 | 2213 | }
|
2235 | 2214 |
|
@@ -2287,7 +2266,6 @@ declare_lint! {
|
2287 | 2266 | "ambiguous associated items",
|
2288 | 2267 | @future_incompatible = FutureIncompatibleInfo {
|
2289 | 2268 | reference: "issue #57644 <https://github.com/rust-lang/rust/issues/57644>",
|
2290 |
| - edition: None, |
2291 | 2269 | };
|
2292 | 2270 | }
|
2293 | 2271 |
|
@@ -2318,7 +2296,6 @@ declare_lint! {
|
2318 | 2296 | "reservation of a two-phased borrow conflicts with other shared borrows",
|
2319 | 2297 | @future_incompatible = FutureIncompatibleInfo {
|
2320 | 2298 | reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>",
|
2321 |
| - edition: None, |
2322 | 2299 | };
|
2323 | 2300 | }
|
2324 | 2301 |
|
@@ -2360,7 +2337,6 @@ declare_lint! {
|
2360 | 2337 | "a feature gate that doesn't break dependent crates",
|
2361 | 2338 | @future_incompatible = FutureIncompatibleInfo {
|
2362 | 2339 | reference: "issue #64266 <https://github.com/rust-lang/rust/issues/64266>",
|
2363 |
| - edition: None, |
2364 | 2340 | };
|
2365 | 2341 | }
|
2366 | 2342 |
|
@@ -2589,7 +2565,6 @@ declare_lint! {
|
2589 | 2565 | "a C-like enum implementing Drop is cast",
|
2590 | 2566 | @future_incompatible = FutureIncompatibleInfo {
|
2591 | 2567 | reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>",
|
2592 |
| - edition: None, |
2593 | 2568 | };
|
2594 | 2569 | }
|
2595 | 2570 |
|
@@ -2629,7 +2604,6 @@ declare_lint! {
|
2629 | 2604 | "detects a generic constant is used in a type without a emitting a warning",
|
2630 | 2605 | @future_incompatible = FutureIncompatibleInfo {
|
2631 | 2606 | reference: "issue #76200 <https://github.com/rust-lang/rust/issues/76200>",
|
2632 |
| - edition: None, |
2633 | 2607 | };
|
2634 | 2608 | }
|
2635 | 2609 |
|
@@ -2688,7 +2662,6 @@ declare_lint! {
|
2688 | 2662 | "uninhabited static",
|
2689 | 2663 | @future_incompatible = FutureIncompatibleInfo {
|
2690 | 2664 | reference: "issue #74840 <https://github.com/rust-lang/rust/issues/74840>",
|
2691 |
| - edition: None, |
2692 | 2665 | };
|
2693 | 2666 | }
|
2694 | 2667 |
|
@@ -2758,7 +2731,6 @@ declare_lint! {
|
2758 | 2731 | "unsupported naked function definitions",
|
2759 | 2732 | @future_incompatible = FutureIncompatibleInfo {
|
2760 | 2733 | reference: "issue #32408 <https://github.com/rust-lang/rust/issues/32408>",
|
2761 |
| - edition: None, |
2762 | 2734 | };
|
2763 | 2735 | }
|
2764 | 2736 |
|
@@ -2831,7 +2803,6 @@ declare_lint! {
|
2831 | 2803 | "trailing semicolon in macro body used as expression",
|
2832 | 2804 | @future_incompatible = FutureIncompatibleInfo {
|
2833 | 2805 | reference: "issue #79813 <https://github.com/rust-lang/rust/issues/79813>",
|
2834 |
| - edition: None, |
2835 | 2806 | };
|
2836 | 2807 | }
|
2837 | 2808 |
|
@@ -3154,7 +3125,6 @@ declare_lint! {
|
3154 | 3125 | "detects invalid `#[doc(...)]` attributes",
|
3155 | 3126 | @future_incompatible = FutureIncompatibleInfo {
|
3156 | 3127 | reference: "issue #82730 <https://github.com/rust-lang/rust/issues/82730>",
|
3157 |
| - edition: None, |
3158 | 3128 | };
|
3159 | 3129 | }
|
3160 | 3130 |
|
@@ -3201,7 +3171,6 @@ declare_lint! {
|
3201 | 3171 | "detects usage of old versions of certain proc-macro crates",
|
3202 | 3172 | @future_incompatible = FutureIncompatibleInfo {
|
3203 | 3173 | reference: "issue #83125 <https://github.com/rust-lang/rust/issues/83125>",
|
3204 |
| - edition: None, |
3205 | 3174 | future_breakage: Some(FutureBreakage {
|
3206 | 3175 | date: None
|
3207 | 3176 | })
|
@@ -3242,7 +3211,7 @@ declare_lint! {
|
3242 | 3211 | "detects usage of old versions of or-patterns",
|
3243 | 3212 | @future_incompatible = FutureIncompatibleInfo {
|
3244 | 3213 | reference: "issue #84869 <https://github.com/rust-lang/rust/issues/84869>",
|
3245 |
| - edition: Some(Edition::Edition2021), |
| 3214 | + reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), |
3246 | 3215 | };
|
3247 | 3216 | }
|
3248 | 3217 |
|
@@ -3291,6 +3260,6 @@ declare_lint! {
|
3291 | 3260 | prelude in future editions",
|
3292 | 3261 | @future_incompatible = FutureIncompatibleInfo {
|
3293 | 3262 | reference: "issue #85684 <https://github.com/rust-lang/rust/issues/85684>",
|
3294 |
| - edition: Some(Edition::Edition2021), |
| 3263 | + reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), |
3295 | 3264 | };
|
3296 | 3265 | }
|
0 commit comments