about summary refs log tree commit diff
path: root/src/librustc_mir/transform
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2015-06-13 13:15:03 -0700
committerEduard Burtescu <edy.burt@gmail.com>2016-03-09 16:45:28 +0200
commitb423a0f9ef488ca4cd9ff620a44566bb441eb21f (patch)
treeae43c17551512f743c1de53035a7f523b32aa6fa /src/librustc_mir/transform
parent4b868411afee1208cfb18f7440df991b9f94265f (diff)
downloadrust-b423a0f9ef488ca4cd9ff620a44566bb441eb21f.tar.gz
rust-b423a0f9ef488ca4cd9ff620a44566bb441eb21f.zip
Split TyBareFn into TyFnDef and TyFnPtr.
There's a lot of stuff wrong with the representation of these types:
TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to
represent method calls, TyFnDef in the sub-expression of a cast isn't
correctly reified, and probably some other stuff I haven't discovered yet.
Splitting them seems like the right first step, though.
Diffstat (limited to 'src/librustc_mir/transform')
-rw-r--r--src/librustc_mir/transform/type_check.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs
index bf22c7b0b8b..96ea9c11e31 100644
--- a/src/librustc_mir/transform/type_check.rs
+++ b/src/librustc_mir/transform/type_check.rs
@@ -421,7 +421,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
                 let func_ty = mir.operand_ty(tcx, func);
                 debug!("check_terminator: call, func_ty={:?}", func_ty);
                 let func_ty = match func_ty.sty {
-                    ty::TyBareFn(_, func_ty) => func_ty,
+                    ty::TyFnDef(_, func_ty) | ty::TyFnPtr(func_ty) => func_ty,
                     _ => {
                         span_mirbug!(self, term, "call to non-function {:?}", func_ty);
                         return;