@@ -245,9 +245,9 @@ impl<'s> LintLevelsBuilder<'s> {
245
245
for ( attr_index, attr) in attrs. iter ( ) . enumerate ( ) {
246
246
let level = match Level :: from_attr ( attr) {
247
247
None => continue ,
248
- Some ( Level :: Expect ( unstable_id) ) if source_hir_id . is_some ( ) => {
249
- let stable_id =
250
- self . create_stable_id ( unstable_id , source_hir_id . unwrap ( ) , attr_index ) ;
248
+ Some ( Level :: Expect ( unstable_id) ) if let Some ( hir_id ) = source_hir_id => {
249
+ let stable_id = self . create_stable_id ( unstable_id , hir_id , attr_index ) ;
250
+
251
251
Level :: Expect ( stable_id)
252
252
}
253
253
Some ( lvl) => lvl,
@@ -303,12 +303,6 @@ impl<'s> LintLevelsBuilder<'s> {
303
303
}
304
304
}
305
305
306
- let ( unfulfilled_lint_lvl, unfulfilled_lint_src) = self . sets . get_lint_level (
307
- builtin:: UNFULFILLED_LINT_EXPECTATIONS ,
308
- self . cur ,
309
- Some ( & specs) ,
310
- & sess,
311
- ) ;
312
306
for ( lint_index, li) in metas. iter_mut ( ) . enumerate ( ) {
313
307
let level = match level {
314
308
Level :: Expect ( mut id) => {
@@ -360,15 +354,8 @@ impl<'s> LintLevelsBuilder<'s> {
360
354
self . insert_spec ( & mut specs, id, ( level, src) ) ;
361
355
}
362
356
if let Level :: Expect ( expect_id) = level {
363
- self . lint_expectations . insert (
364
- expect_id,
365
- LintExpectation :: new (
366
- reason,
367
- sp,
368
- unfulfilled_lint_lvl,
369
- unfulfilled_lint_src,
370
- ) ,
371
- ) ;
357
+ self . lint_expectations
358
+ . insert ( expect_id, LintExpectation :: new ( reason, sp) ) ;
372
359
}
373
360
}
374
361
@@ -386,15 +373,8 @@ impl<'s> LintLevelsBuilder<'s> {
386
373
self . insert_spec ( & mut specs, * id, ( level, src) ) ;
387
374
}
388
375
if let Level :: Expect ( expect_id) = level {
389
- self . lint_expectations . insert (
390
- expect_id,
391
- LintExpectation :: new (
392
- reason,
393
- sp,
394
- unfulfilled_lint_lvl,
395
- unfulfilled_lint_src,
396
- ) ,
397
- ) ;
376
+ self . lint_expectations
377
+ . insert ( expect_id, LintExpectation :: new ( reason, sp) ) ;
398
378
}
399
379
}
400
380
Err ( ( Some ( ids) , ref new_lint_name) ) => {
@@ -433,15 +413,8 @@ impl<'s> LintLevelsBuilder<'s> {
433
413
self . insert_spec ( & mut specs, * id, ( level, src) ) ;
434
414
}
435
415
if let Level :: Expect ( expect_id) = level {
436
- self . lint_expectations . insert (
437
- expect_id,
438
- LintExpectation :: new (
439
- reason,
440
- sp,
441
- unfulfilled_lint_lvl,
442
- unfulfilled_lint_src,
443
- ) ,
444
- ) ;
416
+ self . lint_expectations
417
+ . insert ( expect_id, LintExpectation :: new ( reason, sp) ) ;
445
418
}
446
419
}
447
420
Err ( ( None , _) ) => {
@@ -537,15 +510,8 @@ impl<'s> LintLevelsBuilder<'s> {
537
510
self . insert_spec ( & mut specs, id, ( level, src) ) ;
538
511
}
539
512
if let Level :: Expect ( expect_id) = level {
540
- self . lint_expectations . insert (
541
- expect_id,
542
- LintExpectation :: new (
543
- reason,
544
- sp,
545
- unfulfilled_lint_lvl,
546
- unfulfilled_lint_src,
547
- ) ,
548
- ) ;
513
+ self . lint_expectations
514
+ . insert ( expect_id, LintExpectation :: new ( reason, sp) ) ;
549
515
}
550
516
} else {
551
517
panic ! ( "renamed lint does not exist: {}" , new_name) ;
0 commit comments