I think that this transmute in particular is not a safe assumption. Someone using the compiler libraries could fairly easily construct a situation in which the tcx outlives the session (unintentionally), only to get befuddled once segfaults start cropping up.