#[cfg(test)] use syntax::print::pprust;
#[cfg(test)] use std::gc::Gc;
-struct DecodeContext<'a> {
+struct DecodeContext<'a, 'tcx: 'a> {
cdata: &'a cstore::crate_metadata,
- tcx: &'a ty::ctxt,
+ tcx: &'a ty::ctxt<'tcx>,
}
-struct ExtendedDecodeContext<'a> {
- dcx: &'a DecodeContext<'a>,
+struct ExtendedDecodeContext<'a, 'tcx: 'a> {
+ dcx: &'a DecodeContext<'a, 'tcx>,
from_id_range: ast_util::IdRange,
to_id_range: ast_util::IdRange
}
ast_util::IdRange { min: to_id_min, max: to_id_max }
}
-impl<'a> ExtendedDecodeContext<'a> {
+impl<'a, 'tcx> ExtendedDecodeContext<'a, 'tcx> {
pub fn tr_id(&self, id: ast::NodeId) -> ast::NodeId {
/*!
* Translates an internal id, meaning a node id that is known
Decodable::decode(&mut d).unwrap()
}
-struct AstRenumberer<'a> {
- xcx: &'a ExtendedDecodeContext<'a>,
+struct AstRenumberer<'a, 'tcx: 'a> {
+ xcx: &'a ExtendedDecodeContext<'a, 'tcx>,
}
-impl<'a> ast_map::FoldOps for AstRenumberer<'a> {
+impl<'a, 'tcx> ast_map::FoldOps for AstRenumberer<'a, 'tcx> {
fn new_id(&self, id: ast::NodeId) -> ast::NodeId {
if id == ast::DUMMY_NODE_ID {
// Used by ast_map to map the NodeInlinedParent.
// ______________________________________________________________________
// Encoding and decoding the side tables
-trait get_ty_str_ctxt {
- fn ty_str_ctxt<'a>(&'a self) -> tyencode::ctxt<'a>;
+trait get_ty_str_ctxt<'tcx> {
+ fn ty_str_ctxt<'a>(&'a self) -> tyencode::ctxt<'a, 'tcx>;
}
-impl<'a> get_ty_str_ctxt for e::EncodeContext<'a> {
- fn ty_str_ctxt<'a>(&'a self) -> tyencode::ctxt<'a> {
+impl<'a, 'tcx> get_ty_str_ctxt<'tcx> for e::EncodeContext<'a, 'tcx> {
+ fn ty_str_ctxt<'a>(&'a self) -> tyencode::ctxt<'a, 'tcx> {
tyencode::ctxt {
diag: self.tcx.sess.diagnostic(),
ds: e::def_to_string,