about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGus Wynn <guswynn@gmail.com>2021-09-11 10:50:09 -0700
committerGus Wynn <guswynn@gmail.com>2021-09-11 10:50:09 -0700
commit67ee91e77e8106357df63fc2d4b6f04f36ccd2da (patch)
treeda97bafcfe902d4de1908105d72925bfc5044ac2
parent2271376fb224661fd8b7e5e5788217e8fe9e5ecc (diff)
downloadrust-67ee91e77e8106357df63fc2d4b6f04f36ccd2da.tar.gz
rust-67ee91e77e8106357df63fc2d4b6f04f36ccd2da.zip
remove attempt at fn call
-rw-r--r--compiler/rustc_typeck/src/check/generator_interior.rs70
1 files changed, 1 insertions, 69 deletions
diff --git a/compiler/rustc_typeck/src/check/generator_interior.rs b/compiler/rustc_typeck/src/check/generator_interior.rs
index c5efc30a7c2..118c6e9a273 100644
--- a/compiler/rustc_typeck/src/check/generator_interior.rs
+++ b/compiler/rustc_typeck/src/check/generator_interior.rs
@@ -472,7 +472,7 @@ pub fn check_must_not_suspend_ty<'tcx>(
 
     let plural_suffix = pluralize!(plural_len);
 
-    let emitted = match *ty.kind() {
+    match *ty.kind() {
         ty::Adt(..) if ty.is_box() => {
             let boxed_ty = ty.boxed_ty();
             let descr_pre = &format!("{}boxed ", descr_pre);
@@ -589,58 +589,6 @@ pub fn check_must_not_suspend_ty<'tcx>(
             }
         },
         _ => false,
-    };
-
-    // Don't move onto the "return value" path if we already sent a diagnostic
-    if emitted {
-        return true;
-    }
-
-    match expr {
-        Some(expr) => match expr.kind {
-            hir::ExprKind::Call(ref callee, _) => {
-                match callee.kind {
-                    hir::ExprKind::Path(ref qpath) => {
-                        match fcx.typeck_results.borrow().qpath_res(qpath, callee.hir_id) {
-                            Res::Def(DefKind::Fn | DefKind::AssocFn, def_id) => {
-                                check_must_not_suspend_def(
-                                    fcx.tcx,
-                                    def_id,
-                                    hir_id,
-                                    source_span,
-                                    yield_span,
-                                    "return value of ",
-                                    "",
-                                )
-                            }
-
-                            // `Res::Local` if it was a closure, for which we
-                            // do not currently support must-not-suspend linting
-                            _ => false,
-                        }
-                    }
-                    _ => false,
-                }
-            }
-            hir::ExprKind::MethodCall(..) => {
-                if let Some(def_id) = fcx.typeck_results.borrow().type_dependent_def_id(expr.hir_id)
-                {
-                    check_must_not_suspend_def(
-                        fcx.tcx,
-                        def_id,
-                        hir_id,
-                        source_span,
-                        yield_span,
-                        "return value of ",
-                        "",
-                    )
-                } else {
-                    false
-                }
-            }
-            _ => false,
-        },
-        None => false,
     }
 }
 
@@ -687,22 +635,6 @@ fn check_must_not_suspend_def(
                 },
             );
 
-            /*
-            cx.struct_span_lint(UNUSED_MUST_USE, span, |lint| {
-                let msg = format!(
-                    "unused {}`{}`{} that must be used",
-                    descr_pre_path,
-                    cx.tcx.def_path_str(def_id),
-                    descr_post_path
-                );
-                let mut err = lint.build(&msg);
-                // check for #[must_use = "..."]
-                if let Some(note) = attr.value_str() {
-                    err.note(&note.as_str());
-                }
-                err.emit();
-            });
-            */
             return true;
         }
     }