X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fhair%2Fcx%2Fexpr.rs;h=801f4388ebd9e63ebc5aa8cd61822c6665eb7e9a;hb=b423a0f9ef488ca4cd9ff620a44566bb441eb21f;hp=1a8558b063aa2d31a1981324fc26c95886105703;hpb=bb868f17faed948e261f381b8511f7cac82c3041;p=rust.git diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index 1a8558b063a..801f4388ebd 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -61,7 +61,7 @@ fn make_mirror<'a>(self, cx: &mut Cx<'a, 'tcx>) -> Expr<'tcx> { 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") }; @@ -625,7 +625,7 @@ fn convert_path_expr<'a, 'tcx: 'a>(cx: &mut Cx<'a, 'tcx>, expr: &'tcx hir::Expr) 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 { @@ -640,7 +640,7 @@ fn convert_path_expr<'a, 'tcx: 'a>(cx: &mut Cx<'a, 'tcx>, expr: &'tcx hir::Expr) 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);