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
@@ -125,7 +126,11 @@ declare_lint! {
125
126
declare_lint ! {
126
127
pub PRIVATE_IN_PUBLIC ,
127
128
Warn ,
128
- "detect private items in public interfaces not caught by the old implementation"
129
+ "detect private items in public interfaces not caught by the old implementation" ,
130
+ @future_incompatible = FutureIncompatibleInfo {
131
+ reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>" ,
132
+ edition: None ,
133
+ } ;
129
134
}
130
135
131
136
declare_lint ! {
@@ -137,13 +142,21 @@ declare_lint! {
137
142
declare_lint ! {
138
143
pub PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
139
144
Deny ,
140
- "detect public re-exports of private extern crates"
145
+ "detect public re-exports of private extern crates" ,
146
+ @future_incompatible = FutureIncompatibleInfo {
147
+ reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>" ,
148
+ edition: None ,
149
+ } ;
141
150
}
142
151
143
152
declare_lint ! {
144
153
pub INVALID_TYPE_PARAM_DEFAULT ,
145
154
Deny ,
146
- "type parameter default erroneously allowed in invalid location"
155
+ "type parameter default erroneously allowed in invalid location" ,
156
+ @future_incompatible = FutureIncompatibleInfo {
157
+ reference: "issue #36887 <https://github.com/rust-lang/rust/issues/36887>" ,
158
+ edition: None ,
159
+ } ;
147
160
}
148
161
149
162
declare_lint ! {
@@ -155,56 +168,92 @@ declare_lint! {
155
168
declare_lint ! {
156
169
pub SAFE_EXTERN_STATICS ,
157
170
Deny ,
158
- "safe access to extern statics was erroneously allowed"
171
+ "safe access to extern statics was erroneously allowed" ,
172
+ @future_incompatible = FutureIncompatibleInfo {
173
+ reference: "issue #36247 <https://github.com/rust-lang/rust/issues/36247>" ,
174
+ edition: None ,
175
+ } ;
159
176
}
160
177
161
178
declare_lint ! {
162
179
pub SAFE_PACKED_BORROWS ,
163
180
Warn ,
164
- "safe borrows of fields of packed structs were was erroneously allowed"
181
+ "safe borrows of fields of packed structs were was erroneously allowed" ,
182
+ @future_incompatible = FutureIncompatibleInfo {
183
+ reference: "issue #46043 <https://github.com/rust-lang/rust/issues/46043>" ,
184
+ edition: None ,
185
+ } ;
165
186
}
166
187
167
188
declare_lint ! {
168
189
pub PATTERNS_IN_FNS_WITHOUT_BODY ,
169
190
Warn ,
170
- "patterns in functions without body were erroneously allowed"
191
+ "patterns in functions without body were erroneously allowed" ,
192
+ @future_incompatible = FutureIncompatibleInfo {
193
+ reference: "issue #35203 <https://github.com/rust-lang/rust/issues/35203>" ,
194
+ edition: None ,
195
+ } ;
171
196
}
172
197
173
198
declare_lint ! {
174
199
pub LEGACY_DIRECTORY_OWNERSHIP ,
175
200
Deny ,
176
201
"non-inline, non-`#[path]` modules (e.g., `mod foo;`) were erroneously allowed in some files \
177
- not named `mod.rs`"
202
+ not named `mod.rs`",
203
+ @future_incompatible = FutureIncompatibleInfo {
204
+ reference: "issue #37872 <https://github.com/rust-lang/rust/issues/37872>" ,
205
+ edition: None ,
206
+ } ;
178
207
}
179
208
180
209
declare_lint ! {
181
210
pub LEGACY_CONSTRUCTOR_VISIBILITY ,
182
211
Deny ,
183
- "detects use of struct constructors that would be invisible with new visibility rules"
212
+ "detects use of struct constructors that would be invisible with new visibility rules" ,
213
+ @future_incompatible = FutureIncompatibleInfo {
214
+ reference: "issue #39207 <https://github.com/rust-lang/rust/issues/39207>" ,
215
+ edition: None ,
216
+ } ;
184
217
}
185
218
186
219
declare_lint ! {
187
220
pub MISSING_FRAGMENT_SPECIFIER ,
188
221
Deny ,
189
- "detects missing fragment specifiers in unused `macro_rules!` patterns"
222
+ "detects missing fragment specifiers in unused `macro_rules!` patterns" ,
223
+ @future_incompatible = FutureIncompatibleInfo {
224
+ reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>" ,
225
+ edition: None ,
226
+ } ;
190
227
}
191
228
192
229
declare_lint ! {
193
230
pub PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES ,
194
231
Deny ,
195
- "detects parenthesized generic parameters in type and module names"
232
+ "detects parenthesized generic parameters in type and module names" ,
233
+ @future_incompatible = FutureIncompatibleInfo {
234
+ reference: "issue #42238 <https://github.com/rust-lang/rust/issues/42238>" ,
235
+ edition: None ,
236
+ } ;
196
237
}
197
238
198
239
declare_lint ! {
199
240
pub LATE_BOUND_LIFETIME_ARGUMENTS ,
200
241
Warn ,
201
- "detects generic lifetime arguments in path segments with late bound lifetime parameters"
242
+ "detects generic lifetime arguments in path segments with late bound lifetime parameters" ,
243
+ @future_incompatible = FutureIncompatibleInfo {
244
+ reference: "issue #42868 <https://github.com/rust-lang/rust/issues/42868>" ,
245
+ edition: None ,
246
+ } ;
202
247
}
203
248
204
249
declare_lint ! {
205
250
pub ORDER_DEPENDENT_TRAIT_OBJECTS ,
206
251
Deny ,
207
- "trait-object types were treated as different depending on marker-trait order"
252
+ "trait-object types were treated as different depending on marker-trait order" ,
253
+ @future_incompatible = FutureIncompatibleInfo {
254
+ reference: "issue #56484 <https://github.com/rust-lang/rust/issues/56484>" ,
255
+ edition: None ,
256
+ } ;
208
257
}
209
258
210
259
declare_lint ! {
@@ -247,7 +296,11 @@ declare_lint! {
247
296
declare_lint ! {
248
297
pub TYVAR_BEHIND_RAW_POINTER ,
249
298
Warn ,
250
- "raw pointer to an inference variable"
299
+ "raw pointer to an inference variable" ,
300
+ @future_incompatible = FutureIncompatibleInfo {
301
+ reference: "issue #46906 <https://github.com/rust-lang/rust/issues/46906>" ,
302
+ edition: Some ( Edition :: Edition2018 ) ,
303
+ } ;
251
304
}
252
305
253
306
declare_lint ! {
@@ -266,19 +319,33 @@ declare_lint! {
266
319
pub ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE ,
267
320
Allow ,
268
321
"fully qualified paths that start with a module name \
269
- instead of `crate`, `self`, or an extern crate name"
322
+ instead of `crate`, `self`, or an extern crate name",
323
+ @future_incompatible = FutureIncompatibleInfo {
324
+ reference: "issue #53130 <https://github.com/rust-lang/rust/issues/53130>" ,
325
+ edition: Some ( Edition :: Edition2018 ) ,
326
+ } ;
270
327
}
271
328
272
329
declare_lint ! {
273
330
pub ILLEGAL_FLOATING_POINT_LITERAL_PATTERN ,
274
331
Warn ,
275
- "floating-point literals cannot be used in patterns"
332
+ "floating-point literals cannot be used in patterns" ,
333
+ @future_incompatible = FutureIncompatibleInfo {
334
+ reference: "issue #41620 <https://github.com/rust-lang/rust/issues/41620>" ,
335
+ edition: None ,
336
+ } ;
276
337
}
277
338
278
339
declare_lint ! {
279
340
pub UNSTABLE_NAME_COLLISIONS ,
280
341
Warn ,
281
- "detects name collision with an existing but unstable method"
342
+ "detects name collision with an existing but unstable method" ,
343
+ @future_incompatible = FutureIncompatibleInfo {
344
+ reference: "issue #48919 <https://github.com/rust-lang/rust/issues/48919>" ,
345
+ edition: None ,
346
+ // Note: this item represents future incompatibility of all unstable functions in the
347
+ // standard library, and thus should never be removed or changed to an error.
348
+ } ;
282
349
}
283
350
284
351
declare_lint ! {
@@ -296,7 +363,11 @@ declare_lint! {
296
363
declare_lint ! {
297
364
pub DUPLICATE_MACRO_EXPORTS ,
298
365
Deny ,
299
- "detects duplicate macro exports"
366
+ "detects duplicate macro exports" ,
367
+ @future_incompatible = FutureIncompatibleInfo {
368
+ reference: "issue #35896 <https://github.com/rust-lang/rust/issues/35896>" ,
369
+ edition: Some ( Edition :: Edition2018 ) ,
370
+ } ;
300
371
}
301
372
302
373
declare_lint ! {
@@ -320,13 +391,21 @@ declare_lint! {
320
391
declare_lint ! {
321
392
pub WHERE_CLAUSES_OBJECT_SAFETY ,
322
393
Warn ,
323
- "checks the object safety of where clauses"
394
+ "checks the object safety of where clauses" ,
395
+ @future_incompatible = FutureIncompatibleInfo {
396
+ reference: "issue #51443 <https://github.com/rust-lang/rust/issues/51443>" ,
397
+ edition: None ,
398
+ } ;
324
399
}
325
400
326
401
declare_lint ! {
327
402
pub PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
328
403
Warn ,
329
- "detects proc macro derives using inaccessible names from parent modules"
404
+ "detects proc macro derives using inaccessible names from parent modules" ,
405
+ @future_incompatible = FutureIncompatibleInfo {
406
+ reference: "issue #50504 <https://github.com/rust-lang/rust/issues/50504>" ,
407
+ edition: None ,
408
+ } ;
330
409
}
331
410
332
411
declare_lint ! {
@@ -340,7 +419,11 @@ declare_lint! {
340
419
pub MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS ,
341
420
Deny ,
342
421
"macro-expanded `macro_export` macros from the current crate \
343
- cannot be referred to by absolute paths"
422
+ cannot be referred to by absolute paths",
423
+ @future_incompatible = FutureIncompatibleInfo {
424
+ reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>" ,
425
+ edition: None ,
426
+ } ;
344
427
}
345
428
346
429
declare_lint ! {
@@ -353,15 +436,23 @@ declare_lint! {
353
436
pub INDIRECT_STRUCTURAL_MATCH ,
354
437
// defaulting to allow until rust-lang/rust#62614 is fixed.
355
438
Allow ,
356
- "pattern with const indirectly referencing non-`#[structural_match]` type"
439
+ "pattern with const indirectly referencing non-`#[structural_match]` type" ,
440
+ @future_incompatible = FutureIncompatibleInfo {
441
+ reference: "issue #62411 <https://github.com/rust-lang/rust/issues/62411>" ,
442
+ edition: None ,
443
+ } ;
357
444
}
358
445
359
446
/// Some lints that are buffered from `libsyntax`. See `syntax::early_buffered_lints`.
360
447
pub mod parser {
361
448
declare_lint ! {
362
449
pub ILL_FORMED_ATTRIBUTE_INPUT ,
363
450
Warn ,
364
- "ill-formed attribute inputs that were previously accepted and used in practice"
451
+ "ill-formed attribute inputs that were previously accepted and used in practice" ,
452
+ @future_incompatible = super :: FutureIncompatibleInfo {
453
+ reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>" ,
454
+ edition: None ,
455
+ } ;
365
456
}
366
457
367
458
declare_lint ! {
@@ -387,25 +478,41 @@ declare_lint! {
387
478
declare_lint ! {
388
479
pub AMBIGUOUS_ASSOCIATED_ITEMS ,
389
480
Deny ,
390
- "ambiguous associated items"
481
+ "ambiguous associated items" ,
482
+ @future_incompatible = FutureIncompatibleInfo {
483
+ reference: "issue #57644 <https://github.com/rust-lang/rust/issues/57644>" ,
484
+ edition: None ,
485
+ } ;
391
486
}
392
487
393
488
declare_lint ! {
394
489
pub NESTED_IMPL_TRAIT ,
395
490
Warn ,
396
- "nested occurrence of `impl Trait` type"
491
+ "nested occurrence of `impl Trait` type" ,
492
+ @future_incompatible = FutureIncompatibleInfo {
493
+ reference: "issue #59014 <https://github.com/rust-lang/rust/issues/59014>" ,
494
+ edition: None ,
495
+ } ;
397
496
}
398
497
399
498
declare_lint ! {
400
499
pub MUTABLE_BORROW_RESERVATION_CONFLICT ,
401
500
Warn ,
402
- "reservation of a two-phased borrow conflicts with other shared borrows"
501
+ "reservation of a two-phased borrow conflicts with other shared borrows" ,
502
+ @future_incompatible = FutureIncompatibleInfo {
503
+ reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>" ,
504
+ edition: None ,
505
+ } ;
403
506
}
404
507
405
508
declare_lint ! {
406
509
pub SOFT_UNSTABLE ,
407
510
Deny ,
408
- "a feature gate that doesn't break dependent crates"
511
+ "a feature gate that doesn't break dependent crates" ,
512
+ @future_incompatible = FutureIncompatibleInfo {
513
+ reference: "issue #64266 <https://github.com/rust-lang/rust/issues/64266>" ,
514
+ edition: None ,
515
+ } ;
409
516
}
410
517
411
518
declare_lint_pass ! {
0 commit comments