]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/closure.rs
compiletest: Do not run debuginfo tests with gdb on msvc targets
[rust.git] / src / librustc_typeck / check / closure.rs
index 8bff95cd49740fae36a896fe0d20f5f22ecfb991..084e6c8d083c5be9999ec2f02e17d1dfc1ab238b 100644 (file)
@@ -4,8 +4,6 @@
 
 use crate::astconv::AstConv;
 use crate::middle::{lang_items, region};
-use rustc::hir;
-use rustc::hir::def_id::DefId;
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::infer::LateBoundRegionConversionTime;
 use rustc::infer::{InferOk, InferResult};
@@ -14,6 +12,8 @@
 use rustc::ty::fold::TypeFoldable;
 use rustc::ty::subst::InternalSubsts;
 use rustc::ty::{self, GenericParamDefKind, Ty};
+use rustc_hir as hir;
+use rustc_hir::def_id::DefId;
 use rustc_span::source_map::Span;
 use rustc_target::spec::abi::Abi;
 use std::cmp;
@@ -175,7 +175,7 @@ fn deduce_expectations_from_expected_type(
             }
             ty::Infer(ty::TyVar(vid)) => self.deduce_expectations_from_obligations(vid),
             ty::FnPtr(sig) => {
-                let expected_sig = ExpectedSig { cause_span: None, sig: sig.skip_binder().clone() };
+                let expected_sig = ExpectedSig { cause_span: None, sig: *sig.skip_binder() };
                 (Some(expected_sig), Some(ty::ClosureKind::Fn))
             }
             _ => (None, None),
@@ -548,8 +548,8 @@ fn supplied_sig_of_closure(
         // First, convert the types that the user supplied (if any).
         let supplied_arguments = decl.inputs.iter().map(|a| astconv.ast_ty_to_ty(a));
         let supplied_return = match decl.output {
-            hir::Return(ref output) => astconv.ast_ty_to_ty(&output),
-            hir::DefaultReturn(_) => match body.generator_kind {
+            hir::FunctionRetTy::Return(ref output) => astconv.ast_ty_to_ty(&output),
+            hir::FunctionRetTy::DefaultReturn(_) => match body.generator_kind {
                 // In the case of the async block that we create for a function body,
                 // we expect the return type of the block to match that of the enclosing
                 // function.
@@ -696,7 +696,7 @@ fn error_sig_of_closure(&self, decl: &hir::FnDecl<'_>) -> ty::PolyFnSig<'tcx> {
             self.tcx.types.err
         });
 
-        if let hir::Return(ref output) = decl.output {
+        if let hir::FunctionRetTy::Return(ref output) = decl.output {
             astconv.ast_ty_to_ty(&output);
         }