Commit b239743
committed
Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes
- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.
```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`
#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0
#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```
Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).
There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.File tree
399 files changed
+1040
-1210
lines changed- src
- etc/test-float-parse
- liballoc
- benches
- collections
- tests
- libcore
- char
- num
- slice
- tests
- libpanic_unwind
- librustc_borrowck
- librustc_codegen_llvm
- librustc_data_structures
- librustc_incremental
- librustc_lint
- librustc_metadata
- librustc_mir
- librustc_target
- librustc_typeck
- librustc
- dep_graph
- ich
- lint
- middle
- ty
- query
- librustdoc
- libstd
- libsyntax
- test
- compile-fail-fulldeps/auxiliary
- compile-fail
- auxiliary
- rfc-2126-extern-absolute-paths
- debuginfo
- run-fail
- run-make-fulldeps
- allow-warnings-cmdline-stability
- link-path-order
- save-analysis-rfc2126
- run-make/wasm-custom-section
- run-pass-fulldeps
- proc-macro
- run-pass-valgrind
- run-pass
- allocator
- auxiliary
- auxiliary
- borrowck
- panic-runtime
- rfc-2126-extern-absolute-paths
- rustdoc
- auxiliary
- ui
- auxiliary
- feature-gate
- tools
- compiletest/src
- tidy/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
399 files changed
+1040
-1210
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2370 | 2370 | | |
2371 | 2371 | | |
2372 | 2372 | | |
2373 | | - | |
| 2373 | + | |
2374 | 2374 | | |
2375 | 2375 | | |
2376 | 2376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
79 | 78 | | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | | - | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
121 | | - | |
122 | | - | |
123 | 118 | | |
124 | 119 | | |
125 | 120 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 121 | | |
130 | 122 | | |
131 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | | - | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1050 | 1050 | | |
1051 | 1051 | | |
1052 | 1052 | | |
1053 | | - | |
1054 | | - | |
1055 | 1053 | | |
1056 | 1054 | | |
1057 | 1055 | | |
| |||
1084 | 1082 | | |
1085 | 1083 | | |
1086 | 1084 | | |
1087 | | - | |
1088 | | - | |
1089 | 1085 | | |
1090 | 1086 | | |
1091 | 1087 | | |
| |||
1118 | 1114 | | |
1119 | 1115 | | |
1120 | 1116 | | |
1121 | | - | |
1122 | | - | |
1123 | 1117 | | |
1124 | 1118 | | |
1125 | 1119 | | |
| |||
1155 | 1149 | | |
1156 | 1150 | | |
1157 | 1151 | | |
1158 | | - | |
1159 | | - | |
1160 | 1152 | | |
1161 | 1153 | | |
1162 | 1154 | | |
| |||
1189 | 1181 | | |
1190 | 1182 | | |
1191 | 1183 | | |
1192 | | - | |
1193 | | - | |
1194 | 1184 | | |
1195 | 1185 | | |
1196 | 1186 | | |
| |||
1226 | 1216 | | |
1227 | 1217 | | |
1228 | 1218 | | |
1229 | | - | |
1230 | | - | |
1231 | 1219 | | |
1232 | 1220 | | |
1233 | 1221 | | |
| |||
1264 | 1252 | | |
1265 | 1253 | | |
1266 | 1254 | | |
1267 | | - | |
1268 | | - | |
1269 | 1255 | | |
1270 | 1256 | | |
1271 | 1257 | | |
| |||
1298 | 1284 | | |
1299 | 1285 | | |
1300 | 1286 | | |
1301 | | - | |
1302 | | - | |
1303 | 1287 | | |
1304 | 1288 | | |
1305 | 1289 | | |
| |||
1349 | 1333 | | |
1350 | 1334 | | |
1351 | 1335 | | |
1352 | | - | |
1353 | | - | |
1354 | 1336 | | |
1355 | 1337 | | |
1356 | 1338 | | |
| |||
1385 | 1367 | | |
1386 | 1368 | | |
1387 | 1369 | | |
1388 | | - | |
1389 | | - | |
1390 | 1370 | | |
1391 | 1371 | | |
1392 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | | - | |
107 | 104 | | |
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
113 | 110 | | |
114 | | - | |
115 | 111 | | |
116 | 112 | | |
117 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3761 | 3761 | | |
3762 | 3762 | | |
3763 | 3763 | | |
3764 | | - | |
3765 | | - | |
3766 | 3764 | | |
3767 | 3765 | | |
3768 | 3766 | | |
| |||
3799 | 3797 | | |
3800 | 3798 | | |
3801 | 3799 | | |
3802 | | - | |
3803 | | - | |
3804 | 3800 | | |
3805 | 3801 | | |
3806 | 3802 | | |
| |||
3837 | 3833 | | |
3838 | 3834 | | |
3839 | 3835 | | |
3840 | | - | |
3841 | | - | |
3842 | 3836 | | |
3843 | 3837 | | |
3844 | 3838 | | |
| |||
3878 | 3872 | | |
3879 | 3873 | | |
3880 | 3874 | | |
3881 | | - | |
3882 | | - | |
3883 | 3875 | | |
3884 | 3876 | | |
3885 | 3877 | | |
| |||
3916 | 3908 | | |
3917 | 3909 | | |
3918 | 3910 | | |
3919 | | - | |
3920 | | - | |
3921 | 3911 | | |
3922 | 3912 | | |
3923 | 3913 | | |
| |||
3957 | 3947 | | |
3958 | 3948 | | |
3959 | 3949 | | |
3960 | | - | |
3961 | | - | |
3962 | 3950 | | |
3963 | 3951 | | |
3964 | 3952 | | |
| |||
3999 | 3987 | | |
4000 | 3988 | | |
4001 | 3989 | | |
4002 | | - | |
4003 | | - | |
4004 | 3990 | | |
4005 | 3991 | | |
4006 | 3992 | | |
| |||
4037 | 4023 | | |
4038 | 4024 | | |
4039 | 4025 | | |
4040 | | - | |
4041 | | - | |
4042 | 4026 | | |
4043 | 4027 | | |
4044 | 4028 | | |
| |||
4092 | 4076 | | |
4093 | 4077 | | |
4094 | 4078 | | |
4095 | | - | |
4096 | | - | |
4097 | 4079 | | |
4098 | 4080 | | |
4099 | 4081 | | |
| |||
4132 | 4114 | | |
4133 | 4115 | | |
4134 | 4116 | | |
4135 | | - | |
4136 | | - | |
4137 | 4117 | | |
4138 | 4118 | | |
4139 | 4119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2007 | 2007 | | |
2008 | 2008 | | |
2009 | 2009 | | |
2010 | | - | |
| 2010 | + | |
2011 | 2011 | | |
2012 | 2012 | | |
2013 | 2013 | | |
| |||
2056 | 2056 | | |
2057 | 2057 | | |
2058 | 2058 | | |
2059 | | - | |
| 2059 | + | |
2060 | 2060 | | |
2061 | 2061 | | |
2062 | 2062 | | |
| |||
2117 | 2117 | | |
2118 | 2118 | | |
2119 | 2119 | | |
2120 | | - | |
| 2120 | + | |
2121 | 2121 | | |
2122 | 2122 | | |
2123 | 2123 | | |
| |||
2152 | 2152 | | |
2153 | 2153 | | |
2154 | 2154 | | |
2155 | | - | |
| 2155 | + | |
2156 | 2156 | | |
2157 | 2157 | | |
2158 | 2158 | | |
| |||
2187 | 2187 | | |
2188 | 2188 | | |
2189 | 2189 | | |
2190 | | - | |
| 2190 | + | |
2191 | 2191 | | |
2192 | 2192 | | |
2193 | 2193 | | |
| |||
0 commit comments