@@ -472,7 +472,7 @@ pub fn check_must_not_suspend_ty<'tcx>(
472472
473473 let plural_suffix = pluralize ! ( plural_len) ;
474474
475- let emitted = match * ty. kind ( ) {
475+ match * ty. kind ( ) {
476476 ty:: Adt ( ..) if ty. is_box ( ) => {
477477 let boxed_ty = ty. boxed_ty ( ) ;
478478 let descr_pre = & format ! ( "{}boxed " , descr_pre) ;
@@ -589,58 +589,6 @@ pub fn check_must_not_suspend_ty<'tcx>(
589589 }
590590 } ,
591591 _ => false ,
592- } ;
593-
594- // Don't move onto the "return value" path if we already sent a diagnostic
595- if emitted {
596- return true ;
597- }
598-
599- match expr {
600- Some ( expr) => match expr. kind {
601- hir:: ExprKind :: Call ( ref callee, _) => {
602- match callee. kind {
603- hir:: ExprKind :: Path ( ref qpath) => {
604- match fcx. typeck_results . borrow ( ) . qpath_res ( qpath, callee. hir_id ) {
605- Res :: Def ( DefKind :: Fn | DefKind :: AssocFn , def_id) => {
606- check_must_not_suspend_def (
607- fcx. tcx ,
608- def_id,
609- hir_id,
610- source_span,
611- yield_span,
612- "return value of " ,
613- "" ,
614- )
615- }
616-
617- // `Res::Local` if it was a closure, for which we
618- // do not currently support must-not-suspend linting
619- _ => false ,
620- }
621- }
622- _ => false ,
623- }
624- }
625- hir:: ExprKind :: MethodCall ( ..) => {
626- if let Some ( def_id) = fcx. typeck_results . borrow ( ) . type_dependent_def_id ( expr. hir_id )
627- {
628- check_must_not_suspend_def (
629- fcx. tcx ,
630- def_id,
631- hir_id,
632- source_span,
633- yield_span,
634- "return value of " ,
635- "" ,
636- )
637- } else {
638- false
639- }
640- }
641- _ => false ,
642- } ,
643- None => false ,
644592 }
645593}
646594
@@ -687,22 +635,6 @@ fn check_must_not_suspend_def(
687635 } ,
688636 ) ;
689637
690- /*
691- cx.struct_span_lint(UNUSED_MUST_USE, span, |lint| {
692- let msg = format!(
693- "unused {}`{}`{} that must be used",
694- descr_pre_path,
695- cx.tcx.def_path_str(def_id),
696- descr_post_path
697- );
698- let mut err = lint.build(&msg);
699- // check for #[must_use = "..."]
700- if let Some(note) = attr.value_str() {
701- err.note(¬e.as_str());
702- }
703- err.emit();
704- });
705- */
706638 return true ;
707639 }
708640 }
0 commit comments