let method = method_callee(cx, self, ty::MethodCall::expr(self.id));
let sig = match method.ty.sty {
- ty::TyBareFn(_, fn_ty) => &fn_ty.sig,
+ ty::TyFnDef(_, fn_ty) => &fn_ty.sig,
_ => cx.tcx.sess.span_bug(self.span, "type of method is not an fn")
};
Def::Struct(def_id) => match cx.tcx.node_id_to_type(expr.id).sty {
// A tuple-struct constructor. Should only be reached if not called in the same
// expression.
- ty::TyBareFn(..) => (def_id, ItemKind::Function),
+ ty::TyFnDef(..) => (def_id, ItemKind::Function),
// A unit struct which is used as a value. We return a completely different ExprKind
// here to account for this special case.
ty::TyStruct(adt_def, substs) => return ExprKind::Adt {
Def::Variant(enum_id, variant_id) => match cx.tcx.node_id_to_type(expr.id).sty {
// A variant constructor. Should only be reached if not called in the same
// expression.
- ty::TyBareFn(..) => (variant_id, ItemKind::Function),
+ ty::TyFnDef(..) => (variant_id, ItemKind::Function),
// A unit variant, similar special case to the struct case above.
ty::TyEnum(adt_def, substs) => {
debug_assert!(adt_def.did == enum_id);
let region = cx.tcx.mk_region(region);
let self_expr = match cx.tcx.closure_kind(cx.tcx.map.local_def_id(closure_expr_id)) {
- ty::ClosureKind::FnClosureKind => {
+ ty::ClosureKind::Fn => {
let ref_closure_ty =
cx.tcx.mk_ref(region,
ty::TypeAndMut { ty: closure_ty,
}
}
}
- ty::ClosureKind::FnMutClosureKind => {
+ ty::ClosureKind::FnMut => {
let ref_closure_ty =
cx.tcx.mk_ref(region,
ty::TypeAndMut { ty: closure_ty,
}
}
}
- ty::ClosureKind::FnOnceClosureKind => {
+ ty::ClosureKind::FnOnce => {
Expr {
ty: closure_ty,
temp_lifetime: temp_lifetime,