infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
pub param_env: ty::ParamEnv<'tcx>,
pub region_maps: Rc<RegionMaps>,
+ pub tables: &'a ty::TypeckTables<'gcx>,
/// This is `Constness::Const` if we are compiling a `static`,
/// `const`, or the body of a `const fn`.
let param_env = tcx.param_env(src_def_id);
let region_maps = tcx.region_maps(src_def_id);
+ let tables = tcx.typeck_tables_of(src_def_id);
let attrs = tcx.hir.attrs(src_id);
// Constants and const fn's always need overflow checks.
check_overflow |= constness == hir::Constness::Const;
- Cx { tcx, infcx, param_env, region_maps, constness, src, check_overflow }
+ Cx { tcx, infcx, param_env, region_maps, tables, constness, src, check_overflow }
}
}
}
pub fn tables(&self) -> &'a ty::TypeckTables<'gcx> {
- self.infcx.tables.expect_interned()
+ self.tables
}
pub fn check_overflow(&self) -> bool {