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};
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;
}
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),
// 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.
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);
}