4
4
//! compiler code, rather than using their own custom pass. Those
5
5
//! lints are all available in `rustc_lint::builtin`.
6
6
7
- use crate :: lint:: { LintPass , LateLintPass , LintArray } ;
7
+ use crate :: lint:: { LintPass , LateLintPass , LintArray , FutureIncompatibleInfo } ;
8
8
use crate :: middle:: stability;
9
9
use crate :: session:: Session ;
10
10
use errors:: { Applicability , DiagnosticBuilder , pluralise} ;
11
11
use syntax:: ast;
12
+ use syntax:: edition:: Edition ;
12
13
use syntax:: source_map:: Span ;
13
14
use syntax:: symbol:: Symbol ;
14
15
@@ -22,7 +23,7 @@ declare_lint! {
22
23
pub CONST_ERR ,
23
24
Deny ,
24
25
"constant evaluation detected erroneous expression" ,
25
- report_in_external_macro: true
26
+ report_in_external_macro
26
27
}
27
28
28
29
declare_lint ! {
@@ -71,7 +72,7 @@ declare_lint! {
71
72
pub UNREACHABLE_CODE ,
72
73
Warn ,
73
74
"detects unreachable code paths" ,
74
- report_in_external_macro: true
75
+ report_in_external_macro
75
76
}
76
77
77
78
declare_lint ! {
@@ -131,7 +132,11 @@ declare_lint! {
131
132
declare_lint ! {
132
133
pub PRIVATE_IN_PUBLIC ,
133
134
Warn ,
134
- "detect private items in public interfaces not caught by the old implementation"
135
+ "detect private items in public interfaces not caught by the old implementation" ,
136
+ @future_incompatible = FutureIncompatibleInfo {
137
+ reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>" ,
138
+ edition: None ,
139
+ } ;
135
140
}
136
141
137
142
declare_lint ! {
@@ -143,13 +148,21 @@ declare_lint! {
143
148
declare_lint ! {
144
149
pub PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
145
150
Deny ,
146
- "detect public re-exports of private extern crates"
151
+ "detect public re-exports of private extern crates" ,
152
+ @future_incompatible = FutureIncompatibleInfo {
153
+ reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>" ,
154
+ edition: None ,
155
+ } ;
147
156
}
148
157
149
158
declare_lint ! {
150
159
pub INVALID_TYPE_PARAM_DEFAULT ,
151
160
Deny ,
152
- "type parameter default erroneously allowed in invalid location"
161
+ "type parameter default erroneously allowed in invalid location" ,
162
+ @future_incompatible = FutureIncompatibleInfo {
163
+ reference: "issue #36887 <https://github.com/rust-lang/rust/issues/36887>" ,
164
+ edition: None ,
165
+ } ;
153
166
}
154
167
155
168
declare_lint ! {
@@ -161,63 +174,99 @@ declare_lint! {
161
174
declare_lint ! {
162
175
pub SAFE_EXTERN_STATICS ,
163
176
Deny ,
164
- "safe access to extern statics was erroneously allowed"
177
+ "safe access to extern statics was erroneously allowed" ,
178
+ @future_incompatible = FutureIncompatibleInfo {
179
+ reference: "issue #36247 <https://github.com/rust-lang/rust/issues/36247>" ,
180
+ edition: None ,
181
+ } ;
165
182
}
166
183
167
184
declare_lint ! {
168
185
pub SAFE_PACKED_BORROWS ,
169
186
Warn ,
170
- "safe borrows of fields of packed structs were was erroneously allowed"
187
+ "safe borrows of fields of packed structs were was erroneously allowed" ,
188
+ @future_incompatible = FutureIncompatibleInfo {
189
+ reference: "issue #46043 <https://github.com/rust-lang/rust/issues/46043>" ,
190
+ edition: None ,
191
+ } ;
171
192
}
172
193
173
194
declare_lint ! {
174
195
pub PATTERNS_IN_FNS_WITHOUT_BODY ,
175
196
Warn ,
176
- "patterns in functions without body were erroneously allowed"
197
+ "patterns in functions without body were erroneously allowed" ,
198
+ @future_incompatible = FutureIncompatibleInfo {
199
+ reference: "issue #35203 <https://github.com/rust-lang/rust/issues/35203>" ,
200
+ edition: None ,
201
+ } ;
177
202
}
178
203
179
204
declare_lint ! {
180
205
pub LEGACY_DIRECTORY_OWNERSHIP ,
181
206
Deny ,
182
207
"non-inline, non-`#[path]` modules (e.g., `mod foo;`) were erroneously allowed in some files \
183
- not named `mod.rs`"
208
+ not named `mod.rs`",
209
+ @future_incompatible = FutureIncompatibleInfo {
210
+ reference: "issue #37872 <https://github.com/rust-lang/rust/issues/37872>" ,
211
+ edition: None ,
212
+ } ;
184
213
}
185
214
186
215
declare_lint ! {
187
216
pub LEGACY_CONSTRUCTOR_VISIBILITY ,
188
217
Deny ,
189
- "detects use of struct constructors that would be invisible with new visibility rules"
218
+ "detects use of struct constructors that would be invisible with new visibility rules" ,
219
+ @future_incompatible = FutureIncompatibleInfo {
220
+ reference: "issue #39207 <https://github.com/rust-lang/rust/issues/39207>" ,
221
+ edition: None ,
222
+ } ;
190
223
}
191
224
192
225
declare_lint ! {
193
226
pub MISSING_FRAGMENT_SPECIFIER ,
194
227
Deny ,
195
- "detects missing fragment specifiers in unused `macro_rules!` patterns"
228
+ "detects missing fragment specifiers in unused `macro_rules!` patterns" ,
229
+ @future_incompatible = FutureIncompatibleInfo {
230
+ reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>" ,
231
+ edition: None ,
232
+ } ;
196
233
}
197
234
198
235
declare_lint ! {
199
236
pub PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES ,
200
237
Deny ,
201
- "detects parenthesized generic parameters in type and module names"
238
+ "detects parenthesized generic parameters in type and module names" ,
239
+ @future_incompatible = FutureIncompatibleInfo {
240
+ reference: "issue #42238 <https://github.com/rust-lang/rust/issues/42238>" ,
241
+ edition: None ,
242
+ } ;
202
243
}
203
244
204
245
declare_lint ! {
205
246
pub LATE_BOUND_LIFETIME_ARGUMENTS ,
206
247
Warn ,
207
- "detects generic lifetime arguments in path segments with late bound lifetime parameters"
248
+ "detects generic lifetime arguments in path segments with late bound lifetime parameters" ,
249
+ @future_incompatible = FutureIncompatibleInfo {
250
+ reference: "issue #42868 <https://github.com/rust-lang/rust/issues/42868>" ,
251
+ edition: None ,
252
+ } ;
208
253
}
209
254
210
255
declare_lint ! {
211
256
pub ORDER_DEPENDENT_TRAIT_OBJECTS ,
212
257
Deny ,
213
- "trait-object types were treated as different depending on marker-trait order"
258
+ "trait-object types were treated as different depending on marker-trait order" ,
259
+ @future_incompatible = FutureIncompatibleInfo {
260
+ reference: "issue #56484 <https://github.com/rust-lang/rust/issues/56484>" ,
261
+ edition: None ,
262
+ } ;
214
263
}
215
264
216
265
declare_lint ! {
217
266
pub DEPRECATED ,
218
267
Warn ,
219
268
"detects use of deprecated items" ,
220
- report_in_external_macro: true
269
+ report_in_external_macro
221
270
}
222
271
223
272
declare_lint ! {
@@ -253,7 +302,11 @@ declare_lint! {
253
302
declare_lint ! {
254
303
pub TYVAR_BEHIND_RAW_POINTER ,
255
304
Warn ,
256
- "raw pointer to an inference variable"
305
+ "raw pointer to an inference variable" ,
306
+ @future_incompatible = FutureIncompatibleInfo {
307
+ reference: "issue #46906 <https://github.com/rust-lang/rust/issues/46906>" ,
308
+ edition: Some ( Edition :: Edition2018 ) ,
309
+ } ;
257
310
}
258
311
259
312
declare_lint ! {
@@ -272,19 +325,33 @@ declare_lint! {
272
325
pub ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE ,
273
326
Allow ,
274
327
"fully qualified paths that start with a module name \
275
- instead of `crate`, `self`, or an extern crate name"
328
+ instead of `crate`, `self`, or an extern crate name",
329
+ @future_incompatible = FutureIncompatibleInfo {
330
+ reference: "issue #53130 <https://github.com/rust-lang/rust/issues/53130>" ,
331
+ edition: Some ( Edition :: Edition2018 ) ,
332
+ } ;
276
333
}
277
334
278
335
declare_lint ! {
279
336
pub ILLEGAL_FLOATING_POINT_LITERAL_PATTERN ,
280
337
Warn ,
281
- "floating-point literals cannot be used in patterns"
338
+ "floating-point literals cannot be used in patterns" ,
339
+ @future_incompatible = FutureIncompatibleInfo {
340
+ reference: "issue #41620 <https://github.com/rust-lang/rust/issues/41620>" ,
341
+ edition: None ,
342
+ } ;
282
343
}
283
344
284
345
declare_lint ! {
285
346
pub UNSTABLE_NAME_COLLISIONS ,
286
347
Warn ,
287
- "detects name collision with an existing but unstable method"
348
+ "detects name collision with an existing but unstable method" ,
349
+ @future_incompatible = FutureIncompatibleInfo {
350
+ reference: "issue #48919 <https://github.com/rust-lang/rust/issues/48919>" ,
351
+ edition: None ,
352
+ // Note: this item represents future incompatibility of all unstable functions in the
353
+ // standard library, and thus should never be removed or changed to an error.
354
+ } ;
288
355
}
289
356
290
357
declare_lint ! {
@@ -302,7 +369,11 @@ declare_lint! {
302
369
declare_lint ! {
303
370
pub DUPLICATE_MACRO_EXPORTS ,
304
371
Deny ,
305
- "detects duplicate macro exports"
372
+ "detects duplicate macro exports" ,
373
+ @future_incompatible = FutureIncompatibleInfo {
374
+ reference: "issue #35896 <https://github.com/rust-lang/rust/issues/35896>" ,
375
+ edition: Some ( Edition :: Edition2018 ) ,
376
+ } ;
306
377
}
307
378
308
379
declare_lint ! {
@@ -326,13 +397,21 @@ declare_lint! {
326
397
declare_lint ! {
327
398
pub WHERE_CLAUSES_OBJECT_SAFETY ,
328
399
Warn ,
329
- "checks the object safety of where clauses"
400
+ "checks the object safety of where clauses" ,
401
+ @future_incompatible = FutureIncompatibleInfo {
402
+ reference: "issue #51443 <https://github.com/rust-lang/rust/issues/51443>" ,
403
+ edition: None ,
404
+ } ;
330
405
}
331
406
332
407
declare_lint ! {
333
408
pub PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
334
409
Warn ,
335
- "detects proc macro derives using inaccessible names from parent modules"
410
+ "detects proc macro derives using inaccessible names from parent modules" ,
411
+ @future_incompatible = FutureIncompatibleInfo {
412
+ reference: "issue #50504 <https://github.com/rust-lang/rust/issues/50504>" ,
413
+ edition: None ,
414
+ } ;
336
415
}
337
416
338
417
declare_lint ! {
@@ -346,7 +425,11 @@ declare_lint! {
346
425
pub MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS ,
347
426
Deny ,
348
427
"macro-expanded `macro_export` macros from the current crate \
349
- cannot be referred to by absolute paths"
428
+ cannot be referred to by absolute paths",
429
+ @future_incompatible = FutureIncompatibleInfo {
430
+ reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>" ,
431
+ edition: None ,
432
+ } ;
350
433
}
351
434
352
435
declare_lint ! {
@@ -359,15 +442,23 @@ declare_lint! {
359
442
pub INDIRECT_STRUCTURAL_MATCH ,
360
443
// defaulting to allow until rust-lang/rust#62614 is fixed.
361
444
Allow ,
362
- "pattern with const indirectly referencing non-`#[structural_match]` type"
445
+ "pattern with const indirectly referencing non-`#[structural_match]` type" ,
446
+ @future_incompatible = FutureIncompatibleInfo {
447
+ reference: "issue #62411 <https://github.com/rust-lang/rust/issues/62411>" ,
448
+ edition: None ,
449
+ } ;
363
450
}
364
451
365
452
/// Some lints that are buffered from `libsyntax`. See `syntax::early_buffered_lints`.
366
453
pub mod parser {
367
454
declare_lint ! {
368
455
pub ILL_FORMED_ATTRIBUTE_INPUT ,
369
456
Warn ,
370
- "ill-formed attribute inputs that were previously accepted and used in practice"
457
+ "ill-formed attribute inputs that were previously accepted and used in practice" ,
458
+ @future_incompatible = super :: FutureIncompatibleInfo {
459
+ reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>" ,
460
+ edition: None ,
461
+ } ;
371
462
}
372
463
373
464
declare_lint ! {
@@ -387,31 +478,47 @@ declare_lint! {
387
478
pub DEPRECATED_IN_FUTURE ,
388
479
Allow ,
389
480
"detects use of items that will be deprecated in a future version" ,
390
- report_in_external_macro: true
481
+ report_in_external_macro
391
482
}
392
483
393
484
declare_lint ! {
394
485
pub AMBIGUOUS_ASSOCIATED_ITEMS ,
395
486
Deny ,
396
- "ambiguous associated items"
487
+ "ambiguous associated items" ,
488
+ @future_incompatible = FutureIncompatibleInfo {
489
+ reference: "issue #57644 <https://github.com/rust-lang/rust/issues/57644>" ,
490
+ edition: None ,
491
+ } ;
397
492
}
398
493
399
494
declare_lint ! {
400
495
pub NESTED_IMPL_TRAIT ,
401
496
Warn ,
402
- "nested occurrence of `impl Trait` type"
497
+ "nested occurrence of `impl Trait` type" ,
498
+ @future_incompatible = FutureIncompatibleInfo {
499
+ reference: "issue #59014 <https://github.com/rust-lang/rust/issues/59014>" ,
500
+ edition: None ,
501
+ } ;
403
502
}
404
503
405
504
declare_lint ! {
406
505
pub MUTABLE_BORROW_RESERVATION_CONFLICT ,
407
506
Warn ,
408
- "reservation of a two-phased borrow conflicts with other shared borrows"
507
+ "reservation of a two-phased borrow conflicts with other shared borrows" ,
508
+ @future_incompatible = FutureIncompatibleInfo {
509
+ reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>" ,
510
+ edition: None ,
511
+ } ;
409
512
}
410
513
411
514
declare_lint ! {
412
515
pub SOFT_UNSTABLE ,
413
516
Deny ,
414
- "a feature gate that doesn't break dependent crates"
517
+ "a feature gate that doesn't break dependent crates" ,
518
+ @future_incompatible = FutureIncompatibleInfo {
519
+ reference: "issue #64266 <https://github.com/rust-lang/rust/issues/64266>" ,
520
+ edition: None ,
521
+ } ;
415
522
}
416
523
417
524
declare_lint_pass ! {
0 commit comments