|
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 |
|
@@ -1983,7 +1966,6 @@ declare_lint! { |
1983 | 1966 | /// macros in that external crate to be brought into the prelude of the |
1984 | 1967 | /// crate, making the macros in scope everywhere. As part of the efforts |
1985 | 1968 | /// to simplify handling of dependencies in the [2018 edition], the use of |
1986 | | - /// `extern crate` is being phased out. To bring macros from extern crates |
1987 | 1969 | /// into scope, it is recommended to use a [`use` import]. |
1988 | 1970 | /// |
1989 | 1971 | /// This lint is "allow" by default because this is a stylistic choice |
@@ -2043,7 +2025,6 @@ declare_lint! { |
2043 | 2025 | cannot be referred to by absolute paths", |
2044 | 2026 | @future_incompatible = FutureIncompatibleInfo { |
2045 | 2027 | reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>", |
2046 | | - edition: None, |
2047 | 2028 | }; |
2048 | 2029 | crate_level_only |
2049 | 2030 | } |
@@ -2134,7 +2115,6 @@ declare_lint! { |
2134 | 2115 | "constant used in pattern contains value of non-structural-match type in a field or a variant", |
2135 | 2116 | @future_incompatible = FutureIncompatibleInfo { |
2136 | 2117 | reference: "issue #62411 <https://github.com/rust-lang/rust/issues/62411>", |
2137 | | - edition: None, |
2138 | 2118 | }; |
2139 | 2119 | } |
2140 | 2120 |
|
@@ -2190,7 +2170,6 @@ declare_lint! { |
2190 | 2170 | "pointers are not structural-match", |
2191 | 2171 | @future_incompatible = FutureIncompatibleInfo { |
2192 | 2172 | reference: "issue #62411 <https://github.com/rust-lang/rust/issues/70861>", |
2193 | | - edition: None, |
2194 | 2173 | }; |
2195 | 2174 | } |
2196 | 2175 |
|
@@ -2229,7 +2208,6 @@ declare_lint! { |
2229 | 2208 | expression contains values of non-structural-match types", |
2230 | 2209 | @future_incompatible = FutureIncompatibleInfo { |
2231 | 2210 | reference: "issue #73448 <https://github.com/rust-lang/rust/issues/73448>", |
2232 | | - edition: None, |
2233 | 2211 | }; |
2234 | 2212 | } |
2235 | 2213 |
|
@@ -2287,7 +2265,6 @@ declare_lint! { |
2287 | 2265 | "ambiguous associated items", |
2288 | 2266 | @future_incompatible = FutureIncompatibleInfo { |
2289 | 2267 | reference: "issue #57644 <https://github.com/rust-lang/rust/issues/57644>", |
2290 | | - edition: None, |
2291 | 2268 | }; |
2292 | 2269 | } |
2293 | 2270 |
|
@@ -2318,7 +2295,6 @@ declare_lint! { |
2318 | 2295 | "reservation of a two-phased borrow conflicts with other shared borrows", |
2319 | 2296 | @future_incompatible = FutureIncompatibleInfo { |
2320 | 2297 | reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>", |
2321 | | - edition: None, |
2322 | 2298 | }; |
2323 | 2299 | } |
2324 | 2300 |
|
@@ -2360,7 +2336,6 @@ declare_lint! { |
2360 | 2336 | "a feature gate that doesn't break dependent crates", |
2361 | 2337 | @future_incompatible = FutureIncompatibleInfo { |
2362 | 2338 | reference: "issue #64266 <https://github.com/rust-lang/rust/issues/64266>", |
2363 | | - edition: None, |
2364 | 2339 | }; |
2365 | 2340 | } |
2366 | 2341 |
|
@@ -2589,7 +2564,6 @@ declare_lint! { |
2589 | 2564 | "a C-like enum implementing Drop is cast", |
2590 | 2565 | @future_incompatible = FutureIncompatibleInfo { |
2591 | 2566 | reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>", |
2592 | | - edition: None, |
2593 | 2567 | }; |
2594 | 2568 | } |
2595 | 2569 |
|
@@ -2629,7 +2603,6 @@ declare_lint! { |
2629 | 2603 | "detects a generic constant is used in a type without a emitting a warning", |
2630 | 2604 | @future_incompatible = FutureIncompatibleInfo { |
2631 | 2605 | reference: "issue #76200 <https://github.com/rust-lang/rust/issues/76200>", |
2632 | | - edition: None, |
2633 | 2606 | }; |
2634 | 2607 | } |
2635 | 2608 |
|
@@ -2688,7 +2661,6 @@ declare_lint! { |
2688 | 2661 | "uninhabited static", |
2689 | 2662 | @future_incompatible = FutureIncompatibleInfo { |
2690 | 2663 | reference: "issue #74840 <https://github.com/rust-lang/rust/issues/74840>", |
2691 | | - edition: None, |
2692 | 2664 | }; |
2693 | 2665 | } |
2694 | 2666 |
|
@@ -2758,7 +2730,6 @@ declare_lint! { |
2758 | 2730 | "unsupported naked function definitions", |
2759 | 2731 | @future_incompatible = FutureIncompatibleInfo { |
2760 | 2732 | reference: "issue #32408 <https://github.com/rust-lang/rust/issues/32408>", |
2761 | | - edition: None, |
2762 | 2733 | }; |
2763 | 2734 | } |
2764 | 2735 |
|
@@ -2831,7 +2802,6 @@ declare_lint! { |
2831 | 2802 | "trailing semicolon in macro body used as expression", |
2832 | 2803 | @future_incompatible = FutureIncompatibleInfo { |
2833 | 2804 | reference: "issue #79813 <https://github.com/rust-lang/rust/issues/79813>", |
2834 | | - edition: None, |
2835 | 2805 | }; |
2836 | 2806 | } |
2837 | 2807 |
|
@@ -3154,7 +3124,6 @@ declare_lint! { |
3154 | 3124 | "detects invalid `#[doc(...)]` attributes", |
3155 | 3125 | @future_incompatible = FutureIncompatibleInfo { |
3156 | 3126 | reference: "issue #82730 <https://github.com/rust-lang/rust/issues/82730>", |
3157 | | - edition: None, |
3158 | 3127 | }; |
3159 | 3128 | } |
3160 | 3129 |
|
@@ -3201,7 +3170,6 @@ declare_lint! { |
3201 | 3170 | "detects usage of old versions of certain proc-macro crates", |
3202 | 3171 | @future_incompatible = FutureIncompatibleInfo { |
3203 | 3172 | reference: "issue #83125 <https://github.com/rust-lang/rust/issues/83125>", |
3204 | | - edition: None, |
3205 | 3173 | future_breakage: Some(FutureBreakage { |
3206 | 3174 | date: None |
3207 | 3175 | }) |
|
0 commit comments