@@ -245,9 +245,9 @@ impl<'s> LintLevelsBuilder<'s> {
245245 for ( attr_index, attr) in attrs. iter ( ) . enumerate ( ) {
246246 let level = match Level :: from_attr ( attr) {
247247 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+
251251 Level :: Expect ( stable_id)
252252 }
253253 Some ( lvl) => lvl,
@@ -303,12 +303,6 @@ impl<'s> LintLevelsBuilder<'s> {
303303 }
304304 }
305305
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- ) ;
312306 for ( lint_index, li) in metas. iter_mut ( ) . enumerate ( ) {
313307 let level = match level {
314308 Level :: Expect ( mut id) => {
@@ -360,15 +354,8 @@ impl<'s> LintLevelsBuilder<'s> {
360354 self . insert_spec ( & mut specs, id, ( level, src) ) ;
361355 }
362356 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) ) ;
372359 }
373360 }
374361
@@ -386,15 +373,8 @@ impl<'s> LintLevelsBuilder<'s> {
386373 self . insert_spec ( & mut specs, * id, ( level, src) ) ;
387374 }
388375 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) ) ;
398378 }
399379 }
400380 Err ( ( Some ( ids) , ref new_lint_name) ) => {
@@ -433,15 +413,8 @@ impl<'s> LintLevelsBuilder<'s> {
433413 self . insert_spec ( & mut specs, * id, ( level, src) ) ;
434414 }
435415 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) ) ;
445418 }
446419 }
447420 Err ( ( None , _) ) => {
@@ -537,15 +510,8 @@ impl<'s> LintLevelsBuilder<'s> {
537510 self . insert_spec ( & mut specs, id, ( level, src) ) ;
538511 }
539512 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) ) ;
549515 }
550516 } else {
551517 panic ! ( "renamed lint does not exist: {}" , new_name) ;
0 commit comments