@@ -41,7 +41,6 @@ use rustc::lint::builtin::{
41
41
PRIVATE_DOC_TESTS ,
42
42
parser:: ILL_FORMED_ATTRIBUTE_INPUT ,
43
43
} ;
44
- use rustc:: session;
45
44
use rustc:: hir;
46
45
use rustc:: hir:: def_id:: DefId ;
47
46
use rustc:: ty:: query:: Providers ;
@@ -51,7 +50,6 @@ use syntax::ast;
51
50
use syntax:: edition:: Edition ;
52
51
use syntax_pos:: Span ;
53
52
54
- use session:: Session ;
55
53
use lint:: LintId ;
56
54
use lint:: FutureIncompatibleInfo ;
57
55
@@ -198,16 +196,16 @@ late_lint_mod_passes!(declare_combined_late_pass, [BuiltinCombinedModuleLateLint
198
196
/// Tell the `LintStore` about all the built-in lints (the ones
199
197
/// defined in this crate and the ones defined in
200
198
/// `rustc::lint::builtin`).
201
- pub fn register_builtins ( store : & mut lint:: LintStore , sess : Option < & Session > ) {
199
+ pub fn register_builtins ( store : & mut lint:: LintStore , no_interleave_lints : bool ) {
202
200
macro_rules! add_lint_group {
203
- ( $sess : ident , $ name: expr, $( $lint: ident) ,* ) => (
204
- store. register_group( $sess , false , $name, None , vec![ $( LintId :: of( $lint) ) ,* ] ) ;
201
+ ( $name: expr, $( $lint: ident) ,* ) => (
202
+ store. register_group( false , $name, None , vec![ $( LintId :: of( $lint) ) ,* ] ) ;
205
203
)
206
204
}
207
205
208
206
macro_rules! register_pass {
209
207
( $method: ident, $constructor: expr, [ $( $args: expr) ,* ] ) => (
210
- store. $method( sess , false , false , $( $args, ) * box $constructor) ;
208
+ store. $method( false , false , $( $args, ) * box $constructor) ;
211
209
)
212
210
}
213
211
@@ -219,35 +217,32 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
219
217
)
220
218
}
221
219
222
- if sess . map ( |sess| sess . opts . debugging_opts . no_interleave_lints ) . unwrap_or ( false ) {
220
+ if no_interleave_lints {
223
221
pre_expansion_lint_passes ! ( register_passes, [ register_pre_expansion_pass, [ ] ] ) ;
224
222
early_lint_passes ! ( register_passes, [ register_early_pass, [ ] ] ) ;
225
223
late_lint_passes ! ( register_passes, [ register_late_pass, [ false ] ] ) ;
226
224
late_lint_mod_passes ! ( register_passes, [ register_late_pass, [ true ] ] ) ;
227
225
} else {
228
226
store. register_pre_expansion_pass (
229
- sess,
230
227
false ,
231
228
true ,
232
229
box BuiltinCombinedPreExpansionLintPass :: new ( )
233
230
) ;
234
- store. register_early_pass ( sess , false , true , box BuiltinCombinedEarlyLintPass :: new ( ) ) ;
231
+ store. register_early_pass ( false , true , box BuiltinCombinedEarlyLintPass :: new ( ) ) ;
235
232
store. register_late_pass (
236
- sess , false , true , true , box BuiltinCombinedModuleLateLintPass :: new ( )
233
+ false , true , true , box BuiltinCombinedModuleLateLintPass :: new ( )
237
234
) ;
238
235
store. register_late_pass (
239
- sess , false , true , false , box BuiltinCombinedLateLintPass :: new ( )
236
+ false , true , false , box BuiltinCombinedLateLintPass :: new ( )
240
237
) ;
241
238
}
242
239
243
- add_lint_group ! ( sess,
244
- "nonstandard_style" ,
240
+ add_lint_group ! ( "nonstandard_style" ,
245
241
NON_CAMEL_CASE_TYPES ,
246
242
NON_SNAKE_CASE ,
247
243
NON_UPPER_CASE_GLOBALS ) ;
248
244
249
- add_lint_group ! ( sess,
250
- "unused" ,
245
+ add_lint_group ! ( "unused" ,
251
246
UNUSED_IMPORTS ,
252
247
UNUSED_VARIABLES ,
253
248
UNUSED_ASSIGNMENTS ,
@@ -267,8 +262,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
267
262
UNUSED_LABELS ,
268
263
UNUSED_PARENS ) ;
269
264
270
- add_lint_group ! ( sess,
271
- "rust_2018_idioms" ,
265
+ add_lint_group ! ( "rust_2018_idioms" ,
272
266
BARE_TRAIT_OBJECTS ,
273
267
UNUSED_EXTERN_CRATES ,
274
268
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS ,
@@ -284,8 +278,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
284
278
// MACRO_USE_EXTERN_CRATE,
285
279
) ;
286
280
287
- add_lint_group ! ( sess,
288
- "rustdoc" ,
281
+ add_lint_group ! ( "rustdoc" ,
289
282
INTRA_DOC_LINK_RESOLUTION_FAILURE ,
290
283
MISSING_DOC_CODE_EXAMPLES ,
291
284
PRIVATE_DOC_TESTS ) ;
@@ -298,7 +291,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
298
291
// and include the full URL, sort items in ascending order of issue numbers.
299
292
// - Later, change lint to error
300
293
// - Eventually, remove lint
301
- store. register_future_incompatible ( sess , vec ! [
294
+ store. register_future_incompatible ( vec ! [
302
295
FutureIncompatibleInfo {
303
296
id: LintId :: of( PRIVATE_IN_PUBLIC ) ,
304
297
reference: "issue #34537 <https://github.com/rust-lang/rust/issues/34537>" ,
@@ -498,12 +491,11 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
498
491
"converted into hard error, see https://github.com/rust-lang/rust/issues/46205" ) ;
499
492
}
500
493
501
- pub fn register_internals ( store : & mut lint:: LintStore , sess : Option < & Session > ) {
502
- store. register_early_pass ( sess , false , false , box DefaultHashTypes :: new ( ) ) ;
503
- store. register_early_pass ( sess , false , false , box LintPassImpl ) ;
504
- store. register_late_pass ( sess , false , false , false , box TyTyKind ) ;
494
+ pub fn register_internals ( store : & mut lint:: LintStore ) {
495
+ store. register_early_pass ( false , false , box DefaultHashTypes :: new ( ) ) ;
496
+ store. register_early_pass ( false , false , box LintPassImpl ) ;
497
+ store. register_late_pass ( false , false , false , box TyTyKind ) ;
505
498
store. register_group (
506
- sess,
507
499
false ,
508
500
"rustc::internal" ,
509
501
None ,
0 commit comments