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.
This commit is contained in:
Eli Friedman 2015-06-13 13:15:03 -07:00 committed by Eduard Burtescu
parent 4b868411af
commit b423a0f9ef
73 changed files with 406 additions and 324 deletions

View file

@ -135,12 +135,12 @@ pub fn enc_ty<'a, 'tcx>(w: &mut Cursor<Vec<u8>>, cx: &ctxt<'a, 'tcx>, t: Ty<'tcx
ty::TyStr => {
write!(w, "v");
}
ty::TyBareFn(Some(def_id), f) => {
ty::TyFnDef(def_id, f) => {
write!(w, "F");
write!(w, "{}|", (cx.ds)(def_id));
enc_bare_fn_ty(w, cx, f);
}
ty::TyBareFn(None, f) => {
ty::TyFnPtr(f) => {
write!(w, "G");
enc_bare_fn_ty(w, cx, f);
}